-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Cms
- Twig
- Extension
Cms\Twig\Extension
Source: ~/modules/cms/twig/Extension.php
Extends:
- Twig_Extension
Implements:
- Twig_ExtensionInterface
The CMS Twig extension class implements the basic CMS Twig functions and filters.
Protected properties
protected Cms\Classes\Controller $controller
A reference to the CMS controller.
Public methods
public void __construct(Cms\Classes\Controller $controller=NULL)
Creates the extension instance.
Parameters
- Cms\Classes\Controller $controller - The CMS controller object.
public string assetsFunction($type=NULL)
Renders registered assets of a given type
Parameters
- $type
public string componentFunction(string $name, array $parameters=array())
Renders a component's default content.
Parameters
- string $name - Specifies the component name.
- array $parameters - A optional list of parameters to pass to the component.
public string contentFunction(string $name, array $parameters=array())
Renders a content file.
Parameters
- string $name - Specifies the content block name.
- array $parameters - A optional list of parameters to pass to the content.
public mixed displayBlock(string $name, string $default=NULL)
Returns a layout block contents and removes the block.
Parameters
- string $name - Specifies the block name
- string $default - The default placeholder contents.
public void endBlock($append=true)
Closes a layout block.
Parameters
- $append
public array getFilters()
Returns a list of filters this extensions provides.
public array getFunctions()
Returns a list of functions to add to the existing list.
public array getTokenParsers()
Returns a list of token parsers this extensions provides.
public string pageFilter(mixed $name, array $parameters=array(), bool $routePersistence=true)
Looks up the URL for a supplied page and returns it relative to the website root.
Parameters
- mixed $name - Specifies the Cms Page file name.
- array $parameters - Route parameters to consider in the URL.
- bool $routePersistence - By default the existing routing parameters will be included when creating the URL, set to false to disable this feature.
public string pageFunction()
Renders a page. This function should be used in the layout code to output the requested page.
public string partialFunction(string $name, array $parameters=array(), bool $throwException=false)
Renders a partial.
Parameters
- string $name - Specifies the partial name.
- array $parameters - A optional list of parameters to pass to the partial.
- bool $throwException - Throw an exception if the partial is not found.
public string placeholderFunction($name, $default=NULL)
Renders a placeholder content, without removing the block, must be called before the placeholder tag itself
Parameters
- $name
- $default
public void startBlock(string $name)
Opens a layout block.
Parameters
- string $name - Specifies the block name
public string themeFilter(mixed $url)
Converts supplied URL to a theme URL relative to the website root. If the URL provided is an array then the files will be combined.
Parameters
- mixed $url - Specifies the theme-relative URL
Inherited public methods
- public void getNodeVisitors() - defined in Twig_Extension.
- public void getOperators() - defined in Twig_Extension.
- public void getTests() - defined in Twig_Extension.