i try that amit but the problem not solved

now the problem is when i try to enter the url

/admincp/posts/add

the phpcake try to run the action add instead of the action admin_add


On Tue, Jan 20, 2009 at 4:07 PM, Amit Badkas <[email protected]> wrote:

> Try to put Router::connect('/admincp/:controller/:action',
> array('controller' => $this->params['controller'], 'action' =>
> 'admin_index')); before Router::connect('/admincp/:controller',
> array('controller' => $this->params['controller'], 'action' =>
> 'admin_'.$this->params['action'])); instead of after
>
> 2009/1/20, mohammad al-ani <[email protected]>:
>>
>> thank you Amit Badkas and RoVo but i try not to change the funtion in the
>> controller and not to use the Configure::write('Routing. admin',
>> 'admincp');
>>
>> i try to use the routing system to make every thing work without changing
>> the actions prefix so i just try something like this in the routes.php
>>
>> Router::connect('/admincp/:controller', array('controller' =>
>> $this->params['controller'], 'action' => 'admin_index'));
>> Router::connect('/admincp/:controller/:action', array('controller' =>
>> $this->params['controller'], 'action' => 'admin_'.$this->params['action']));
>>
>> but i have troubles with it, it work fine with
>> /admincp/posts/
>>
>> but i didn't't work with
>> /admincp/posts/add
>>
>> On Tue, Jan 20, 2009 at 3:27 PM, RoVo <[email protected]> wrote:
>>
>>>
>>> Hi medo,
>>>
>>> > my question is how to route the admincp
>>> I didn't test it, but I think that it works like this...
>>>
>>> use
>>> Configure::write('Routing.admin', 'admincp');
>>>
>>> in the controller change the function names like this:
>>>
>>> function admincp_add() {
>>>
>>> and rename your templates like this:
>>> admincp_add.ctp
>>>
>>> Hope that helps
>>> RoVo
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Amit
>
> http://amitrb.wordpress.com/
> http://coppermine-gallery.net/
> http://cheesecake-photoblog.org/
> http://www.sanisoft.com/blog/author/amitbadkas
> >
>

--~--~---------~--~----~------------~-------~--~----~
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