How did I solve the problem? (I'm working with ZF)

/**
 * PHPTAL context modifier (helper:)
 *
 * @param string $src
 * @param boolean $nothrow
 * @return string
 */
function phptal_tales_helper($src, $nothrow) {
  $src = 'helper->'.trim($src);
  return PHPTAL_Php_Transformer::transform($src, '$ctx->');
}

$view->addHelperPath($moduleDir.'/views/helpers', $moduleName.'_View_Helper');

And now I can use inside my templates:
<a tal:attributes="href helper:url(array(), 'xxx')">xxx</a>

or

<div tal:condition="helper:acl('Member')" tal:content="structure 
helper:action('xx', 'xx')"></div>


_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to