Sunday, February 10, 2013

RE: Plugin Routing

Thanks,

 

I will check it out.
Looked a few plugins but all I found was they had a Router::connect for every action which seems to defeat the purpose so I will see how DC Users looks.

 

Thanks,

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Vanja Dizdarevic
Sent: Sunday, February 10, 2013 5:52 PM
To: cake-php@googlegroups.com
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 cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: