PHP 클래스 Networking\InitCmsBundle\Twig\Extension\NetworkingHelperExtension

저자: Yorkie Chadwick ([email protected])
상속: extends Twig_Extension, implements Symfony\Component\DependencyInjection\ContainerAwareInterface
파일 보기 프로젝트 열기: networking/init-cms-bundle

보호된 프로퍼티들

프로퍼티 타입 설명
$captureLock boolean
$ckeditorRendered boolean
$collectedHtml array
$container Symfony\Component\DependencyInjection\ContainerInterface Container

공개 메소드들

메소드 설명
addToBottom ( )
addToBottomEnd ( )
base64Encode ( $value ) : string
camelize ( $str, boolean $firstToCapital = false ) : mixed Camelize a string
ckeditorIsRendered ( ) : boolean Verify if the ckeditor has already been rendered on a page or not
cropMiddle ( $text, $maxLength, string $delimiter = '...' ) : string
excerpt ( Twig_Environment $env, string $text, string $phrase, integer $radius = 100, string $ellipsis = '...' ) : string Extracts an excerpt from the text surrounding the phrase with a number of characters on each side determined by radius.
getBundleName ( $class ) : string
getBundleShortName ( $class ) : mixed
getContentCss ( null $configName = null ) : boolean Return the path to the content css for the default or named ckeditor config contentsCss
getContentTypeOptions ( ) : mixed
getCurrentAdminLocale ( Sonata\AdminBundle\Admin\AdminInterface $admin ) : mixed | string returns the locale of the current admin user
getCurrentTemplate ( ) : array | mixed
getFieldValue ( $object, $fieldName, null $method = null ) : mixed Fetch the variables from the given content type object
getFileIcon ( $filename ) : string Guess which fontawesome icon to use
getFilters ( )
getFormFieldZone ( Symfony\Component\Form\FormView $formView ) : mixed
getFunctions ( ) : array Returns a list of functions to add to the existing list.
getHumanReadableSize ( $size, null $unit = null, integer $decemals = 2 ) : string
getInitCmsTemplateZones ( ) : mixed
getInitcmsAdminIconPath ( Sonata\AdminBundle\Admin\AdminInterface $admin, string $size = 'small', boolean $active = false ) : string Guess which icon should represent an entity admin
getMediaById ( $id ) : mixed Return a media object by its' id
getName ( ) : string Returns the name of the extension.
getPageUrl ( Networking\InitCmsBundle\Model\PageInterface $page ) : mixed
getParameter ( string $name ) : mixed Get parameters from the service container
getService ( string $id ) : object Gets a service.
getShortName ( $class ) : string
getSubFormsByZone ( $formChildren, $zone ) : array Gets a list of forms sorted to a particular zone
getTokenParsers ( ) : array Returns the token parser instance to add to the existing list.
getZoneNames ( ) : array
highlight ( string $text, string $phrase, string $format = '<span class="highlight">\1</span>', boolean $html = false, string $regex = "|%s|iu" ) : mixed Highlights a given phrase in a text. You can specify any expression in highlighter that may include the \1 expression to include the $phrase found.
isAdminActive ( Sonata\AdminBundle\Admin\AdminInterface $admin, string $adminCode = '' ) : boolean
isAdminGroupActive ( array $group, string $adminCode = '' ) : boolean
networking_init_cms_resource_bundle ( $class ) : string
render ( ) : string
renderAdminSubNav ( Sonata\AdminBundle\Admin\AdminInterface $admin, string $adminCode = '' ) : boolean | Knp\Menu\ItemInterface
renderContentTypeName ( Networking\InitCmsBundle\Model\LayoutBlockInterface $layoutBlock ) : mixed
renderInitCmsBlock ( $template, Networking\InitCmsBundle\Model\LayoutBlockInterface $layoutBlock, array $params = [] ) : string Returns an HTML block for output in the frontend
renderInitcmsAdminBlock ( Networking\InitCmsBundle\Model\LayoutBlockInterface $layoutBlock ) : boolean Returns an HTML block for output in the admin area
renderInitcmsFieldAsString ( $template, $object, Symfony\Component\Form\FormView $formView, null $translationDomain = null ) : mixed
returnConfigValue ( $name ) Return the config Value
setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container = null ) Sets the Container.
slugify ( $text ) : mixed | string Modifies a string to remove all non ASCII characters and spaces.
truncate ( Twig_Environment $env, string $text, integer $length = 100, string $ellipsis = '...', boolean $exact = true, boolean $html = false ) : string Cuts a string to the length of $length and replaces the last characters with the ellipsis if the text is longer than length.

보호된 메소드들

메소드 설명
addToCollectedHtml ( $data )
getDoctrine ( ) : Doctrine\Bundle\DoctrineBundle\Registry Shortcut to return the Doctrine Registry service.
getZonesByTemplate ( $template ) : mixed
jsString ( $s ) : string

비공개 메소드들

메소드 설명
getCurrentLocale ( ) : mixed

메소드 상세

addToBottom() 공개 메소드

public addToBottom ( )

addToBottomEnd() 공개 메소드

public addToBottomEnd ( )

addToCollectedHtml() 보호된 메소드

protected addToCollectedHtml ( $data )
$data

base64Encode() 공개 메소드

public base64Encode ( $value ) : string
$value
리턴 string

camelize() 공개 정적인 메소드

Camelize a string
public static camelize ( $str, boolean $firstToCapital = false ) : mixed
$str
$firstToCapital boolean
리턴 mixed

ckeditorIsRendered() 공개 메소드

Verify if the ckeditor has already been rendered on a page or not
public ckeditorIsRendered ( ) : boolean
리턴 boolean

cropMiddle() 공개 메소드

public cropMiddle ( $text, $maxLength, string $delimiter = '...' ) : string
$text
$maxLength
$delimiter string
리턴 string

excerpt() 공개 메소드

Extracts an excerpt from the text surrounding the phrase with a number of characters on each side determined by radius.
public excerpt ( Twig_Environment $env, string $text, string $phrase, integer $radius = 100, string $ellipsis = '...' ) : string
$env Twig_Environment
$text string String to search the phrase in
$phrase string Phrase that will be searched for
$radius integer The amount of characters that will be returned on each side of the founded phrase
$ellipsis string Ending that will be appended
리턴 string

getBundleName() 공개 메소드

public getBundleName ( $class ) : string
$class
리턴 string

getBundleShortName() 공개 메소드

public getBundleShortName ( $class ) : mixed
$class
리턴 mixed

getContentCss() 공개 메소드

Return the path to the content css for the default or named ckeditor config contentsCss
public getContentCss ( null $configName = null ) : boolean
$configName null
리턴 boolean

getContentTypeOptions() 공개 메소드

public getContentTypeOptions ( ) : mixed
리턴 mixed

getCurrentAdminLocale() 공개 메소드

returns the locale of the current admin user
public getCurrentAdminLocale ( Sonata\AdminBundle\Admin\AdminInterface $admin ) : mixed | string
$admin Sonata\AdminBundle\Admin\AdminInterface
리턴 mixed | string

getCurrentTemplate() 공개 메소드

public getCurrentTemplate ( ) : array | mixed
리턴 array | mixed

getDoctrine() 보호된 메소드

Shortcut to return the Doctrine Registry service.
protected getDoctrine ( ) : Doctrine\Bundle\DoctrineBundle\Registry
리턴 Doctrine\Bundle\DoctrineBundle\Registry

getFieldValue() 공개 메소드

Fetch the variables from the given content type object
public getFieldValue ( $object, $fieldName, null $method = null ) : mixed
$object
$fieldName
$method null
리턴 mixed

getFileIcon() 공개 메소드

Guess which fontawesome icon to use
public getFileIcon ( $filename ) : string
$filename
리턴 string

getFilters() 공개 메소드

public getFilters ( )

getFormFieldZone() 공개 메소드

public getFormFieldZone ( Symfony\Component\Form\FormView $formView ) : mixed
$formView Symfony\Component\Form\FormView
리턴 mixed

getFunctions() 공개 메소드

Returns a list of functions to add to the existing list.
public getFunctions ( ) : array
리턴 array An array of functions

getHumanReadableSize() 공개 메소드

public getHumanReadableSize ( $size, null $unit = null, integer $decemals = 2 ) : string
$size
$unit null
$decemals integer
리턴 string

getInitCmsTemplateZones() 공개 메소드

public getInitCmsTemplateZones ( ) : mixed
리턴 mixed

getInitcmsAdminIconPath() 공개 메소드

Guess which icon should represent an entity admin
public getInitcmsAdminIconPath ( Sonata\AdminBundle\Admin\AdminInterface $admin, string $size = 'small', boolean $active = false ) : string
$admin Sonata\AdminBundle\Admin\AdminInterface
$size string
$active boolean
리턴 string

getMediaById() 공개 메소드

Return a media object by its' id
public getMediaById ( $id ) : mixed
$id
리턴 mixed

getName() 공개 메소드

Returns the name of the extension.
public getName ( ) : string
리턴 string The extension name

getPageUrl() 공개 메소드

public getPageUrl ( Networking\InitCmsBundle\Model\PageInterface $page ) : mixed
$page Networking\InitCmsBundle\Model\PageInterface
리턴 mixed

getParameter() 공개 메소드

Get parameters from the service container
public getParameter ( string $name ) : mixed
$name string
리턴 mixed

getService() 공개 메소드

Gets a service.
public getService ( string $id ) : object
$id string The service identifier
리턴 object The associated service

getShortName() 공개 메소드

public getShortName ( $class ) : string
$class
리턴 string

getSubFormsByZone() 공개 메소드

Gets a list of forms sorted to a particular zone
public getSubFormsByZone ( $formChildren, $zone ) : array
$formChildren
$zone
리턴 array

getTokenParsers() 공개 메소드

Returns the token parser instance to add to the existing list.
public getTokenParsers ( ) : array
리턴 array An array of Twig_TokenParser instances

getZoneNames() 공개 메소드

public getZoneNames ( ) : array
리턴 array

getZonesByTemplate() 보호된 메소드

protected getZonesByTemplate ( $template ) : mixed
$template
리턴 mixed

highlight() 공개 메소드

Highlights a given phrase in a text. You can specify any expression in highlighter that may include the \1 expression to include the $phrase found.
public highlight ( string $text, string $phrase, string $format = '<span class="highlight">\1</span>', boolean $html = false, string $regex = "|%s|iu" ) : mixed
$text string Text to search the phrase in
$phrase string The phrase that will be searched
$format string The piece of html with that the phrase will be highlighted
$html boolean If true, will ignore any HTML tags, ensuring that only the correct text is highlighted
$regex string a custom regex rule that is used to match words, default is '|$tag|iu'
리턴 mixed

isAdminActive() 공개 메소드

public isAdminActive ( Sonata\AdminBundle\Admin\AdminInterface $admin, string $adminCode = '' ) : boolean
$admin Sonata\AdminBundle\Admin\AdminInterface
$adminCode string
리턴 boolean

isAdminGroupActive() 공개 메소드

public isAdminGroupActive ( array $group, string $adminCode = '' ) : boolean
$group array
$adminCode string
리턴 boolean

jsString() 보호된 메소드

protected jsString ( $s ) : string
$s
리턴 string

networking_init_cms_resource_bundle() 공개 메소드

public networking_init_cms_resource_bundle ( $class ) : string
$class
리턴 string

render() 공개 메소드

public render ( ) : string
리턴 string

renderAdminSubNav() 공개 메소드

public renderAdminSubNav ( Sonata\AdminBundle\Admin\AdminInterface $admin, string $adminCode = '' ) : boolean | Knp\Menu\ItemInterface
$admin Sonata\AdminBundle\Admin\AdminInterface
$adminCode string
리턴 boolean | Knp\Menu\ItemInterface

renderContentTypeName() 공개 메소드

public renderContentTypeName ( Networking\InitCmsBundle\Model\LayoutBlockInterface $layoutBlock ) : mixed
$layoutBlock Networking\InitCmsBundle\Model\LayoutBlockInterface
리턴 mixed

renderInitCmsBlock() 공개 메소드

Returns an HTML block for output in the frontend
public renderInitCmsBlock ( $template, Networking\InitCmsBundle\Model\LayoutBlockInterface $layoutBlock, array $params = [] ) : string
$template
$layoutBlock Networking\InitCmsBundle\Model\LayoutBlockInterface
$params array
리턴 string

renderInitcmsAdminBlock() 공개 메소드

Returns an HTML block for output in the admin area
public renderInitcmsAdminBlock ( Networking\InitCmsBundle\Model\LayoutBlockInterface $layoutBlock ) : boolean
$layoutBlock Networking\InitCmsBundle\Model\LayoutBlockInterface
리턴 boolean

renderInitcmsFieldAsString() 공개 메소드

public renderInitcmsFieldAsString ( $template, $object, Symfony\Component\Form\FormView $formView, null $translationDomain = null ) : mixed
$template
$object
$formView Symfony\Component\Form\FormView
$translationDomain null
리턴 mixed

returnConfigValue() 공개 메소드

Return the config Value
public returnConfigValue ( $name )

setContainer() 공개 메소드

Sets the Container.
public setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container = null )
$container Symfony\Component\DependencyInjection\ContainerInterface A ContainerInterface instance or null

slugify() 공개 정적인 메소드

Modifies a string to remove all non ASCII characters and spaces.
public static slugify ( $text ) : mixed | string
$text
리턴 mixed | string

truncate() 공개 정적인 메소드

Cuts a string to the length of $length and replaces the last characters with the ellipsis if the text is longer than length.
public static truncate ( Twig_Environment $env, string $text, integer $length = 100, string $ellipsis = '...', boolean $exact = true, boolean $html = false ) : string
$env Twig_Environment
$text string String to truncate.
$length integer Length of returned string, including ellipsis.
$ellipsis string Will be used as Ending and appended to the trimmed string (`ending` is deprecated)
$exact boolean If false, $text will not be cut mid-word
$html boolean If true, HTML tags would be handled correctly
리턴 string

프로퍼티 상세

$captureLock 보호되어 있는 프로퍼티

protected bool $captureLock
리턴 boolean

$ckeditorRendered 보호되어 있는 프로퍼티

protected bool $ckeditorRendered
리턴 boolean

$collectedHtml 보호되어 있는 프로퍼티

protected array $collectedHtml
리턴 array

$container 보호되어 있는 프로퍼티

Container
protected ContainerInterface,Symfony\Component\DependencyInjection $container
리턴 Symfony\Component\DependencyInjection\ContainerInterface