Can I create a function inside a controller dinamically from a model?

#1
[eluser]chefnelone[/eluser]
hello,

Can I create a function inside a controller dinamically from a model? Is this possible??

let's say I have this controller with just the function first():

index_controller.php
Code:
class Index extends MY_Controller {
   function first(){
      //do something
   }

}

What I need is create another function inside the Index class, let's say: second() without open the file and writting it but from a index_model.php

index_model.php
Code:
class Index extends MY_Model {
   function create_functions(){
      //CREATE second() FUNCTION INSIDE index_controller.php
   }

}

index_controller.php
Code:
class Index extends MY_Controller {
   function first(){
      //DO SOMETHING
   }
   function second(){
      //THIS WAS CREATED FROM THE MODEL
   }

}


Messages In This Thread
Can I create a function inside a controller dinamically from a model? - by El Forum - 09-02-2010, 01:40 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.