Codeigniter + smarty problem with pass variable template to model |
I explain my problem.
My model: PHP Code: public function info_site($name) { My controller: PHP Code: public function information() { view: Code: {$info.site_name} I would like the 'site_name' of view was the variable 'name' of the controller and the model. In this way the result of the variable in the template should be the value of the name. Small example: In my view I write Code: {$info.site_name} site_name is passed to the controller and in turn the model In this way the sql would PHP Code: public function info_site(site_name) { and as a result it should give me the value of the consideration that will be printed. There is a solution to this my problem?
It's a little difficult to figure out what problem you're trying to solve, but the controller code you've included does not pass the string to your model.
What I need is to write in the template function with the variable to print the value of the consideration.
EDIT: the controller is a MY_Controller In this way the function is always available
I fix the problem in this way:
MY_Controller.php PHP Code: class MY_Controller extends CI_Controller { Model: PHP Code: public function info_site($name) { helper: PHP Code: function Info($name) { PHP Code: {info(name)} |
Welcome Guest, Not a member yet? Register Sign In |