Router::resourceMap PHP Method

resourceMap() public static method

Resource map getter & setter.
See also: Router::$_resourceMap
public static resourceMap ( array $resourceMap = null ) : mixed
$resourceMap array Resource map
return mixed
    public static function resourceMap($resourceMap = null)
    {
        if ($resourceMap === null) {
            return static::$_resourceMap;
        }
        static::$_resourceMap = $resourceMap;
    }

Usage Example

<?php

Router::mapResources(array('gifts', 'users'));
Router::resourceMap(array(array('action' => 'index', 'method' => 'GET', 'id' => false), array('action' => 'view', 'method' => 'GET', 'id' => true), array('action' => 'add', 'method' => 'POST', 'id' => false), array('action' => 'update', 'method' => 'PUT', 'id' => true), array('action' => 'signup', 'method' => 'POST', 'id' => false), array('action' => 'delete', 'method' => 'DELETE', 'id' => true)));
Router::parseExtensions();
require CAKE . 'Config' . DS . 'routes.php';
All Usage Examples Of Router::resourceMap