As you know, in codeigniter a function name in a class becomes url like :
class Example extends CI_Controller {
function sayHello() {
echo "Hello";
}
}
To display the content of function simply you can show it by using:
www.mydomain.com/example/sayhello
My question is, instead of writing all my function names one by one, how can i form these functions using a loop or by fetching function names from database? For example, i have 100 function name in my database. is it possible to do it writing clear and short code or should i write all functions manually? Thanks…
This has nothing to do with creating functions. Your problem is routing. Solve that:
More info: http://codeigniter.com/user_guide/general/controllers.html#remapping