TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
Forums are in read-only mode while we transition to new software.
Kohana REST Controller
  • How would I stop the evaluation of action_index, action_create, action_update, action_delete if there is an error detected in the route (e.g. the user did not specify an id) in the before() method and just return the set response status/body?

  • You can't skip the action altogether, but you could change it do some dummy one:

    public function before()
    {
       $this->request->action('empty');
    }
    
    public function action_empty()
    {}
    

    Or just throw exception and let your exception handler take care of it.

  • Also note, Controller_REST has been removed from Kohana 3.2

  • @samsoir, do you have any plans to develop your krestful module for 3.2?

  • @supster: Here is the answer

    Fixes #2484, removed Controller_REST from the core library. May return in 3.3 as module

  • Is there Github Repo for new REST module yet?

  • @dexcell That module extends existing Kohana Core classes and Controller_REST has been removed from Kohana 3.2

  • Just for the record. A real RESTful controller will be developed at some stage in the future. It won't be part of the core as it goes above and beyond core features. In 3.2 we're doing a lot of work to make handling of Accept-* headers fully meet RFC 2616. Once this is done, a truly RESTful controller will be possible.

  • Just a quick sanity check, but is there anything different in 3.2 artitecture that would prevent the 3.1 Controller_REST from functioning (ie for those developing features based on the existing system Controller, who may want to copy the controller to their own application folder)?

  • The 3.1 Controller_REST class should work fine in 3.2 with no alteration. However making promises about API breakage at this stage before the API is frozen would be foolish.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion