Re: [SMARTY] Working with resource plugins
| From: | M Mohr | Date: | Fri, 01 Nov 2002 13:31:32 +0000 |
| Subject: | Re: [SMARTY] Working with resource plugins | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6302@lists.php.net to get a copy of this message | ||
sorry, forgot to cc to the list.
----- Forwarded message from M Mohr <messju@lammfellpuschen.de> -----
Hello,
On Fri, Nov 01, 2002 at 01:13:46PM +0100, Dorthe Luebbert wrote:
> Hi,
>
> I want to register a resource plugin. I put the example from
>
>
> http://www.phpinsider.com/php/code/Smarty/docs/plugins.resources.html
>
> in ..plugins/resource.db.php
>
> Then I copied
> http://www.phpinsider.com/php/code/Smarty/docs/api.register.resource.html®Æ
> Ùm5nÈd×
ÉÖf
> in my application.
>
> I get:
> Fatal error: Smarty plugin error: resource 'db' is not implemented in
> /vol/www/mydomain/htdocs/3rd/smarty/Smarty.class.php on line 1982
>
> I changed register_resource to:
> $smarty->register_resource("db", array("db_source",
> "db_timestamp",
> "db_secure",
> "db_trusted"));
>
> .. and some other function-names. It does not work. What's wrong?
you don't have to register a resource explicitly. if the directory
where resource.[name].php resides is in one of your plugins_dirs it is
registered automaticly when smarty encounters a
[name]:/path_to_resource filename.
just like functions: if function.[name].php can be found in a
plugins_dir it does not have to be registered explicitly.
if you register the resource explicitly, you have to pass the full
function-names (smarty_resource_db_get_template instead of
db_get_template) AFAIK. the docs are bit misleading here, i think.
HTH
messju
> Thanx
>
> Dorthe