Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

pass $params to resource handler functions

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sun Jun 01, 2003 8:39 am    Post subject: pass $params to resource handler functions Reply with quote

The request is to extend the Resource API so that the parameters passed in the {include} are sent to the resource handler.

{include file="foo:template" var=$bar}

Here, resource handler foo is able to refine its results based on the passed var.

AFAIK, this type of information is not already available in the passed $smarty instance that the resource functions receive. This means that resources have to rely on values already set in the local environment and/or the received $smarty instance to take alternative paths.

Receiving parameters is equivalent to exposing an interface, eg: it would be possible to build a resource with an internal authorization model independant of the calling application.

Further, if a reference to $params is passed in, the resource could also be used to validate, modify, add and restrict parameters that are passed to the template.

To not break BC I propose $params added as a final parameter to each resource function, even though I think that looks bad.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP