dancrew32 / marcel

The PHP 5.4 MVC with Shoes On: ActiveRecord, User/Session, Generators, SCSS, (Twitter Bootstrap) Integration, Workers, Cron Management, Image Manipulation, Caching, Git Management, Mail & Mail Parsing, OCR, Scraping, Selenium, Mustache, Markdown, Phone & Text Messaging, WebSockets, BitTorrent and much more!
5 stars 0 forks source link

handle http methods at the router, not in code #5

Closed dancrew32 closed 11 years ago

dancrew32 commented 11 years ago

add a better way to route based on http method.

maybe like

'/foo' => [
    'type' => [
        'post' => ['c' => 'controller', 'm' => 'method'],
        'get'  => ['c' => 'controller', 'm' => 'othermethod'],
    ],
],

but don't make type mandatory this might also make it easier to check auth for each route

'/foo' => [
    'type' => [
        'post' => ['c' => 'controller', 'm' => 'method'],
        'get'  => ['c' => 'controller', 'm' => 'othermethod'],
    ],
    'auth' => ['admin', 'user'],
],
dancrew32 commented 11 years ago

still need to implement the auth section, but i'll do that in a separate bit. closing this: https://github.com/dancrew32/marcel/commit/77937a28e4cac3ad33ac8461f4c88cf8fc5cbbc4