Class Zend_Layout

Description

Provide Layout support for MVC applications

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Layout.php (line 30)


	
			
Variable Summary
Method Summary
 static Zend_Layout|null getMvcInstance ()
 static void resetMvcInstance ()
 static Zend_Layout startMvc ([string|array|Zend_Config $options = null])
 void __construct ([string|array|Zend_Config $options = null], [ $initMvc = false])
 Zend_Layout assign (mixed $spec, [mixed $value = null])
 string getContentKey ()
 string getHelperClass ()
 string getInflectorTarget ()
 string getLayout ()
 string getLayoutPath ()
 bool getMvcEnabled ()
 string getPluginClass ()
 void getViewBasePath ()
 string getViewSuffix ()
 bool isEnabled ()
 mixed render ([mixed $name = null])
 Zend_Layout setConfig ( $config)
 Zend_Layout setContentKey (string $contentKey)
 Zend_Layout setHelperClass (string $helperClass)
 Zend_Layout setInflector ( $inflector)
 Zend_Layout setInflectorTarget (string $inflectorTarget)
 Zend_Layout setLayout (string $name, [boolean $enabled = true])
 Zend_Layout setLayoutPath (string $path)
 Zend_Layout setMvcSuccessfulActionOnly (bool $successfulActionOnly)
 void setOptions (array|Zend_Config $options)
 Zend_Layout setPluginClass (string $pluginClass)
 Zend_Layout setView ( $view)
 void setViewBasePath ( $path, [ $prefix = 'Layout_View'])
 void setViewScriptPath ( $path)
 Zend_Layout setViewSuffix (string $viewSuffix)
 void _initHelper ()
 void _initMvc ()
 void _initPlugin ()
 Zend_Layout _setMvcEnabled (bool $mvcEnabled)
 mixed __get (string $key)
 bool __isset (string $key)
 void __set (string $key, mixed $value)
 void __unset (string $key)
Variables
static Zend_Layout $_mvcInstance (line 99)

Instance registered with MVC, if any

  • access: protected

Placeholder container for layout variables

  • access: protected
string $_contentKey = 'content' (line 42)

Key used to store content from 'default' named response segment

  • access: protected
bool $_enabled = true (line 48)

Are layouts enabled?

  • access: protected
string $_helperClass = 'Zend_Layout_Controller_Action_Helper_Layout' (line 54)

Helper class

  • access: protected
Zend_Filter_Inflector $_inflector (line 60)

Inflector used to resolve layout script

  • access: protected
bool $_inflectorEnabled = true (line 66)

Flag: is inflector enabled?

  • access: protected
string $_inflectorTarget = ':script.:suffix' (line 72)

Inflector target

  • access: protected
string $_layout = 'layout' (line 78)

Layout view

  • access: protected
bool $_mvcEnabled = true (line 93)

Flag: is MVC integration enabled?

  • access: protected
bool $_mvcSuccessfulActionOnly = true (line 105)

Flag: is MVC successful action only flag set?

  • access: protected
string $_pluginClass = 'Zend_Layout_Controller_Plugin_Layout' (line 111)

Plugin class

  • access: protected
Zend_View_Interface $_view (line 116)
  • access: protected
mixed $_viewBasePath = null (line 86)
  • access: protected
mixed $_viewBasePrefix = 'Layout_View' (line 87)
  • access: protected
string $_viewScriptPath = null (line 84)

Layout view script path

  • access: protected
string $_viewSuffix = 'phtml' (line 122)

View script suffix for layout script

  • access: protected
Methods
static getMvcInstance (line 193)

Retrieve MVC instance of Zend_Layout object

  • access: public
static Zend_Layout|null getMvcInstance ()
static resetMvcInstance (line 205)

Reset MVC instance

Unregisters plugins and helpers, and destroys MVC layout instance.

  • access: public
static void resetMvcInstance ()
static startMvc (line 173)

Static method for initialization with MVC support

  • access: public
static Zend_Layout startMvc ([string|array|Zend_Config $options = null])
Constructor __construct (line 142)

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.

  • access: public
void __construct ([string|array|Zend_Config $options = null], [ $initMvc = false])
assign (line 743)

Assign one or more layout variables

  • throws: Zend_Layout_Exception if non-array/string value passed to $spec
  • access: public
Zend_Layout assign (mixed $spec, [mixed $value = null])
  • mixed $spec: Assoc array or string key; if assoc array, sets each key as a layout variable
  • mixed $value: Value if $spec is a key
disableInflector (line 667)

Disable inflector

  • access: public
Zend_Layout disableInflector ()
disableLayout (line 359)

Disable layout

  • access: public
Zend_Layout disableLayout ()
enableInflector (line 656)

Enable inflector

  • access: public
Zend_Layout enableInflector ()
enableLayout (line 370)

Enable layout

  • access: public
Zend_Layout enableLayout ()
getContentKey (line 450)

Retrieve content key

  • access: public
string getContentKey ()
getHelperClass (line 516)

Retrieve helper class

  • access: public
string getHelperClass ()
getInflector (line 637)

Retrieve inflector

  • access: public
Zend_Filter_Inflector getInflector ()
getInflectorTarget (line 603)

Retrieve inflector target

  • access: public
string getInflectorTarget ()
getLayout (line 349)

Get current layout script

  • access: public
string getLayout ()
getLayoutPath (line 426)

Get current layout script path

  • access: public
string getLayoutPath ()
getMvcEnabled (line 472)

Retrieve MVC enabled flag

  • access: public
bool getMvcEnabled ()
getMvcSuccessfulActionOnly (line 494)

Get MVC Successful Action Only Flag

  • access: public
bool getMvcSuccessfulActionOnly ()
getPluginClass (line 538)

Retrieve plugin class

  • access: public
string getPluginClass ()
getView (line 563)

Get current view object

If no view object currently set, retrieves it from the ViewRenderer.

  • todo: Set inflector from view renderer at same time
  • access: public
Zend_View_Interface getView ()
getViewBasePath (line 394)
  • access: public
void getViewBasePath ()
getViewScriptPath (line 405)
  • access: public
void getViewScriptPath ()
getViewSuffix (line 593)

Retrieve layout view script suffix

  • access: public
string getViewSuffix ()
inflectorEnabled (line 678)

Return status of inflector enabled flag

  • access: public
bool inflectorEnabled ()
isEnabled (line 381)

Is layout enabled?

  • access: public
bool isEnabled ()
render (line 773)

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'.

  • access: public
mixed render ([mixed $name = null])
  • mixed $name
setConfig (line 305)

Set options from a config object

  • access: public
Zend_Layout setConfig ( $config)
setContentKey (line 439)

Set content key

Key in namespace container denoting default content

  • access: public
Zend_Layout setContentKey (string $contentKey)
  • string $contentKey
setHelperClass (line 527)

Set helper class

  • access: public
Zend_Layout setHelperClass (string $helperClass)
  • string $helperClass
setInflector (line 626)

Set inflector to use when resolving layout names

  • access: public
Zend_Layout setInflector ( $inflector)
setInflectorTarget (line 614)

Set inflector target

  • access: public
Zend_Layout setInflectorTarget (string $inflectorTarget)
  • string $inflectorTarget
setLayout (line 335)

Set layout script to use

Note: enables layout by default, can be disabled

  • access: public
Zend_Layout setLayout (string $name, [boolean $enabled = true])
  • string $name
  • boolean $enabled
setLayoutPath (line 416)

Set layout script path

  • access: public
Zend_Layout setLayoutPath (string $path)
  • string $path
setMvcSuccessfulActionOnly (line 483)

Set MVC Successful Action Only flag

  • access: public
Zend_Layout setMvcSuccessfulActionOnly (bool $successfulActionOnly)
  • bool $successfulActionOnly
setOptions (line 230)

Set options en masse

  • access: public
void setOptions (array|Zend_Config $options)
setPluginClass (line 549)

Set plugin class

  • access: public
Zend_Layout setPluginClass (string $pluginClass)
  • string $pluginClass
setView (line 505)

Set view object

  • access: public
Zend_Layout setView ( $view)
setViewBasePath (line 387)
  • access: public
void setViewBasePath ( $path, [ $prefix = 'Layout_View'])
  • $path
  • $prefix
setViewScriptPath (line 399)
  • access: public
void setViewScriptPath ( $path)
  • $path
setViewSuffix (line 582)

Set layout view script suffix

  • access: public
Zend_Layout setViewSuffix (string $viewSuffix)
  • string $viewSuffix
_initHelper (line 286)

Initialize action helper

  • access: protected
void _initHelper ()
_initMvc (line 252)

Initialize MVC integration

  • access: protected
void _initMvc ()
_initPlugin (line 263)

Initialize front controller plugin

  • access: protected
void _initPlugin ()
_initVarContainer (line 316)

Initialize placeholder container for layout vars

  • access: protected
_setMvcEnabled (line 461)

Set MVC enabled flag

  • access: protected
Zend_Layout _setMvcEnabled (bool $mvcEnabled)
  • bool $mvcEnabled
__get (line 701)

Get layout variable

  • access: public
mixed __get (string $key)
  • string $key
__isset (line 716)

Is a layout variable set?

  • access: public
bool __isset (string $key)
  • string $key
__set (line 690)

Set layout variable

  • access: public
void __set (string $key, mixed $value)
  • string $key
  • mixed $value
__unset (line 727)

Unset a layout variable?

  • access: public
void __unset (string $key)
  • string $key

Documentation generated on Mon, 21 Jun 2010 15:30:36 -0400 by phpDocumentor 1.4.3