Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
using rest in controller hybrid without theme
  • Dear,

    i am using theme in my hybrid controller

    so i want to use some rest functionality too. like get_table() post_data()

    but when ever i am using it, like url/table.json

    i getting theme error, i want to turn off all functionality in this rest functions, any clues.
  • The Hybrid controller does that automatically.

    This sounds like you're using an after() method that disables the functionality of the hybrid controller. You should assign the theme template in the before() method to $this->template. You should not touch the after() method.

    Your standard actions then assigns template partials to $this->template

    Your REST actions don't, they return a response containing your REST data, or an array that after() will convert to JSON.

  • Not clear,

    i am using after method, without after, theme will not work in template controller, now i have an theme controller which is set by theme, and all backend controllers are extended from it,
  • If you use a theme in the template controller, the same is true.

    Don't manually try do some all sorts of stuff, since you disable the processing in the parent controller. Instead, use the before() to assign you theme page template to $this->template, and use that in your controller actions.

    Because you have created your own after method, the Fuel base controllers no longer work.

Howdy, Stranger!

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

In this Discussion