Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
HTML Code not in Views
  • Hi, I'm new in FuelPHP.

    I found out if the HTML code is not coming from the views folder, the framework will convert my html code to text only. How about my HTML code from different source like database, or other model. How can I display the HTML code at web page ?

    Thanks for your help!

  • HarroHarro
    Accepted Answer
    The architectural design of FuelPHP is "encode on output", and not like most other frameworks, "strip on input". We assume that all data send to the browser is unsafe, unless you say otherwise.

    There are several ways to to that:
    - use the set() method of the View object, and set the filter flag to false
    - use the set_safe() method of the View object, which is an alias of the above
    - if you use custom HTML objects, you can whitelist them in the config

    View, Viewmodel, Presenter and Closure's are automatically whitelisted.
  • Thanks for your help, And the quick response.  : )

    By the way do you have very easy example for how to use template. I spent a whole day without understand how to use it... : (
  • HarroHarro
    Accepted Answer
    What do you mean by "template"?
  • Ah, ok.

    That page has a complete controller as example, what exactly is the part you're struggling wiith?

Howdy, Stranger!

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

In this Discussion