This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace IncCart\Controller\Component; | |
use Cake\Controller\Component; | |
/** | |
* Created by PhpStorm. | |
* User: Subhan Ahmed | |
* Date: 5/29/2016 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return $default = [ | |
'className' => 'Cake\Database\Connection', | |
'driver' => 'Cake\Database\Driver\Mysql', | |
'persistent' => false, | |
'host' => 'localhost', | |
/** | |
* CakePHP will use the default DB port based on the driver selected | |
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Cake\Routing\RouteBuilder; | |
use Cake\Routing\Router; | |
Router::prefix('admin', ['_namePrefix'=>'admin:'], function ($routes) { | |
$routes->scope('/users', ['plugin'=>'IncUsers', 'controller'=> 'Users', '_namePrefix'=>'users:'], function ($routes) { | |
$routes->connect('/', ['action'=>'index'], ['_name'=>'index']); | |
$routes->connect('/add', ['action'=>'add'], ['_name'=>'add']); | |
$routes->connect('/edit/:id', ['action'=>'edit'], ['pass'=>['id'], 'id'=>'[[:xdigit:]-]+', '_name'=>'edit']); | |
$routes->connect('/profile/:id', ['action'=>'view'], ['pass'=>['id'], 'id'=>'[[:xdigit:]-]+', '_name'=>'profile']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Routes configuration | |
* | |
* In this file, you set up routes to your controllers and their actions. | |
* Routes are very important mechanism that allows you to freely connect | |
* different URLs to chosen controllers and their actions (functions). | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router::scope('/', function ($routes) { | |
$routes->plugin( | |
'IncUsers', | |
['path' => '/'], | |
function (RouteBuilder $routes) { | |
$routes->connect('/login/', ['controller' => 'Users', 'action' => 'login']); | |
$routes->connect('/register/', ['controller' => 'Users', 'action' => 'add']); | |
$routes->fallbacks('DashedRoute'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router::prefix('admin', function ($routes) { | |
$routes->plugin( | |
'IncUsers', | |
['path' => '/users'], | |
function (RouteBuilder $routes) { | |
$routes->fallbacks('DashedRoute'); | |
$routes->connect('/login/', ['controller' => 'Users', 'action' => 'login']); | |
$routes->connect('/register/', ['controller' => 'Users', 'action' => 'add']); | |
$routes->connect('/logout/', ['controller' => 'Users', 'action' => 'logout']); |
NewerOlder