I copied and in my UserManager/Config/routes.php :

/************************************************************

* USER ROUTES

* ***********************************************************

* 

* 

* 

* 

************************************************************/

                Router::Connect('/users', array(

                                'plugin' => 'user_manager', 

                                'controller' => 'users')

                );

                                

                                

                Router::Connect('/users/index/*', array(

                                'plugin' => 'user_manager', 

                                'controller' => 'users')

                );

                                

                                

                Router::Connect('/users/:action/*', array(

                                'plugin' => 'user_manager', 

                                'controller' => 'users')

                );

                

                                

                Router::connect('/login', array(

                                'plugin' => 'user_manager', 

                                'controller' => 'users', 

                                'action' => 'login')

                );

                                

                                

                Router::connect('/logout', array(

                                'plugin' => 'user_manager', 

                                'controller' => 'users', 

                                'action' => 'logout')

                );

                                

 

                Router::Connect('/register', array(

                                'plugin' => 'user_manager', 

                                'controller' => 'users', 

                                'action' => 'add')

                );

 

App/Config/bootstrap.php has CakePlugin::load('UserManager',
array('bootstrap' => false, 'routes' => true));

 

But everything is still prefixed with user_manager/controller/action/

 

Examples:

 

Link Code:

<?php echo $this->Html->link('List Users', array(

                'plugin' => 'user_manager', 'controller' => 'users',
'action' => 'index'));?>

 

Creates:

http://starter/admin/user_manager/users

http://starter/user_manager/users

 

Goal:

http://starter/admin /users

http://starter/users

 

***************************************************************************
Link Code:

<?php echo $this->Html->link('View', array(

                'plugin' => 'user_manager', 'controller' => 'users',
'action' => 'view', $user['User']['id'])); ?>

 

Creates:

http://starter/admin/user_manager/users/view/51179d54-c54c-46a4-9f46-13d479e
a19b9

http://starter/user_manager/users/view/51179d54-c54c-46a4-9f46-13d479ea19b9

 

Goal: 
http://starter/admin/users/view/51179d54-c54c-46a4-9f46-13d479ea19b9

http://starter/users/view/51179d54-c54c-46a4-9f46-13d479ea19b9

**************************************************************************

Added 'prefix' => 'admin', 'prefix' => true to the links but that changed
nothing either.



 

From: [email protected] [mailto:[email protected]] On Behalf
Of Vanja Dizdarevic
Sent: Sunday, February 10, 2013 5:52 PM
To: [email protected]
Subject: Re: Plugin Routing

 

Check out CakeDC Users routing =>
https://github.com/CakeDC/users/blob/master/Config/routes.php

 

You could probably just copy the file and it would work!

 

I encourage you to check the whole plugin out, it has good features and you
can extend it quite easily, but it's really small. 

I always did my users from scratch until I found it - I don't anymore.. :D

On Saturday, February 9, 2013 1:01:27 AM UTC+1, advantage+ wrote:

I am creating my own UserManager plugin with bootstrap.php in app:

CakePlugin::load('UserManager', array('bootstrap' => false, 'routes' =>
true));

 

I want to clean the url up a bit to eliminate user_manager/users to be
simply user/whatever action

 

UserManager.routes.php 
Router::connect('/users/*', array('plugin' => 'user_manager', 'controller'
=> 'users', 'action' => ?????));

 

Router::connect('/users', array('plugin' => 'user_manager', 'controller' =>
'users', 'action' => 'index'));

Router::connect('/register', array('plugin' => 'user_manager', 'controller'
=> 'users', 'action' => 'register'));

Router::connect('/login', array('plugin' => 'user_manager', 'controller' =>
'users', 'action' => 'login'));

Router::connect('/logout', array('plugin' => 'user_manager', 'controller' =>
'users', 'action' => 'logout'));

 

Some I have modified to remove "users/" all together, but I do not want to
define a route for every action, is there an easy way to accomplish this?

 

Thanks,

 

Dave

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to