Re: [SMARTY-GENERAL] feature requests..
| From: | Andrei Zmievski | Date: | Tue, 09 Apr 2002 19:35:33 +0000 |
| Subject: | Re: [SMARTY-GENERAL] feature requests.. | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3580@lists.php.net to get a copy of this message | ||
On Thu, 04 Apr 2002, mark priatel wrote:
> Hi guys,
>
> First I just wanted to say that I'm really impressed with Smarty. Coming
> from an enterprise Java background I was frustrated with the lack of
> templating APIs that existed for PHP. While there are plenty of out of
> the box 'tools' that existed, few were intended to be frameworks that
> people could extend; Smarty is an excellent example of an extensible
> PHP application with it's pluggable functions, modifiers, etc.
Can I use the above paragraph for TESTIMONIALS file?
> I'd love to see a few small features added:
>
> - ability to call object methods, no-args methods would be fine eg:
> {$obj->render()}.
This has been asked for in the past, and I guess our philosophy is that
invoking object methods is not really in the scope of Smarty. What kind
of things do you want to use this functionality for? One approach may be
to use the ext/overload extension that provides mapping from property
accesses to method invocations so that when you read $obj->myprop it
will call $obj->__get_myprop() function (or $obj->__get() if
__get_myprop() is not specified).
> - smarty method to access config variables, (or is this visible through
> get_template_vars() ?
Currently, there is no Smarty API to do this, and even if there was, you
would only be able to access config variables after display() or fetch()
method is called. Instead, you can use ConfigReader class that is
included with Smarty to read the config variables directly. Let me know
if you have questions about its API.
> - option to allow config file variables to be loaded in as smarty
> variables; I'm not sure if this is a bug or if I'm misusing smarty
> somehow, but my app loses track of config variables (even when loaded as
> global) after a certiain point: my app calls $smarty->display() inside
> of a $smarty->display() function, which is when config variables appear
> to be lost. Smarty variables, however, remain available.
You shouldn't really do that. Why are you calling display() inside
display()? Can you create another instance of Smarty to handle the inner
display()?
-Andrei
Magic 8-ball is much more powerful than we thought. I mean, back in the 70's
it was predicting the nature of software in the 90's -- "Outlook not so good".