Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
dynamic view loader (or something like that)?
  • Hello everyone, a friend of me and I want to write a little blog to get to know fuel.
    So we thought about how we want to do it and now we have a little problem:
    We want to template, one for the frontend and one for the backend.
    Those templates only define the structur of the side, like navi, sidebar and content.
    Now we have to somehow fill those sections. We thought about routing each URL request to a frontend or backend controller. Those controllers extend a template controller like Controller_Template. So the controller can call another controller and bind the output to a certain variable, like $content. The called controller now performs his requested method and fills the content, but what about the rest? He cant change the sidebar or navi (is that correct? The called controller extends the Controller class). We also thought about the same principle but instead of controllers we could use modules. What do you think? Is this going into the correct direction or do you have any other tips or examples on how we could solve this? Greetings, accname
  • Hey tried around a litte bit but got an infinite loop.
    I created a Controller which extends the Controller_Template. Now I routed some URL calls to this controller which build the side, like it should forge other controllers via HMVC: Request::forge('mycontroller/mymethod/parms')->execute(); This forge is assigned to a variable in the view for example to call an Navigation Controller.
    Doesn't matter which calls of the Request im calling i always get an infinite loop. What am I doing wrong? Greetings
  • You are sure that "mycontroller/mymethod/parms" doesn't also route to this controller you created? HMVC requests are identical to normal requests, meaning their request URI is processed by the routing engine just like a normal browser request. If you don't want that (or if the controller is not routable), use false as second argument to the forge() call.
  • Use HMVC calls to call secondary controllers and fetch their content. Modules are just a way to modularize your code, modules have controllers too.

Howdy, Stranger!

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

In this Discussion