cakephp-1.3 > View :: element()
View
A
AclBase
AclBehavior
AclComponent
AclNode
AclShell
Aco
AcoAction
AjaxHelper
ApcEngine
ApiShell
App
AppController
AppController
AppHelper
AppHelper
AppModel
AppModel
Aro
AuthComponent
B
BakeShell
BakeTask
BehaviorCollection
C
Cache
CacheEngine
CacheHelper
CakeErrorController
CakeLog
CakeRoute
CakeSchema
CakeSession
CakeSocket
ClassRegistry
Component
Configure
ConnectionManager
ConsoleShell
ContainableBehavior
Controller
ControllerTask
CookieComponent
D
DataSource
DbAcl
DbAclSchema
DbConfigTask
DboMssql
DboMysql
DboMysqlBase
DboMysqli
DboOracle
DboPostgres
DboSource
DboSqlite
Debugger
Dispatcher
E
EmailComponent
ErrorHandler
ErrorHandler
ExtractTask
F
File
FileEngine
FileLog
FixtureTask
Folder
FormHelper
H
Helper
HtmlHelper
HttpSocket
I
I18n
I18nModel
i18nSchema
I18nShell
Inflector
IniAcl
J
JavascriptHelper
JqueryEngineHelper
JsBaseEngineHelper
JsHelper
L
L10n
M
MagicDb
MagicFileResource
MediaView
MemcacheEngine
Model
ModelBehavior
ModelTask
MootoolsEngineHelper
Multibyte
N
NumberHelper
O
Object
Overloadable
Overloadable
Overloadable2
Overloadable2
P
PagesController
PagesController
PaginatorHelper
Permission
PluginShortRoute
PluginTask
ProjectTask
PrototypeEngineHelper
R
RequestHandlerComponent
Router
RssHelper
S
Sanitize
Scaffold
ScaffoldView
SchemaShell
Security
SecurityComponent
SessionComponent
SessionHelper
SessionsSchema
Set
Shell
ShellDispatcher
String
T
TemplateTask
TestSuiteShell
TestTask
TextHelper
ThemeView
TimeHelper
TranslateBehavior
TreeBehavior
V
Validation
View
ViewTask
X
XcacheEngine
Xml
XmlElement
XmlHelper
XmlManager
XmlNode
XmlTextNode
element
line:343 at
/cake/libs/view/view.php
Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
Method
(string)
element
($name, $params = array(), $loadHelpers = false)
Parameters
Parameter | Type | Comment | Default |
---|---|---|---|
$name | string | required Name of template file in the/app/views/elements/ folder | |
$params | array | optional Array of data to be made available to the for rendered view (i.e. the Element) | array() |
$loadHelpers | ? | optional | false |
Return
stringComment
Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
This realizes the concept of Elements, (or "partial layouts")
and the $params array is used to send data to be used in the
Element. Elements can be cached through use of the cache key.
### Special params
- `cache` - enable caching for this element accepts boolean or strtotime compatible string.
Can also be an array. If `cache` is an array,
`time` is used to specify duration of cache.
`key` can be used to create unique cache files.
- `plugin` - Load an element from a specific plugin.
@param string $name Name of template file in the/app/views/elements/ folder
@param array $params Array of data to be made available to the for rendered
view (i.e. the Element)
@return string Rendered Element
@access public
This realizes the concept of Elements, (or "partial layouts")
and the $params array is used to send data to be used in the
Element. Elements can be cached through use of the cache key.
### Special params
- `cache` - enable caching for this element accepts boolean or strtotime compatible string.
Can also be an array. If `cache` is an array,
`time` is used to specify duration of cache.
`key` can be used to create unique cache files.
- `plugin` - Load an element from a specific plugin.
@param string $name Name of template file in the/app/views/elements/ folder
@param array $params Array of data to be made available to the for rendered
view (i.e. the Element)
@return string Rendered Element
@access public