Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Generally logic that is good in a controller can be put in the template file instead. This idea came from the "Smart model, Dumb controller" concept. We made controllers so dumb, it was rather clean and easy to understand when combined with a template. We see more of this with client side frameworks like Meteor.

Still, Forward is built on a new micro MVC framework and controllers do still exist. Those that prefer to write them can do so in a more traditional way.

    class AccountController extends Controller
    {
        function index ()
        {
            $this->account = get("/accounts/123");
    
            put($this->account, [role => "admin"]);
        }
    }
(This is not very useful code but you get the idea)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: