PHP Classes

File: modules/cms/routes.php

Recommend this page to a friend!
  Packages of Luke Towers   Winter   modules/cms/routes.php   Download  
File: modules/cms/routes.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Winter
Content management system that uses MVC
Author: By
Last change:
Date: 1 year ago
Size: 958 bytes
 

 

Contents

Class file image Download
<?php

Event::listen('system.route', function () {
    /**
     * Register CMS routes before all user routes.
     */

    /**
     * @event cms.beforeRoute
     * Fires before cms routes get added
     *
     * Example usage:
     *
     *     Event::listen('cms.beforeRoute', function () {
     *         // your code here
     *     });
     *
     */
    $result = Event::fire('cms.beforeRoute', [], true);
    if ($result === false) {
        return;
    }

    /*
     * The CMS module handles all URLs that have not already been handled by the other modules & plugins.
     */
    Route::any('{slug?}', 'Cms\Classes\CmsController@run')->where('slug', '(.*)?')->middleware('web');

    /**
     * @event cms.route
     * Fires after cms routes get added
     *
     * Example usage:
     *
     *     Event::listen('cms.route', function () {
     *         // your code here
     *     });
     *
     */
    Event::fire('cms.route');
}, PHP_INT_MIN);