Welcome Guest, Not a member yet? Register   Sign In
Once the model is loaded by the controller all model methods are exposed to view
#1

(This post was last modified: 12-08-2018, 05:13 PM by Balenus.)

If in Controller I do this:

Code:
$this->load->model('mymodel');
//...do some stuff with mymodel...

//calling the view
$vars['somedata'] = 'mydata';
$this->load->view('someview', $vars);


Inside the View someview.php you can do this
Code:
$this->mymodel->someMethod();

Isn't this a security threat? Huh

The View should only be able:
  • to see the data passed by the Controller
  • and to load others Views
but the View should NOT be allowed to call directly methods of any model.
Reply


Messages In This Thread
Once the model is loaded by the controller all model methods are exposed to view - by Balenus - 12-08-2018, 05:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB