HummingBirdAnimeClient/app/appConf/routes.php

214 lines
5.5 KiB
PHP
Raw Normal View History

2015-05-22 12:36:26 -04:00
<?php
2015-11-16 11:40:01 -05:00
/**
* Hummingbird Anime Client
*
* An API client for Hummingbird to manage anime and manga watch lists
*
2016-08-30 10:01:18 -04:00
* PHP version 5.6
*
2015-11-16 11:40:01 -05:00
* @package HummingbirdAnimeClient
2016-08-30 10:01:18 -04:00
* @author Timothy J. Warren <tim@timshomepage.net>
* @copyright 2015 - 2016 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version 3.1
2015-11-16 11:40:01 -05:00
* @link https://github.com/timw4mail/HummingBirdAnimeClient
*/
2015-05-22 12:36:26 -04:00
use const Aviat\AnimeClient\{
DEFAULT_CONTROLLER_METHOD,
DEFAULT_CONTROLLER_NAMESPACE
};
2016-01-06 11:08:56 -05:00
use Aviat\AnimeClient\AnimeClient;
2015-05-22 12:36:26 -04:00
return [
2016-01-06 11:08:56 -05:00
// -------------------------------------------------------------------------
// Routing options
//
// Specify default paths and views
// -------------------------------------------------------------------------
'route_config' => [
// Path to public directory, where images/css/javascript are located,
// appended to the url
'asset_path' => '/public',
// Which list should be the default?
'default_list' => 'anime', // anime or manga
// Default pages for anime/manga
'default_anime_list_path' => "watching", // watching|plan_to_watch|on_hold|dropped|completed|all
'default_manga_list_path' => "reading", // reading|plan_to_read|on_hold|dropped|completed|all
// Default view type (cover_view/list_view)
'default_view_type' => 'cover_view',
],
2016-01-06 11:08:56 -05:00
// -------------------------------------------------------------------------
// Routing Config
//
// Maps paths to controlers and methods
// -------------------------------------------------------------------------
'routes' => [
// ---------------------------------------------------------------------
// Anime List Routes
// ---------------------------------------------------------------------
2016-03-03 16:53:17 -05:00
'anime.add.get' => [
2016-01-04 10:53:03 -05:00
'path' => '/anime/add',
2017-02-15 15:56:10 -05:00
'action' => 'addForm',
'verb' => 'get',
],
2016-03-03 16:53:17 -05:00
'anime.add.post' => [
2016-01-04 10:53:03 -05:00
'path' => '/anime/add',
'action' => 'add',
'verb' => 'post',
2016-01-06 11:08:56 -05:00
],
2016-03-03 16:53:17 -05:00
'anime.details' => [
2016-02-02 11:34:03 -05:00
'path' => '/anime/details/{id}',
'action' => 'details',
'tokens' => [
'id' => '[a-z0-9\-]+',
],
2016-02-02 11:34:03 -05:00
],
'anime.delete' => [
'path' => '/anime/delete',
'action' => 'delete',
'verb' => 'post',
],
2016-02-02 11:34:03 -05:00
// ---------------------------------------------------------------------
// Manga Routes
// ---------------------------------------------------------------------
2016-03-03 16:53:17 -05:00
'manga.search' => [
2016-02-02 11:34:03 -05:00
'path' => '/manga/search',
'action' => 'search',
],
2016-03-03 16:53:17 -05:00
'manga.add.get' => [
2016-02-02 11:34:03 -05:00
'path' => '/manga/add',
2017-02-15 15:56:10 -05:00
'action' => 'addForm',
'verb' => 'get',
2016-02-02 11:34:03 -05:00
],
2016-03-03 16:53:17 -05:00
'manga.add.post' => [
2016-02-02 11:34:03 -05:00
'path' => '/manga/add',
'action' => 'add',
'verb' => 'post',
],
'manga.delete' => [
'path' => '/manga/delete',
'action' => 'delete',
'verb' => 'post',
2016-02-02 11:34:03 -05:00
],
2016-04-14 17:51:00 -04:00
'manga.details' => [
'path' => '/manga/details/{id}',
'action' => 'details',
'tokens' => [
'id' => '[a-z0-9\-]+',
],
],
2016-01-06 11:08:56 -05:00
// ---------------------------------------------------------------------
// Anime Collection Routes
// ---------------------------------------------------------------------
2016-03-03 16:53:17 -05:00
'collection.search' => [
2015-12-08 14:52:59 -05:00
'path' => '/collection/search',
'action' => 'search',
2015-12-08 14:52:59 -05:00
],
2016-03-03 16:53:17 -05:00
'collection.add.get' => [
'path' => '/collection/add',
'action' => 'form',
'params' => [],
],
2016-03-03 16:53:17 -05:00
'collection.edit.get' => [
'path' => '/collection/edit/{id}',
'action' => 'form',
'tokens' => [
'id' => '[0-9]+',
],
],
2016-03-03 16:53:17 -05:00
'collection.add.post' => [
'path' => '/collection/add',
'action' => 'add',
'verb' => 'post',
],
2016-03-03 16:53:17 -05:00
'collection.edit.post' => [
'path' => '/collection/edit',
'action' => 'edit',
'verb' => 'post',
],
2016-03-03 16:53:17 -05:00
'collection.view' => [
'path' => '/collection/view{/view}',
'action' => 'index',
'params' => [],
'tokens' => [
'view' => '[a-z_]+',
],
],
'collection.delete' => [
'path' => '/collection/delete',
'action' => 'delete',
'verb' => 'post',
],
2016-01-06 11:08:56 -05:00
// ---------------------------------------------------------------------
// Manga Collection Routes
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
2016-01-06 11:08:56 -05:00
// Default / Shared routes
// ---------------------------------------------------------------------
2016-04-21 11:14:21 -04:00
'cache_purge' => [
'path' => '/cache_purge',
2016-12-20 12:58:37 -05:00
'action' => 'clearCache',
'controller' => DEFAULT_CONTROLLER_NAMESPACE,
2016-04-21 11:14:21 -04:00
'verb' => 'get',
],
2016-03-03 16:53:17 -05:00
'login' => [
'path' => '/login',
2016-01-06 11:08:56 -05:00
'action' => 'login',
'controller' => DEFAULT_CONTROLLER_NAMESPACE,
'verb' => 'get',
2016-01-06 11:08:56 -05:00
],
2016-03-03 16:53:17 -05:00
'login.post' => [
'path' => '/login',
2016-12-20 12:58:37 -05:00
'action' => 'loginAction',
'controller' => DEFAULT_CONTROLLER_NAMESPACE,
'verb' => 'post',
2016-01-06 11:08:56 -05:00
],
'logout' => [
2016-03-03 16:53:17 -05:00
'path' => '/logout',
'action' => 'logout',
'controller' => DEFAULT_CONTROLLER_NAMESPACE,
2016-01-06 11:08:56 -05:00
],
'update' => [
'path' => '/{controller}/update',
'action' => 'update',
'verb' => 'post',
2016-01-06 11:08:56 -05:00
'tokens' => [
'controller' => '[a-z_]+',
],
2016-01-06 11:08:56 -05:00
],
2016-03-03 16:53:17 -05:00
'update.post' => [
2016-01-06 11:08:56 -05:00
'path' => '/{controller}/update_form',
2017-02-15 15:56:10 -05:00
'action' => 'formUpdate',
2016-01-06 11:08:56 -05:00
'verb' => 'post',
'tokens' => [
'controller' => '[a-z_]+',
],
2016-01-06 11:08:56 -05:00
],
'edit' => [
'path' => '/{controller}/edit/{id}/{status}',
'action' => 'edit',
'tokens' => [
'id' => '[0-9a-z_]+',
'status' => '([a-zA-Z\-_]|%20)+',
],
2016-01-06 11:08:56 -05:00
],
'list' => [
'path' => '/{controller}/{type}{/view}',
'action' => DEFAULT_CONTROLLER_METHOD,
2016-01-06 11:08:56 -05:00
'tokens' => [
'type' => '[a-z_]+',
'view' => '[a-z_]+',
],
2016-01-06 11:08:56 -05:00
],
'index_redirect' => [
'path' => '/',
'controller' => DEFAULT_CONTROLLER_NAMESPACE,
'action' => 'redirectToDefaultRoute',
2016-01-06 11:08:56 -05:00
],
],
2016-01-06 11:08:56 -05:00
];