09-02-2010, 01:40 AM
[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
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
index_controller.php
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
}
}