Not quite sure on the finer points of how the reordering of the routes
causes your urls to correct themselves (in this instance at least)
But am curios: what about if you create your link url like:
<?php e($html->link('+ add new
post',array('controller'=>'Posts','action'=>'add', 'prefix'=>'admin'))) ?>
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of medo
Sent: Thursday, January 22, 2009 10:09 AM
To: CakePHP
Subject: complex problem
hi group
today i have really complex problem when i try to implement a site
with two back end interface one for the superadmin interface which
offered to enter the global site config. and the second one is the
admin interface which offered to admin the site content and i didn't
use core.php using Configure::write('Routing.admin', 'admin') i use
the routes.php with these two lines
Router::connect('/superadmin/:controller/:action/*', array('prefix' =>
'superadmin'));
Router::connect('/admin/:controller/:action/*', array('prefix' =>
'admin'));
and after that i continue to implement the first controller which is
the posts controller and the problem appear when i try to add a link
in the admin_index.ctp view of the posts controller to the action add
of the same controller. the problem is when i use the verbose link the
route system give wrong link like this
[ admin_index.ctp of Posts controller ]
..
<?php e($html->link('+ add new post',array
('controller'=>'Posts','action'=>'admin_add'))) ?>
..
the result link will be
/superadmin/posts/admin_add [ wrong link ]
but when i rearrange the route line to become like this
Router::connect('/admin/:controller/:action/*', array('prefix' =>
'admin'));
Router::connect('/superadmin/:controller/:action/*', array('prefix' =>
'superadmin'));
i get the right link like below
/admin/posts/add
is there any solution to this problem which will i face it again when
i'll work with the superadmin interface
Internal Virus Database is out of date.
Checked by AVG - http://www.avg.com
Version: 8.0.176 / Virus Database: 270.10.8/1899 - Release Date: 1/17/2009
5:50 PM
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---