Pimcore\Model\Document\Page::getTitle PHP Method

getTitle() public method

public getTitle ( ) : string
return string
    public function getTitle()
    {
        return \Pimcore\Tool\Text::removeLineBreaks($this->title);
    }

Usage Example

Example #1
0
 /**
  * @param boolean $callParent
  * @param bool $withSelf
  * @return array|string
  */
 public function getTitle($callParent = true, $withSelf = true)
 {
     if ($callParent) {
         return parent::getTitle();
     }
     $title = array();
     foreach ($this->getPagesOnPath($withSelf) as $page) {
         $pageTitle = trim($page->getTitle());
         if (empty($pageTitle)) {
             $pageTitle = trim($page->getProperty('navigation_name'));
         }
         if (!empty($pageTitle)) {
             $title[] = $pageTitle;
         }
     }
     return $title;
 }