PHP code example of mvccore / ext-router-module-media

1. Go to this page and download the library: Download mvccore/ext-router-module-media library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mvccore / ext-router-module-media example snippets


new \MvcCore\Ext\Routers\Modules\Route([
    "pattern"              => "//<media_version>.example.com",
    "module"               => "main",
    "constraints"          => ["media_version" => "www|mobile"],
]);

$app = \MvcCore\Application::GetInstance();
$app->SetRouterClass('\MvcCore\Ext\Routers\ModuleMedia');
...
// to get router instance for next configuration:
/** @var \MvcCore\Ext\Routers\ModuleMedia $router */
$router = \MvcCore\Router::GetInstance();