Re: Re: Flexy feedback
| From: | Alan Knowles | Date: | Tue, 16 Dec 2003 09:10:16 +0000 |
| Subject: | Re: Re: Flexy feedback | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9549@lists.php.net to get a copy of this message | ||
Commited,
Regards
Alan
Demian Turner wrote:
hi alan
i've attached a very small patch for flexy you may want to consider, basically i've just added an array_unique to the array of posible template paths to be checked, Flexy.php:384
hopefully the logic i've followed that's brought about the need for this patch is typical enough so it can be included in the main code.
basically i have a codebase with a number of modules, and each module has it's own templates dir for ease of installation. but all templates require default templates, header/footer, etc, that are found in the 'default' module which is passed in as a second search path.
however the default module has non-global templates, like a home page, etc, so when compiling templates for this module flexy errored out because the same search path appeared twice, something the array_unique() fixes.
let me know what you think
cheers
demian
------------------------------------------------------------------------
? flexy.diff
Index: Flexy.php
===================================================================
RCS file: /repository/pear/HTML_Template_Flexy/Flexy.php,v
retrieving revision 1.52
diff -u -r1.52 Flexy.php
--- Flexy.php 10 Dec 2003 13:21:02 -0000 1.52
+++ Flexy.php 11 Dec 2003 10:10:08 -0000
@@ -381,7 +381,7 @@
if (is_array($this->options['templateDir'])) {
- foreach ($this->options['templateDir'] as $tmplDir) {
+ foreach (array_unique($this->options['templateDir']) as $tmplDir) {
if (!@file_exists($tmplDir . DIRECTORY_SEPARATOR . $file)) {
continue;
}
--
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com