예제 #1
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $brandCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('brands.php');
return call_user_func(function () {
    $brandCollection = new \Phalcon\Mvc\Micro\Collection();
    $brandCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/brands')->setHandler('\\App\\Modules\\Backend\\Controllers\\BrandsController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $brandCollection->options('/', 'optionsBase');
    $brandCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /brands/
    // Second paramter is the function name of the Controller.
    $brandCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $brandCollection->head('/', 'get');
    $brandCollection->post('/search', 'search');
    $brandCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    // $id will be passed as a parameter to the Controller's specified function
    $brandCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $brandCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $brandCollection->post('/', 'post');
    $brandCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $brandCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    $brandCollection->put('/upload/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'upload');
    return $brandCollection;
예제 #2
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $adminGroupsCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('admin_groups.php');
return call_user_func(function () {
    $adminGroupsCollection = new \Phalcon\Mvc\Micro\Collection();
    $adminGroupsCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/admin/groups')->setHandler('\\App\\Modules\\Admin\\Controllers\\GroupsController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $adminGroupsCollection->options('/', 'optionsBase');
    $adminGroupsCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /groups/
    // Second paramter is the function name of the Controller.
    $adminGroupsCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $adminGroupsCollection->head('/', 'get');
    $adminGroupsCollection->post('/search', 'search');
    $adminGroupsCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    // $id will be passed as a parameter to the Controller's specified function
    $adminGroupsCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $adminGroupsCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $adminGroupsCollection->post('/', 'post');
    $adminGroupsCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $adminGroupsCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $adminGroupsCollection;
});
예제 #3
0
<?php

/**
 * Created by PhpStorm.
 * User: Dapo
 * Date: 09-Dec-14
 * Time: 1:43 PM
 */
return call_user_func(function () {
    $api = new \Phalcon\Mvc\Micro\Collection();
    $api->setPrefix('/v1/grouper')->setHandler('\\PhalconRest\\Controllers\\GrouperController')->setLazy(true);
    // Issues Handlers
    $api->get('/issues', 'issues');
    $api->options('/issues', 'info');
    $api->get('/issues/principles', 'issuePrinciples');
    $api->options('/issues/principles', 'info');
    $api->get('/issues/stats', 'issueStats');
    $api->options('/issues/stats', 'info');
    $api->put('/principles/{id:[0-9]+}', 'updatePrinciple');
    $api->options('/principles/{id:[0-9]+}', 'info');
    $api->get('/reviews', 'reviews');
    $api->options('/reviews', 'info');
    $api->post('/reviews', 'newReview');
    $api->put('/reviews/{id:[0-9]+}', 'updateReview');
    return $api;
});
예제 #4
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $verticalsCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('verticals.php');
return call_user_func(function () {
    $verticalsCollection = new \Phalcon\Mvc\Micro\Collection();
    $verticalsCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/verticals')->setHandler('\\App\\Modules\\Backend\\Controllers\\VerticalsController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $verticalsCollection->options('/', 'optionsBase');
    $verticalsCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /verticals/
    // Second paramter is the function name of the Controller.
    $verticalsCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $verticalsCollection->head('/', 'get');
    $verticalsCollection->post('/search', 'searches');
    $verticalsCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    // $id will be passed as a parameter to the Controller's specified function
    $verticalsCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $verticalsCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $verticalsCollection->post('/', 'post');
    $verticalsCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $verticalsCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $verticalsCollection;
});
예제 #5
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 */
return call_user_func(function () {
    $exampleCollection = new \Phalcon\Mvc\Micro\Collection();
    $exampleCollection->setPrefix('/v1/access_token')->setHandler('\\Phalcon2Rest\\Modules\\V1\\Controllers\\AccessTokenController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $exampleCollection->options('/', 'optionsBase');
    $exampleCollection->post('/', 'post');
    return $exampleCollection;
});
예제 #6
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $attributesCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('attributes.php');
return call_user_func(function () {
    $attributesCollection = new \Phalcon\Mvc\Micro\Collection();
    $attributesCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/attributes')->setHandler('\\App\\Modules\\Backend\\Controllers\\AttributesController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $attributesCollection->options('/', 'optionsBase');
    $attributesCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /attributes/
    // Second paramter is the function name of the Controller.
    $attributesCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $attributesCollection->head('/', 'get');
    // $id will be passed as a parameter to the Controller's specified function
    $attributesCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $attributesCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $attributesCollection->post('/', 'post');
    $attributesCollection->post('/search', 'searches');
    $attributesCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    $attributesCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $attributesCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $attributesCollection;
});
예제 #7
0
<?php

/**
 * Created by PhpStorm.
 * User: Dapo
 * Date: 08-Dec-14
 * Time: 9:48 AM
 */
return call_user_func(function () {
    $userCollection = new \Phalcon\Mvc\Micro\Collection();
    $userCollection->setPrefix('/v1/users')->setHandler('\\PhalconRest\\Controllers\\UserController')->setLazy(true);
    $userCollection->get('/', 'index');
    $userCollection->post('/login', 'login');
    $userCollection->post('/login_jwt', 'login_jwt');
    $userCollection->options('/login_jwt', 'info');
    $userCollection->post('/register', 'register');
    return $userCollection;
});
예제 #8
0
<?php

/**
 * Standard routes for resource
 * Refer to routes/collections/example.php for further details
 */
return call_user_func(function () {
    $routes = new \Phalcon\Mvc\Micro\Collection();
    // VERSION NUMBER SHOULD BE FIRST URL PARAMETER, ALWAYS
    // setHandler MUST be a string in order to support lazy loading
    $routes->setPrefix('/v1/events')->setHandler('\\PhalconRest\\Controllers\\EventController')->setLazy(true);
    $routes->options('/', 'optionsBase');
    $routes->options('/{id}', 'optionsOne');
    $routes->get('/', 'get');
    $routes->head('/', 'get');
    $routes->post('/', 'post');
    $routes->get('/{id:[0-9]+}', 'getOne');
    $routes->head('/{id:[0-9]+}', 'getOne');
    $routes->delete('/{id:[0-9]+}', 'delete');
    $routes->put('/{id:[0-9]+}', 'put');
    $routes->patch('/{id:[0-9]+}', 'patch');
    return $routes;
});
예제 #9
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $adminUsersCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('admin_users.php');
return call_user_func(function () {
    $adminUsersCollection = new \Phalcon\Mvc\Micro\Collection();
    $adminUsersCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/admin/users')->setHandler('\\App\\Modules\\Admin\\Controllers\\UsersController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $adminUsersCollection->options('/', 'optionsBase');
    $adminUsersCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /users/
    // Second paramter is the function name of the Controller.
    $adminUsersCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $adminUsersCollection->head('/', 'get');
    $adminUsersCollection->post('/search', 'search');
    $adminUsersCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    $adminUsersCollection->post('/login', 'login');
    // $id will be passed as a parameter to the Controller's specified function
    $adminUsersCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $adminUsersCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $adminUsersCollection->post('/', 'post');
    $adminUsersCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $adminUsersCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $adminUsersCollection;
예제 #10
0
<?php

// This is an Immeidately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('example.php');
return call_user_func(function () {
    $userCollection = new \Phalcon\Mvc\Micro\Collection();
    $userCollection->setPrefix('/v1/users')->setHandler('\\PhalconRest\\Controllers\\UsersController')->setLazy(true);
    // Set Access-Control-Allow headers.
    //$userCollection->options('/', 'optionsBase');
    $userCollection->options('/{id}', 'optionsOne');
    // First parameter is the route, which with the collection prefix here would be GET /user/
    // Second parameter is the function name of the Controller.
    $userCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $userCollection->head('/', 'get');
    // $id will be passed as a parameter to the Controller's specified function
    $userCollection->get('/{id:[0-9]+}', 'getOne');
    $userCollection->head('/{id:[0-9]+}', 'getOne');
    $userCollection->post('/', 'post');
    $userCollection->delete('/{id:[0-9]+}', 'delete');
    $userCollection->put('/{id:[0-9]+}', 'put');
    $userCollection->patch('/{id:[0-9]+}', 'patch');
    return $userCollection;
});
예제 #11
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $countryOptionsCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('country_options.php');
return call_user_func(function () {
    $countryOptionsCollection = new \Phalcon\Mvc\Micro\Collection();
    $countryOptionsCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/country_options')->setHandler('\\App\\Modules\\Backend\\Controllers\\CountryOptionsController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $countryOptionsCollection->options('/', 'optionsBase');
    $countryOptionsCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /country_options/
    // Second paramter is the function name of the Controller.
    $countryOptionsCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $countryOptionsCollection->head('/', 'get');
    // $id will be passed as a parameter to the Controller's specified function
    $countryOptionsCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $countryOptionsCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $countryOptionsCollection->post('/', 'post');
    $countryOptionsCollection->post('/search', 'search');
    $countryOptionsCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    $countryOptionsCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $countryOptionsCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $countryOptionsCollection;
});
예제 #12
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $companiesCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('companies.php');
return call_user_func(function () {
    $companiesCollection = new \Phalcon\Mvc\Micro\Collection();
    $companiesCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/companies')->setHandler('\\App\\Modules\\Backend\\Controllers\\CompaniesController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $companiesCollection->options('/', 'optionsBase');
    $companiesCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /companies/
    // Second paramter is the function name of the Controller.
    $companiesCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $companiesCollection->head('/', 'get');
    $companiesCollection->post('/search', 'search');
    $companiesCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    // $id will be passed as a parameter to the Controller's specified function
    $companiesCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $companiesCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $companiesCollection->post('/', 'post');
    $companiesCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $companiesCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    $companiesCollection->put('/upload/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'upload');
    return $companiesCollection;
예제 #13
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $propertiesCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $propertiesCollection = include('properties.php');
return call_user_func(function () {
    $propertiesCollection = new \Phalcon\Mvc\Micro\Collection();
    $propertiesCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/properties')->setHandler('\\App\\Modules\\Backend\\Controllers\\PropertiesController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $propertiesCollection->options('/', 'optionsBase');
    $propertiesCollection->options('/{title}', 'optionsOne');
    // $title will be passed as a parameter to the Controller's specified function
    $propertiesCollection->get('/{title:[a-zA-Z]+}', 'getOne');
    $propertiesCollection->head('/{title:[a-zA-Z]+}', 'getOne');
    return $propertiesCollection;
});
예제 #14
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $productsCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('products.php');
return call_user_func(function () {
    $productsCollection = new \Phalcon\Mvc\Micro\Collection();
    $productsCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/products')->setHandler('\\App\\Modules\\Backend\\Controllers\\ProductsController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $productsCollection->options('/', 'optionsBase');
    $productsCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /products/
    // Second paramter is the function name of the Controller.
    $productsCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $productsCollection->head('/', 'get');
    // $id will be passed as a parameter to the Controller's specified function
    $productsCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $productsCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $productsCollection->post('/', 'post');
    $productsCollection->post('/search', 'search');
    $productsCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    $productsCollection->post('/import', 'bulkImport');
    $productsCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $productsCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    $productsCollection->put('/upload/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'upload');
예제 #15
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $exampleCollection
 */
// This is an Immeidately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('example.php');
return call_user_func(function () {
    $exampleCollection = new \Phalcon\Mvc\Micro\Collection();
    $exampleCollection->setPrefix('/v1/example')->setHandler('\\PhalconRest\\Controllers\\ExampleController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $exampleCollection->options('/', 'optionsBase');
    $exampleCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /example/
    // Second paramter is the function name of the Controller.
    $exampleCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $exampleCollection->head('/', 'get');
    // $id will be passed as a parameter to the Controller's specified function
    $exampleCollection->get('/{id:[0-9]+}', 'getOne');
    $exampleCollection->head('/{id:[0-9]+}', 'getOne');
    $exampleCollection->post('/', 'post');
    $exampleCollection->delete('/{id:[0-9]+}', 'delete');
    $exampleCollection->put('/{id:[0-9]+}', 'put');
    $exampleCollection->patch('/{id:[0-9]+}', 'patch');
    return $exampleCollection;
});
예제 #16
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $autocompleteCollection
 */
return call_user_func(function () {
    $collection = new \Phalcon\Mvc\Micro\Collection();
    $collection->setPrefix('/v1/skill')->setHandler('\\Api\\Controllers\\SkillController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $collection->options('/', 'optionsBase');
    //    $collection->options('/{access_token}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /autocomplete/
    // Second paramter is the function name of the Controller.
    $collection->get('/', 'get', 'skill-authbasic');
    //    $collection->post('/', 'post');
    //    $collection->put('/', 'put');
    // This is exactly the same execution as GET, but the Response has no body.
    //    $collection->head('/', 'get');
    return $collection;
});
예제 #17
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $areasCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('areas.php');
return call_user_func(function () {
    $areasCollection = new \Phalcon\Mvc\Micro\Collection();
    $areasCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/areas')->setHandler('\\App\\Modules\\Backend\\Controllers\\AreasController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $areasCollection->options('/', 'optionsBase');
    $areasCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /areas/
    // Second paramter is the function name of the Controller.
    $areasCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $areasCollection->head('/', 'get');
    $areasCollection->post('/search', 'search');
    $areasCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    // $id will be passed as a parameter to the Controller's specified function
    $areasCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $areasCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $areasCollection->post('/', 'post');
    $areasCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $areasCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $areasCollection;
});
예제 #18
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $channelsCollection
 */
// This is an Immediately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('channels.php');
return call_user_func(function () {
    $channelsCollection = new \Phalcon\Mvc\Micro\Collection();
    $channelsCollection->setPrefix('/' . $this->di->getConfig()->application->version . '/channels')->setHandler('\\App\\Modules\\Backend\\Controllers\\ChannelsController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $channelsCollection->options('/', 'optionsBase');
    $channelsCollection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /channels/
    // Second paramter is the function name of the Controller.
    $channelsCollection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $channelsCollection->head('/', 'get');
    $channelsCollection->post('/search', 'search');
    $channelsCollection->post('/search/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'searchOne');
    // $id will be passed as a parameter to the Controller's specified function
    $channelsCollection->get('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $channelsCollection->head('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'getOne');
    $channelsCollection->post('/', 'post');
    $channelsCollection->delete('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'delete');
    $channelsCollection->put('/{id:' . $this->di->getConfig()->application->idRegExp . '+}', 'put');
    return $channelsCollection;
});
예제 #19
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $autocompleteCollection
 */
// This is an Immeidately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('autocomplete.php');
return call_user_func(function () {
    $userCollection = new \Phalcon\Mvc\Micro\Collection();
    $userCollection->setPrefix('/v1/user')->setHandler('\\Api\\Controllers\\UserController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $userCollection->options('/', 'optionsBase');
    $userCollection->options('/{id,email,images}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /autocomplete/
    // Second paramter is the function name of the Controller.
    $userCollection->get('/', 'get');
    $userCollection->post('/', 'post');
    $userCollection->put('/{id:[a-zA-Z0-9_-]+}', 'put');
    // This is exactly the same execution as GET, but the Response has no body.
    $userCollection->head('/', 'get');
    return $userCollection;
});
예제 #20
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $exampleCollection
 */
// This is an Immeidately Invoked Function in php.  The return value of the
// anonymous function will be returned to any file that "includes" it.
// e.g. $collection = include('example.php');
return call_user_func(function () {
    $collection = new \Phalcon\Mvc\Micro\Collection();
    $collection->setPrefix('/api/wordType')->setHandler('\\Base\\Controllers\\Dictionary\\WordTypeController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $collection->options('/', 'optionsBase');
    $collection->options('/{id}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /example/
    // Second paramter is the function name of the Controller.
    $collection->get('/', 'get');
    // This is exactly the same execution as GET, but the Response has no body.
    $collection->head('/', 'get');
    // $id will be passed as a parameter to the Controller's specified function
    $collection->get('/{id:[0-9]+}', 'getOne');
    $collection->head('/{id:[0-9]+}', 'getOne');
    $collection->post('/create', 'create');
    $collection->post('/search', 'search');
    $collection->post('/update', 'update');
    $collection->delete('/{id:[0-9]+}', 'delete');
    $collection->put('/{id:[0-9]+}', 'put');
    $collection->patch('/{id:[0-9]+}', 'patch');
    return $collection;
예제 #21
0
<?php

/**
 * Collections let us define groups of routes that will all use the same controller.
 * We can also set the handler to be lazy loaded.  Collections can share a common prefix.
 * @var $autocompleteCollection
 */
return call_user_func(function () {
    $loginCollection = new \Phalcon\Mvc\Micro\Collection();
    $loginCollection->setPrefix('/v1/login')->setHandler('\\Api\\Controllers\\LoginController')->setLazy(true);
    // Set Access-Control-Allow headers.
    $loginCollection->options('/', 'optionsBase');
    //    $loginCollection->options('/{access_token}', 'optionsOne');
    // First paramter is the route, which with the collection prefix here would be GET /autocomplete/
    // Second paramter is the function name of the Controller.
    $loginCollection->get('/', 'get', 'login-allow');
    $loginCollection->get('/me', 'me', 'login-me-allow');
    $loginCollection->get('/out', 'out', 'login-out-allow');
    $loginCollection->post('/', 'post', 'login-post--allow');
    // This is exactly the same execution as GET, but the Response has no body.
    $loginCollection->head('/', 'get', 'login-head-allow');
    return $loginCollection;
});