Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.13

Request #2997 Request: Flexy - custom tag handler
Submitted: 2004-12-20 20:18 UTC
From: pure Assigned: alan_k
Status: Assigned Package: HTML_Template_Flexy
PHP Version: 5.0.2 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2004-12-20 20:18 UTC] pure
Description: ------------ It would be nice if it would be possible to add custom tag handlers to flexy (<media:include_image id="321">). this is actualy no problem, but HTML_Template_Flexy_Compiler_Flexy_Tag::factory() that gets called by the Flexy Compiler does a lookup if the tag handler exists in the pear directory of flexy. i tend to put my extensions to pear classes somewhere else in the include_path so they dont get overwriten or lost due upgrades. replacing these lines in HTML/Template/Flexy/Compiler/Flexy/Tag.php (Line 70) if (!file_exists(dirname(__FILE__) . '/'. ucfirst(strtolower($type)) . '.php')) { $type = 'Tag'; } with something like: $filename = 'HTML/Template/Flexy/Compiler/Flexy/' . ucfirst(strtolower($type)) . '.php'; if (!@fopen($filename, "r", true)) { $type = 'Tag'; } fixes the problem. fopen uses the include path to check if the files exists. its possible to create the directory structure 'HTML/Template/Flexy/Compiler/Flexy/' somewhere else in the include path, and put custom tag handlers there. Reproduce code: --------------- - Expected result: ---------------- - Actual result: -------------- -

Comments

 [2004-12-21 01:57 UTC] alan_k
Good point - I guess since it's compiling stage - we can mess around with fopen().