src/View/Helper/MetaHelper.php
public function twitter($entity)
    {
        $twitterName = Configure::read('Settings.Cms.SEO.Social.twitter_username');
        if ($twitterName !== null) {
            $twitterName = '@' . $twitterName;
        }

        $attributes = [
            'twitter:card' => 'summary',
            'twitter:title' => $this->_getTitle($entity),
            'twitter:description' => $entity->attributes['og:description'] ?? $entity->meta_description,
            'twitter:image' => $this->_getSocialImage($entity),
            'twitter:site' => $twitterName,
            'twitter:creator' => $twitterName,
        ];

        $out = '';
        foreach ($attributes as $property => $content) {
            $out .= $this->_render(self::ATTR_NAME, $property, $content);
        }

        return $out;
    }
public function twitter($entity)
    {
        $twitterName = Configure::read('Settings.Cms.SEO.Social.twitter_username');
        if ($twitterName !== null) {
            $twitterName = '@' . $twitterName;
        }

        $attributes = [
            'twitter:card' => 'summary',
            'twitter:title' => $this->_getTitle($entity),
            'twitter:description' => $entity->attributes['og:description'] ?? $entity->meta_description,
            'twitter:image' => $this->_getSocialImage($entity),
            'twitter:site' => $twitterName,
            'twitter:creator' => $twitterName,
        ];

        $out = '';
        foreach ($attributes as $property => $content) {
            $out .= $this->_render(self::ATTR_NAME, $property, $content);
        }

        return $out;
    }
public function twitter ( $ entity ) { $ twitterName = Configure :: read ( 'Settings.Cms.SEO.Social.twitter_username' ) ; if ( $ twitterName !== null ) { $ twitterName = '@' . $ twitterName ; } $ attributes = [ 'twitter:card' => 'summary' , 'twitter:title' => $ this -> _getTitle ( $ entity ) , 'twitter:description' => $ entity -> attributes [ 'og:description' ] ?? $ entity -> meta_description , 'twitter:image' => $ this -> _getSocialImage ( $ entity ) , 'twitter:site' => $ twitterName , 'twitter:creator' => $ twitterName , ] ; $ out = '' ; foreach ( $ attributes as $ property => $ content ) { $ out .= $ this -> _render ( self :: ATTR_NAME , $ property , $ content ) ; } return $ out ; }
Render all twitter tags.

@param PublishableEntity $entity The entity, e.g. Page or Post.
@return string
Render all twitter tags .