* @author Kornel LesiĆski
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License * @version SVN: $Id: FillSlot.php 605 2009-05-03 02:50:26Z kornel $ * @link http://phptal.org/ */ /** * METAL Specification 1.0 * * argument ::= Name * * Example: * * * * *
Links
*
Good Place
*
Bad Place
*
Other Place
*
* * PHPTAL: * * 1. evaluate slots * * * *
Good Place
*
Bad Place
*
Other Place
* * slots->links = ob_get_contents(); ob_end_clean(); ? > * * 2. call the macro (here not supported) * * * * * @package PHPTAL * @subpackage Php.attribute.metal * @author Laurent Bedubourg
*/ class PHPTAL_Php_Attribute_METAL_FillSlot extends PHPTAL_Php_Attribute { public function before(PHPTAL_Php_CodeWriter $codewriter) { $codewriter->pushCode('ob_start()'); } public function after(PHPTAL_Php_CodeWriter $codewriter) { $code = '$ctx->fillSlot("'.$this->expression.'", ob_get_clean())'; $codewriter->pushCode($code); } }