API Documentation

Layout.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Layout
version
$Id: Layout.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Layout

Description

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.

Zend_Layout

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Layout
Properties
$_container
$_contentKey
$_enabled
$_helperClass
$_inflector
$_inflectorEnabled
$_inflectorTarget
$_layout
$_viewScriptPath
$_viewBasePath
$_viewBasePrefix
$_mvcEnabled
$_mvcInstance
$_mvcSuccessfulActionOnly
$_pluginClass
$_view
$_viewSuffix
Methods
__construct
startMvc
getMvcInstance
resetMvcInstance
setOptions
_initMvc
_initPlugin
_initHelper
setConfig
_initVarContainer
setLayout
getLayout
disableLayout
enableLayout
isEnabled
setViewBasePath
getViewBasePath
setViewScriptPath
getViewScriptPath
setLayoutPath
getLayoutPath
setContentKey
getContentKey
_setMvcEnabled
getMvcEnabled
setMvcSuccessfulActionOnly
getMvcSuccessfulActionOnly
setView
getHelperClass
setHelperClass
getPluginClass
setPluginClass
getView
setViewSuffix
getViewSuffix
getInflectorTarget
setInflectorTarget
setInflector
getInflector
enableInflector
disableInflector
inflectorEnabled
__set
__get
__isset
__unset
assign
render

Description

Provide Layout support for MVC applications

Properties

$_container

Zend_View_Helper_Placeholder_Container $_container = ''

Placeholder container for layout variables

Details

$_container
Zend_View_Helper_Placeholder_Container
visibility
protected
default
final
false
static
false

$_contentKey

string $_contentKey = 'content'

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

Details

$_contentKey
string
visibility
protected
default
content
final
false
static
false

$_enabled

bool $_enabled = 'true'

Are layouts enabled?

Details

$_enabled
bool
visibility
protected
default
true
final
false
static
false

$_helperClass

string $_helperClass = 'Zend_Layout_Controller_Action_Helper_Layout'

Helper class

Details

$_helperClass
string
visibility
protected
default
Zend_Layout_Controller_Action_Helper_Layout
final
false
static
false

$_inflector

Zend_Filter_Inflector $_inflector = ''

Inflector used to resolve layout script

Details

$_inflector
Zend_Filter_Inflector
visibility
protected
default
final
false
static
false

$_inflectorEnabled

bool $_inflectorEnabled = 'true'

Flag: is inflector enabled?

Details

$_inflectorEnabled
bool
visibility
protected
default
true
final
false
static
false

$_inflectorTarget

string $_inflectorTarget = ':script.:suffix'

Inflector target

Details

$_inflectorTarget
string
visibility
protected
default
:script.:suffix
final
false
static
false

$_layout

string $_layout = 'layout'

Layout view

Details

$_layout
string
visibility
protected
default
layout
final
false
static
false

$_mvcEnabled

bool $_mvcEnabled = 'true'

Flag: is MVC integration enabled?

Details

$_mvcEnabled
bool
visibility
protected
default
true
final
false
static
false

$_mvcInstance

Zend_Layout $_mvcInstance = ''

Instance registered with MVC, if any

Details

$_mvcInstance
Zend_Layout
visibility
protected
default
final
false
static
true

$_mvcSuccessfulActionOnly

bool $_mvcSuccessfulActionOnly = 'true'

Flag: is MVC successful action only flag set?

Details

$_mvcSuccessfulActionOnly
bool
visibility
protected
default
true
final
false
static
false

$_pluginClass

string $_pluginClass = 'Zend_Layout_Controller_Plugin_Layout'

Plugin class

Details

$_pluginClass
string
visibility
protected
default
Zend_Layout_Controller_Plugin_Layout
final
false
static
false

$_view

Zend_View_Interface $_view = ''

Details

$_view
Zend_View_Interface
visibility
protected
default
final
false
static
false

$_viewBasePath

 $_viewBasePath = 'null'

Details

visibility
protected
default
null
final
false
static
false

$_viewBasePrefix

 $_viewBasePrefix = 'Layout_View'

Details

visibility
protected
default
Layout_View
final
false
static
false

$_viewScriptPath

string $_viewScriptPath = 'null'

Layout view script path

Details

$_viewScriptPath
string
visibility
protected
default
null
final
false
static
false

$_viewSuffix

string $_viewSuffix = 'phtml'

View script suffix for layout script

Details

$_viewSuffix
string
visibility
protected
default
phtml
final
false
static
false

Methods

__construct

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

Arguments
$options
stringarrayZend_Config
$initMvc
Details
visibility
public
final
false
static
false

__get

__get( string $key ) : mixed

Get layout variable

Arguments
$key
string
Output
mixed
Details
visibility
public
final
false
static
false

__isset

__isset( string $key ) : bool

Is a layout variable set?

Arguments
$key
string
Output
bool
Details
visibility
public
final
false
static
false

__set

__set( string $key, mixed $value ) : void

Set layout variable

Arguments
$key
string
$value
mixed
Details
visibility
public
final
false
static
false

__unset

__unset( string $key ) : void

Unset a layout variable?

Arguments
$key
string
Details
visibility
public
final
false
static
false

_initHelper

_initHelper( ) : void

Initialize action helper

Details
visibility
protected
final
false
static
false

_initMvc

_initMvc( ) : void

Initialize MVC integration

Details
visibility
protected
final
false
static
false

_initPlugin

_initPlugin( ) : void

Initialize front controller plugin

Details
visibility
protected
final
false
static
false

_initVarContainer

_initVarContainer( ) : Zend_View_Helper_Placeholder_Container

Initialize placeholder container for layout vars

Details
visibility
protected
final
false
static
false

_setMvcEnabled

_setMvcEnabled( bool $mvcEnabled ) : Zend_Layout

Set MVC enabled flag

Arguments
$mvcEnabled
bool
Output
Zend_Layout
Details
visibility
protected
final
false
static
false

assign

assign( mixed $spec, mixed $value = null ) : Zend_Layout

Assign one or more layout variables

Arguments
$spec
mixed
Assoc array or string key; if assoc array, sets each key as a layout variable
$value
mixed
Value if $spec is a key
Output
Zend_Layout
Details
visibility
public
final
false
static
false
throws
if non-array/string value passed to $spec

disableInflector

disableInflector( ) : Zend_Layout

Disable inflector

Output
Zend_Layout
Details
visibility
public
final
false
static
false

disableLayout

disableLayout( ) : Zend_Layout

Disable layout

Output
Zend_Layout
Details
visibility
public
final
false
static
false

enableInflector

enableInflector( ) : Zend_Layout

Enable inflector

Output
Zend_Layout
Details
visibility
public
final
false
static
false

enableLayout

enableLayout( ) : Zend_Layout

Enable layout

Output
Zend_Layout
Details
visibility
public
final
false
static
false

getContentKey

getContentKey( ) : string

Retrieve content key

Output
string
Details
visibility
public
final
false
static
false

getHelperClass

getHelperClass( ) : string

Retrieve helper class

Output
string
Details
visibility
public
final
false
static
false

getInflector

getInflector( ) : Zend_Filter_Inflector

Retrieve inflector

Details
visibility
public
final
false
static
false

getInflectorTarget

getInflectorTarget( ) : string

Retrieve inflector target

Output
string
Details
visibility
public
final
false
static
false

getLayout

getLayout( ) : string

Get current layout script

Output
string
Details
visibility
public
final
false
static
false

getLayoutPath

getLayoutPath( ) : string

Get current layout script path

Output
string
Details
visibility
public
final
false
static
false

getMvcEnabled

getMvcEnabled( ) : bool

Retrieve MVC enabled flag

Output
bool
Details
visibility
public
final
false
static
false

getMvcInstance

getMvcInstance( ) : Zend_Layout|null

Retrieve MVC instance of Zend_Layout object

Output
Zend_Layout|null
Details
visibility
public
final
false
static
true

getMvcSuccessfulActionOnly

getMvcSuccessfulActionOnly( ) : bool

Get MVC Successful Action Only Flag

Output
bool
Details
visibility
public
final
false
static
false

getPluginClass

getPluginClass( ) : string

Retrieve plugin class

Output
string
Details
visibility
public
final
false
static
false

getView

getView( ) : Zend_View_Interface

Get current view object

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

Details
visibility
public
final
false
static
false
todo
Set inflector from view renderer at same time

getViewBasePath

getViewBasePath( ) :
Details
visibility
public
final
false
static
false

getViewScriptPath

getViewScriptPath( ) :
Details
visibility
public
final
false
static
false

getViewSuffix

getViewSuffix( ) : string

Retrieve layout view script suffix

Output
string
Details
visibility
public
final
false
static
false

inflectorEnabled

inflectorEnabled( ) : bool

Return status of inflector enabled flag

Output
bool
Details
visibility
public
final
false
static
false

isEnabled

isEnabled( ) : bool

Is layout enabled?

Output
bool
Details
visibility
public
final
false
static
false

render

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

Arguments
$name
mixed
Output
mixed
Details
visibility
public
final
false
static
false

resetMvcInstance

resetMvcInstance( ) : void

Reset MVC instance

Unregisters plugins and helpers, and destroys MVC layout instance.

Details
visibility
public
final
false
static
true

setConfig

setConfig( Zend_Config $config ) : Zend_Layout

Set options from a config object

Arguments
$config
Zend_Config
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setContentKey

setContentKey( string $contentKey ) : Zend_Layout

Set content key

Key in namespace container denoting default content

Arguments
$contentKey
string
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setHelperClass

setHelperClass( string $helperClass ) : Zend_Layout

Set helper class

Arguments
$helperClass
string
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setInflector

setInflector( Zend_Filter_Inflector $inflector ) : Zend_Layout

Set inflector to use when resolving layout names

Arguments
$inflector
Zend_Filter_Inflector
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setInflectorTarget

setInflectorTarget( string $inflectorTarget ) : Zend_Layout

Set inflector target

Arguments
$inflectorTarget
string
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setLayout

setLayout( string $name, boolean $enabled = true ) : Zend_Layout

Set layout script to use

Note: enables layout by default, can be disabled

Arguments
$name
string
$enabled
boolean
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setLayoutPath

setLayoutPath( string $path ) : Zend_Layout

Set layout script path

Arguments
$path
string
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setMvcSuccessfulActionOnly

setMvcSuccessfulActionOnly( bool $successfulActionOnly ) : Zend_Layout

Set MVC Successful Action Only flag

Arguments
$successfulActionOnly
bool
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setOptions

setOptions( array|Zend_Config $options ) : void

Set options en masse

Arguments
$options
arrayZend_Config
Details
visibility
public
final
false
static
false

setPluginClass

setPluginClass( string $pluginClass ) : Zend_Layout

Set plugin class

Arguments
$pluginClass
string
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setView

setView( Zend_View_Interface $view ) : Zend_Layout

Set view object

Arguments
$view
Zend_View_Interface
Output
Zend_Layout
Details
visibility
public
final
false
static
false

setViewBasePath

setViewBasePath(  $path,  $prefix = Layout_View ) :
Arguments
$path
$prefix
Details
visibility
public
final
false
static
false

setViewScriptPath

setViewScriptPath(  $path ) :
Arguments
$path
Details
visibility
public
final
false
static
false

setViewSuffix

setViewSuffix( string $viewSuffix ) : Zend_Layout

Set layout view script suffix

Arguments
$viewSuffix
string
Output
Zend_Layout
Details
visibility
public
final
false
static
false

startMvc

startMvc( string|array|Zend_Config $options = null ) : Zend_Layout

Static method for initialization with MVC support

Arguments
$options
stringarrayZend_Config
Output
Zend_Layout
Details
visibility
public
final
false
static
true
Documentation was generated by DocBlox.