Form helper in codeigniter autoescapes form data?
I've got the following code: echo form_submit('Update Info', icon('accept') . ' Update Info', 'class="button medium green"');
, which outputs a styled submit button. The icon
function returns the image embed code to the proper i开发者_C百科con. Unfortunately it seems that the form_submit
method escapes the <>
in the image embed code.
How can I tell CI to trust the data from this and leave it untouched?
Update: From the CI docs:
Note: If you use any of the form helper functions listed in this page the form values will be prepped automatically, so there is no need to call this function. Use it only if you are creating your own form elements.
Anybody know how to disable this semi-annoying feature for one output?
form_submit
gives you a <input type='submit'>
style button. The value=""
field in <input>
does not allow you to use HTML in it, so its not CI escaping, its your browser.
In order to use <input type='submit'>
submit buttons with HTML, you'd better use <button type='submit'>Your text with HTML here</button>
, but you have to write the HTML by yourself.
Update. It is escaped. HTML helper source code. Shouldn't just be looking at forms. Oh well, but the solution above still applies.
精彩评论