Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

A CakePHP class for forward and reverse routing of routes accessible via a model. For example, routes stored in a database table.

Notifications You must be signed in to change notification settings

robertlove/CakePHP-Model-Route-Class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

CakePHP Model Route Class

A CakePHP class for forward and reverse routing of routes accessible via a model. For example, routes stored in a database table.

INSTALLATION
----------------------

1. Copy ModelRoute.php to your app/Lib directory

CONFIGURATION
----------------------

1. Add the following to app/Config/routes.php:

    App::import('Lib', 'ModelRoute');
    Router::connect('/', array('controller' => 'pages', 'action' => 'display'), array('routeClass' => 'ModelRoute'));

2. Update the ModelRoute::settings property to reflect your needs

USAGE
----------------------

Assuming you have a model named "Route" which uses a table with the fields "name" and "value", the following records could be added to create database-driven routes:

-----------------------------------------------
| id | name                    | value        |
-----------------------------------------------
|  1 | cakephp-is-really-tasty | posts/view/1 |
|  2 | people/robert-love      | users/view/2 |
|  3 | tags/cake               | tags/view/3  |
|  4 | tags/php                | tags/view/5  |
-----------------------------------------------

LICENSE
----------------------

This source file is subject to the MIT License that is available through the world-wide-web at the following URI:
http://www.opensource.org/licenses/mit-license.php.

About

A CakePHP class for forward and reverse routing of routes accessible via a model. For example, routes stored in a database table.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages