Routes are classes that must:
• know how to parse
• decide which controller needs to be initialized
• decide which method must be called in controller
• handle HTTP error you throw with
• show some response if framework catches
• know how to generate URLs (for step 1)
Simple as that. Koldy comes with one or few predefined route classes but if you really want, you can make your own routing class. Its not that hard after all.
• Default Route:
Its easy. Define your own class in
make sure that you extend
and implement all abstract methods. After that, go to
configs/application.php and under
the name of your class and define
routing_options if your
routing class requires options.
Example: if you defined your routing class in
/application/library/Site/CustomRoute.php, then you must
Site and class name
CustomRoute.php. After that, under
\Site\CustomRoute and thats it.
|Project Structure||Input Parameters|