Redaxscript\Breadcrumb::_createContent PHP Method

_createContent() protected method

create the breadcrumb array for current content
Since: 2.1.0
protected _createContent ( integer $key )
$key integer
    protected function _createContent($key = 0)
    {
        $firstParameter = $this->_registry->get('firstParameter');
        $secondParameter = $this->_registry->get('secondParameter');
        $thirdParameter = $this->_registry->get('thirdParameter');
        $lastParameter = $this->_registry->get('lastParameter');
        $firstTable = $this->_registry->get('firstTable');
        $secondTable = $this->_registry->get('secondTable');
        $thirdTable = $this->_registry->get('thirdTable');
        /* join first title */
        $this->_breadcrumbArray[$key]['title'] = Db::forTablePrefix($firstTable)->where('alias', $firstParameter)->findOne()->title;
        /* set route */
        if ($firstParameter !== $lastParameter) {
            $this->_breadcrumbArray[$key]['route'] = $firstParameter;
        }
        /* join second title */
        if ($secondTable) {
            $key++;
            $this->_breadcrumbArray[$key]['title'] = Db::forTablePrefix($secondTable)->where('alias', $secondParameter)->findOne()->title;
            /* set route */
            if ($secondParameter !== $lastParameter) {
                $this->_breadcrumbArray[$key]['route'] = $firstParameter . '/' . $secondParameter;
            }
            /* join third title */
            if ($thirdTable) {
                $key++;
                $this->_breadcrumbArray[$key]['title'] = Db::forTablePrefix($thirdTable)->where('alias', $thirdParameter)->findOne()->title;
            }
        }
    }