Redaxscript\Breadcrumb::_create PHP Method

_create() protected method

create the breadcrumb array
Since: 2.1.0
protected _create ( integer $key )
$key integer key of the item
    protected function _create($key = 0)
    {
        $aliasValidator = new Validator\Alias();
        $title = $this->_registry->get('metaTitle');
        $firstParameter = $this->_registry->get('firstParameter');
        $firstTable = $this->_registry->get('firstTable');
        $fullRoute = $this->_registry->get('fullRoute');
        $lastId = $this->_registry->get('lastId');
        /* title */
        if ($title) {
            $this->_breadcrumbArray[$key]['title'] = $title;
        } else {
            if (!$fullRoute) {
                $this->_breadcrumbArray[$key]['title'] = $this->_language->get('home');
            } else {
                if ($firstParameter === 'admin') {
                    $this->_createAdmin($key);
                } else {
                    if ($aliasValidator->validate($firstParameter, Validator\Alias::MODE_DEFAULT) === Validator\ValidatorInterface::PASSED) {
                        /* join default title */
                        if ($firstParameter && $this->_language->get($firstParameter)) {
                            $this->_breadcrumbArray[$key]['title'] = $this->_language->get($firstParameter);
                        }
                    } else {
                        if (!$lastId) {
                            $this->_breadcrumbArray[$key]['title'] = $this->_language->get('error');
                        } else {
                            if ($firstTable) {
                                $this->_createContent($key);
                            }
                        }
                    }
                }
            }
        }
    }