PHP Classes

File: App/Components/hello/routes.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   Zest   App/Components/hello/routes.php   Download  
File: App/Components/hello/routes.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Zest
Application to show the use of the Zest framework
Author: By
Last change: Apply fixes from StyleCI
Date: 5 years ago
Size: 522 bytes


Class file image Download

//namespace required to define your component you can add many routes in one component as well
$namespace = "App\Components\hello\Controllers";

// Its create the url localhost/blog/helloworld'
$com->add('helloworld', ['controller' => 'Home', 'action' => 'index', 'namespace'=>$namespace]);
// Its create the url localhost/blog/profile/username/about 'username'=> is any parameter
$com->add('{controller}/{username:[a-z+0-9]+}/{action}', ['controller' => 'Profile', 'action' => 'about', 'namespace'=>$namespace]);