mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 00:12:28 +00:00
Development
- Fixed updatae causing middlewares to sometimes load on wrong routes. - Converted project to PSR/2. - Updated InputCollection class and added get method for easy access to values. - Complete refactor of RouterBase. - Added findRoute method to RouterBase. - It's now possible to change parameter modifiers and symbol by overwriting properties on RouterBase. - Added RouterUrlTest unit-test for testing route-urls. - Added IRestController that can be easily implemented in custom ResourceController-classes. - It's now possible to use "-" instead of "_" when using getHeader method in Request class. - Added PHPDocs. - Fixed "/" route sometimes returning "//" as url. - Optimisations and bugfixes.
This commit is contained in:
@@ -1,29 +1,27 @@
|
||||
<?php
|
||||
namespace Demo\Controllers;
|
||||
|
||||
class DefaultController {
|
||||
class DefaultController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
// implement
|
||||
echo sprintf('DefaultController -> index (?fun=%s)', input()->get('fun'));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
public function contact()
|
||||
{
|
||||
echo 'DefaultController -> contact';
|
||||
}
|
||||
|
||||
// implement
|
||||
echo sprintf('DefaultController -> index (?fun=%s)', input()->get('fun'));
|
||||
public function companies($id = null)
|
||||
{
|
||||
echo 'DefaultController -> companies -> id: ' . $id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function contact() {
|
||||
|
||||
echo 'DefaultController -> contact';
|
||||
|
||||
}
|
||||
|
||||
public function companies($id = null) {
|
||||
|
||||
echo 'DefaultController -> companies -> id: ' . $id;
|
||||
|
||||
}
|
||||
|
||||
public function notFound() {
|
||||
echo 'Page not found';
|
||||
}
|
||||
public function notFound()
|
||||
{
|
||||
echo 'Page not found';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user