PHP on T R A X
Rapid Application Development Made Easy

Reply to topic
If you want to handle invalid actions
grabmail


Joined: 10 Sep 2006
Posts: 153
Reply with quote
Current actioncontroller will show the index action if the action is invalid.

if you wish to handle the action explicitly, like load a Page Not Found view, do this.

Add the following lines before "} elseif(method_exists($this->controller_object, "index")) {"

Code:
 } elseif(method_exists($this->controller_object, "no_route") and $this->action != '') {
                        //error_log('calling action routine '
                        //          . get_class($this->controller_object)
                        //          .'::index() with params '
                        //          .var_export($this->action_params,true));
                        $action = "no_route";
                        $this->controller_object->no_route($this->action_params);
} elseif.....


So it's like

} elseif(method_exists($this->controller_object, "no_route")) {
............
} elseif(method_exists($this->controller_object, "index")) {
.......
}

Now, you can do whatever you want by creating a no_route action in your controller.
View user's profileSend private message
If you want to handle invalid actions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 1  

  
  
 Reply to topic