Kohana param() don't work -


I am using Kohana 3. Does anyone know why the ultimate ('controller') result is a null.

Routing:

  Root :: Set ('Default', '(& lt; Contributor & gt; (& lt; Action & gt; (/ & lt ; Id & gt;)))) ') - & gt; Default (array ('controller' = & gt; 'page', 'verb' =>, 'index',));  

URL: http: // localhost / application / page / index / 1

The ultimate call:

  $ Param = Request :: Example () - & gt; Ultimate ('Controller'); Eco Koha :: Debug ($ Ultimate); // Result: NULL $ param = Request :: Example () - & gt; Ultimate ('action'); Eco Koha :: Debug ($ Ultimate); // result: zero $ param = request :: example () -> Ultimate ('id'); Eco Koha :: Debug ($ Ultimate); // result: 1  

See reqeuest.php on line 622:

  // These are accessible as public wars and can be loaded overset ($ params ['controller'], $ params ['action'], $ params ['directory']) ; // params can not be matched once - $ this-> _params = $ params;  

This is the reason that line 695 controller :

  public function para ($ key = NULL, $ default = NULL) {Return $ this- & gt; _params [$ key]; }  

In this way you control the controller $ controller = request :: example () -> controller; or $ controller = $ this- & gt; Request-> Controller; If you are inside an administrator


Comments