Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Use single quotes for attributes set with Fieldset::forge('foobar')->add() ?
  • I'm trying to pass a JSON object using Format::forge($myArray)->to_json() to a data attribute.
    However it can only work if I use single quotes as JSON format requires double quotes.

    Is there a way to allow this?
  • You mean you're trying to put a string into an HTML tag attribute that contains a double quote?

    The correct way to deal with that is to html-encode the string. Obviously that means that the code using that data attribute must know that and html-decode if before use.

Howdy, Stranger!

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

In this Discussion