For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > October 2004 > SV: [SMARTY] bug in block_function handling?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SV: [SMARTY] bug in block_function handling?
Paolo Nesti Poggi

2004-10-22, 8:57 pm

> -----Oprindelig meddelelse-----
> Fra: boots [mailto:jayboots@yahoo.com]
> Sendt: 22. oktober 2004 18:03
> --- Paolo Nesti Poggi <pnp@italyflash.com> wrote:
>
> 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
Boots

2004-10-22, 8:57 pm

--- Paolo Nesti Poggi <pnp@italyflash.com> wrote:
> 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.


It almost sounds like you weren't manually including the plugin during
a cache hit but rather were only registering it. Perhaps that is why
Smarty was trying to load it from one of its known plugin dirs. In
theory, you can prevent Smarty from ever searching the plugin dirs if
you manually load and register your them. Anyways, I'm glad to hear
that you got it solved.

Greetings,
xo boots

> Thank you for giving it one more try.
> Paolo

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com