Hi all,

I can't find out how to correctly link my actions when using prefix
routing. I have two actions: index() for public users, and
admin_index() for the admin, which dumps extra data:

core.php:
Configure::write('Routing.admin', 'admin');

news_controller.php:
class NewsController extends AppController {
  function index() { }
  function admin_index() { }
}

routes.php:
Router::connect('/noticias', array('controller' => 'news', 'action' =>
'index'));
Router::connect('/administracion/noticias', array('controller' =>
'news', 'action' => 'index', 'prefix' => 'admin'));

news.ctp:
echo $html->link('PUBLIC NEWS', array('controller' => 'news', 'action'
=> 'index')); // Links to /noticias
echo $html->link('ADMIN NEWS', array('controller' => 'news', 'action'
=> 'admin_index'));  // Links to /news/admin_index

As you can see, the second link is broken (should say "/administracion/
noticias" instead of "/news/admin_index").

I've been dealing with this for a while and I cannot figure out the
solution. Has anybody run into this before?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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