PHP code example of zenify / modular-routing

1. Go to this page and download the library: Download zenify/modular-routing 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/ */

    

zenify / modular-routing example snippets


namespace App\Modules\SomeModule\Routing;

use Nette\Application\Routers\Route;
use Nette\Application\Routers\RouteList;
use Zenify\ModularRouting\Routing\RouterFactoryInterface;


class SomeModuleRouterFactory implements RouterFactoryInterface
{
	
	/**
	 * {@inheritdoc}
	 */
	public function create()
	{
		$router = new RouteList('SomeModule');
		$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
		return $router;
	}
	
}