SV: [SMARTY] bug in block_function handling?
| From: | Paolo Nesti Poggi | Date: | Fri, 22 Oct 2004 20:59:25 +0000 |
| Subject: | SV: [SMARTY] bug in block_function handling? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11919@lists.php.net to get a copy of this message | ||
> -----Oprindelig meddelelse-----
> Fra: boots [mailto:jayboots@yahoo.com]
> Sendt: 22. oktober 2004 18:03
> --- Paolo Nesti Poggi <pnp@italyflash.com> wrote:
> > > > Besides, how can smarty know the path of the plugin if it
> > > > doesn't exists at all in smarty yet. I'm registering it the first
> > > > time I include it.
> > > > Or do my plugin have to reside in a particular directory for
> > > > smarty to find it?
>
> Sure, unless you want to manually load and register them yourself. It
> is not uncommon to keep custom plugins in their own directory. You can
> tell Smarty about that directory by using an array of directories for
> the plugins property. eg: $smarty->plugins_dir =
> array('/path/to/custom/plugins', '/path/to/smarty/plugins') and Smarty
> will then search those paths in order whenever it is asked to load a
> plugin. Actually, I just looked at your original message and you seem
> to be aware of that already.
You won't believe it but that's it, that was my problem. I had to put it in
a directory registered as plugin dir.
And I had intentionally avoided that, how come?
The fact is that the differences between autoloaded plugins and registered
plugins were not so clear to me, as you may have seen ;).
I knew I had to avoid making an autoloaded plugin because it is always
cached (I started out with such a plugin) so, among the other things I
tryed, I moved it outside of a plugin_dir ...
instead I should have simply kept it there, _added a call to
include_once('path/to/plugin')_
to avoid: "[plugin] block 'nc' is not implemented" , and registered it.
Thank you for giving it one more try.
Paolo