2012-10-12 18 views

回答

3

在你的控制器實現missingAction方法,

至於說@xdazz,它會檢查是否存在的方法,如果沒有它調用missingAction方法。

//This method is invoked when the controller cannot find the requested action. 

public function missingAction($actionID) 
{ 
    // Your code here 
} 
+0

我想這和它的作品很好!!!!!!!!!!!謝謝 –

3

這取決於框架的實現。

例如,如果框架實現的代碼,如:

If (!method_exists($controller, $action)) { 
    throw new Exception("The system is unable to find the requested action $action"); 
} 
相關問題