<?php
include './config/config.php';
app::$config['path']['view'] = '/var/www/something.com/public/views';
app::$config['view']['404'] = '404';
app::$config['locale'] = ['en','ge'];
// call anonymous function and pass id
// links with
// 'en/news/13', 'ge/news/13' and 'news/13' will activate route
app::get ('news/{id}',function($id){
//parse view with passed variables
app::view('news_item',['id'=>$id]);
})
->name('news') //short key of route
->type('id','int'); //restrict type of id
/*
call some method of class
*/
app::post ('news/publish','home.index');
app::run();
//get current locale
app::locale();
app::url('news',5);
-
Notifications
You must be signed in to change notification settings - Fork 1
hazardland/router.php
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simpliest Laravel like router one class one file router
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published