Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Best way to set meta title from HMVC called module
  • Hello, 

    In a modular application where all is handled by modules, what do you think it's the best way to set main template's properties like meta title or description or things like that?

    I mean modules are not supposed to be aware on how they have been called. But for example we do have to set the correct 'title' for each page and that's the module who "knows" which title to set.

    Best regards
  • HarroHarro
    Accepted Answer
    There are a few ways of dealing with dependency issues:

    You make something globally accessable. This works if your modules have to work within a specified framework. For example, all our modules controllers are widget generators, but are operational within our webengine framework that has call points for stuff like this.

    If it truely has to be seperate, you can inject something the module can use, with a standarized interface.

    And a third option could be that your module controller doesn't return a single value, but it returns a predefined structure. We use ApiResponse and WidgetResponse classes as the standard response for REST API and Widget endpoints, and these classes have a standardized interface with which the called module can return data, error messages, a response status, etc.
  • Thank you very much Harro,

    I was thinking about this kind of solutions indeed, but I had to be sure you ( I mean the Fuelphp team ) didn't have already take it that in account. Indeed, as much as I have learned to know your framework, I've noticed that a lot of things that I planned to implement was already managed by fuelphp.

    Let me wish you the best health and a prompt recovery.

    Best regards,
    François

Howdy, Stranger!

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

In this Discussion