BKWLD / decoy

A Laravel model-based CMS
http://docs.decoy.bukwild.com/
MIT License
303 stars 44 forks source link

Disable nl2br() on textbox, for use with json #65

Closed eminos closed 7 years ago

eminos commented 7 years ago

Is there a way to disable the nl2br() on textboxes? I'm using a textbox (Element) to manage a json string, and it get's broken by nl2br().

weotch commented 7 years ago

Yeah, if you do Decoy::el('path.to.element')->value it will get the raw value for the element. Those transformations happen when value() is called by __toString(): https://github.com/BKWLD/decoy/blob/master/classes/Models/Element.php#L120-L144