-
Notifications
You must be signed in to change notification settings - Fork 40
Helpers
m3nt0r edited this page Jun 25, 2012
·
1 revision
All helper objects are available inside a view and can be used like any other variable inside Twig.
{{ time.nice(user.created) }}
... where ...
{{ time.nice(user.created) }}
^ ^ ^ ^____key
| | |____array (from $this->set() or loop)
| |_____ method
|______ helper
Which is the equivalent of writing:
<?php echo $this->Time->nice($user['created']); ?>
A more complex example, FormHelper inputs:
{{
form.input('message', {
'label': 'Your message',
'error': {
'notempty': 'Please enter a message'
}
})
}}