Hi All,
Basically i am a Ruby on rails developer, but now i am working with CI, now i want to before_filter to authorize the login to all controller, i got some idea through the Filter system (http://codeigniter.com/wiki/Filters_system/), i downloaded this file and i replaced it where its require, but i don’t know how to start and how to define in the controller.
because there is no clear example for this. for example in ruby on rails i have done the code like this in
application controller
def authorize
unless session[:user]
flash[:notice]=“Please log in”
redirect_to(:controller => “login” , :action => “index”)
end
end
in
login controller
i write the code like this,
before_filter :authorize, :except =>[:index]
so, can i anyone tell, how to use the before_filter in php with example. thanks in advance.