Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Provide Layout support for MVC applications
Zend_View_Helper_Placeholder_Container $_container = ''
Placeholder container for layout variables
string $_contentKey = 'content'
Key used to store content from 'default' named response segment
bool $_enabled = 'true'
Are layouts enabled?
string $_helperClass = 'Zend_Layout_Controller_Action_Helper_Layout'
Helper class
Zend_Filter_Inflector $_inflector = ''
Inflector used to resolve layout script
bool $_inflectorEnabled = 'true'
Flag: is inflector enabled?
string $_inflectorTarget = ':script.:suffix'
Inflector target
string $_layout = 'layout'
Layout view
bool $_mvcEnabled = 'true'
Flag: is MVC integration enabled?
Zend_Layout $_mvcInstance = ''
Instance registered with MVC, if any
bool $_mvcSuccessfulActionOnly = 'true'
Flag: is MVC successful action only flag set?
string $_pluginClass = 'Zend_Layout_Controller_Plugin_Layout'
Plugin class
Zend_View_Interface $_view = ''
$_viewBasePath = 'null'
$_viewBasePrefix = 'Layout_View'
string $_viewScriptPath = 'null'
Layout view script path
string $_viewSuffix = 'phtml'
View script suffix for layout script
__construct(
string|array|Zend_Config $options
=
null, $initMvc
=
false
)
:
void
Constructor
Accepts either: - A string path to layouts - An array of options - A Zend_Config object with options
Layout script path, either as argument or as key in options, is required.
If mvcEnabled flag is false from options, simply sets layout script path. Otherwise, also instantiates and registers action helper and controller plugin.
__get(
string $key
)
:
mixed
Get layout variable
__isset(
string $key
)
:
bool
Is a layout variable set?
__set(
string $key, mixed $value
)
:
void
Set layout variable
__unset(
string $key
)
:
void
Unset a layout variable?
_initHelper(
)
:
void
Initialize action helper
_initMvc(
)
:
void
Initialize MVC integration
_initPlugin(
)
:
void
Initialize front controller plugin
_initVarContainer(
)
:
Zend_View_Helper_Placeholder_Container
Initialize placeholder container for layout vars
_setMvcEnabled(
bool $mvcEnabled
)
:
Zend_Layout
Set MVC enabled flag
assign(
mixed $spec, mixed $value
=
null
)
:
Zend_Layout
Assign one or more layout variables
disableInflector(
)
:
Zend_Layout
Disable inflector
disableLayout(
)
:
Zend_Layout
Disable layout
enableInflector(
)
:
Zend_Layout
Enable inflector
enableLayout(
)
:
Zend_Layout
Enable layout
getContentKey(
)
:
string
Retrieve content key
getHelperClass(
)
:
string
Retrieve helper class
getInflector(
)
:
Zend_Filter_Inflector
Retrieve inflector
getInflectorTarget(
)
:
string
Retrieve inflector target
getLayout(
)
:
string
Get current layout script
getLayoutPath(
)
:
string
Get current layout script path
getMvcEnabled(
)
:
bool
Retrieve MVC enabled flag
getMvcInstance(
)
:
Zend_Layout|null
Retrieve MVC instance of Zend_Layout object
getMvcSuccessfulActionOnly(
)
:
bool
Get MVC Successful Action Only Flag
getPluginClass(
)
:
string
Retrieve plugin class
getView(
)
:
Zend_View_Interface
Get current view object
If no view object currently set, retrieves it from the ViewRenderer.
getViewBasePath(
)
:
getViewScriptPath(
)
:
getViewSuffix(
)
:
string
Retrieve layout view script suffix
inflectorEnabled(
)
:
bool
Return status of inflector enabled flag
isEnabled(
)
:
bool
Is layout enabled?
render(
mixed $name
=
null
)
:
mixed
Render layout
Sets internal script path as last path on script path stack, assigns layout variables to view, determines layout name using inflector, and renders layout view script.
$name will be passed to the inflector as the key 'script'.
resetMvcInstance(
)
:
void
Reset MVC instance
Unregisters plugins and helpers, and destroys MVC layout instance.
setConfig(
Zend_Config $config
)
:
Zend_Layout
Set options from a config object
setContentKey(
string $contentKey
)
:
Zend_Layout
Set content key
Key in namespace container denoting default content
setHelperClass(
string $helperClass
)
:
Zend_Layout
Set helper class
setInflector(
Zend_Filter_Inflector $inflector
)
:
Zend_Layout
Set inflector to use when resolving layout names
setInflectorTarget(
string $inflectorTarget
)
:
Zend_Layout
Set inflector target
setLayout(
string $name, boolean $enabled
=
true
)
:
Zend_Layout
Set layout script to use
Note: enables layout by default, can be disabled
setLayoutPath(
string $path
)
:
Zend_Layout
Set layout script path
setMvcSuccessfulActionOnly(
bool $successfulActionOnly
)
:
Zend_Layout
Set MVC Successful Action Only flag
setOptions(
array|Zend_Config $options
)
:
void
Set options en masse
setPluginClass(
string $pluginClass
)
:
Zend_Layout
Set plugin class
setView(
Zend_View_Interface $view
)
:
Zend_Layout
Set view object
setViewBasePath(
$path, $prefix
=
Layout_View
)
:
setViewScriptPath(
$path
)
:
setViewSuffix(
string $viewSuffix
)
:
Zend_Layout
Set layout view script suffix
startMvc(
string|array|Zend_Config $options
=
null
)
:
Zend_Layout
Static method for initialization with MVC support