Re: flexy global functions
| From: | Alan Knowles | Date: | Tue, 27 Apr 2004 05:31:45 +0000 |
| Subject: | Re: flexy global functions | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12150@lists.php.net to get a copy of this message | ||
Demian Turner wrote:
Hi Alan/all just testing out your new global functions (0.8.1), i've used the syntax indicated in the changelog: {GLOBALS.date(mydate,#d/m/y#)} and put it in a conditional {if:GLOBALS.is_array(v)} ... do something {end:} however this does not seem to work. the 'globalfunctions' = true is set.can you file it as a bug - I need to fix it..
an a related note, it is possible to create custom functions for flexy? i know this was implemented for the old regex parser, don't think it works the current one. currently we're using the output object to add methods which can be called by flexy templates, however the issue is that say we have 50 html transform methods, we call all of them every page execution even if the current page uses only one of them. the advantage of having them in flexy (i believe) is that if the pages are compiled, the addition html methods won't get included/called, making the process considerably more streamlined.have you got a simple example, so I can get my head round the requirements.. Technically, the Tag Namespace handler is supposed to deal with this, although It's more a proof of concept.. eg. at present <flexy:toJavascript is in HTML/Template/Flexy/Compiler/Standard/Flexy.php if you start using: <seagull:dosomething .... it should call HTML/Template/Flexy/Compiler/Standard/Seagull.php or <XUL:textarea .... calls HTML/Template/Flexy/Compiler/Standard/XUL.php at present, the file path is hard coded.. it may be worth adding yet another option: 'namespaceHandlers' => array( 'XUL' => '/myproject/XUL.php' /// maps to class : myproject_XUL ) Regards Alan Regards Alan
cheers demian-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com