| [ Index ] |
PHP Cross Reference of Akelos Framework |
[Source view] [Print]
(no description)
| Author: | Bermi Ferrer |
| Copyright: | Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org |
| License: | GNU Lesser General Public License |
| File Size: | 121 lines (4 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
CaptureHelper:: (4 methods):
begin()
end()
_addVarToView()
content_for()
Class: CaptureHelper - X-Ref
Capture lets you extract parts of code into instance variables which| begin($var_name = '') X-Ref |
| Capture allows you to extract a part of the template into an instance variable. You can use this instance variable anywhere in your templates and even in your layout. Example: <?php $capture_helper->begin(); ?> Welcome To my shiny new web page! <% $greeting = $capture_helper->end(); ?> |
| end($add_to_view = true) X-Ref |
| No description |
| _addVarToView($var_name, $content) X-Ref |
| No description |
| content_for($name) X-Ref |
| Content_for will store the given block in an instance variable for later use in another template or in the layout. The name of the instance variable is content_for_<name> to stay consistent with $content_for_layout which is used by ActionView's layouts Example: <?php $capture_helper->content_for('header'); ?> alert('hello world'); <?php $capture_helper->end(); ?> You can use $content_for_header anywhere in your templates. NOTE: Beware that content_for is ignored in caches. So you shouldn't use it for elements that are going to be fragment cached. |
| Generated: Mon Oct 27 12:43:49 2008 | Cross-referenced by PHPXref 0.6 |