On Mar 25, 10:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I have never in my life had more trouble doing straightforward things
> than I  have in the last month with CakePHP. Online articles, the
> manual, the API, and the 1.2 book (http://book.cakephp.org/complete/3/
> the-manual)
>
> have led me to try about six ways of setting up a route that:
> takes URLwww.site.com/5
> and goes to
> PagesController->showLog($id)
> with the 5 as the id argument
>
> so this is the last rule in my routes.php
>
> Router::connect('/:id',
>         array('controller' => 'pages', 'action' => 'showLog'),
>         array('id'=>'[0-9]+')
> );
>
> That syntax is straight out of the "You'll be a routing pro" section
> of the book. It feels like I'm telling it to use the controller and
> action I specified, and put the data (5) into $id
>
> but i  get
> Warning (2): Missing argument 1 for PagesController::showLog() [APP/
> controllers/pages_controller.php, line 17]

because :id is a named parameter, not the first param to be passed to
the action.

See http://www.thinkingphp.org/2008/03/03/new-router-goodies/ for what
you are trying to do (or change the code to expect a named param)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to