I am currently writing a system for publishing tutorials about basic PHP.
However, I am currently writing a Form to Edit a tutorial, that is in the Database.
Now, what I am trying to do is, using setDefaults when I view the Form on the website. However, the textarea is not showing the tutorial. I found the problem as I googled a little bit about it and also found an answer here that seems to be a pretty similar problem.
First of all I need to tell you about the the value that will be shown in this textarea element:
– Its a tutorial about PHP and will have special carachters in it due to the fact, that it will contain php code, maybe some HTML and some CSS and maybe even Javascript.
-
it will contain BBCode, as I am working with bbcodes to style my tutorial such as the BBCode Markup from the Zend Framework + additional bbcodes that I created for syntax highlighting
-
The Textbox will be seen with a Javascript Editor called “Markitup” that is based on jQuery. However, the Editor is disabled to minify the problem so plase ignore the last part, as it is only import:
-
Code + BBCode will be shown in this textarea element.
So what is next:
I found the source of my problem here:
Why zend_form cannot populate inputs with records from Firebird db with diacritic characters?
It clearly shows me, that Zend Framework is going to escape my values that that must be the reason, that the only element in my populated form is the textarea with the code.
QUESTION:
How to I get the tutorial shown in the plain textarea element WITHOUT changing an original file from the Zend Framework?
I dont want to change the escape(value) in the helper, so that my form is working. As the next update will simply overwrite everything. So I need to do that without changing original files.
I am looking forward to discuss this problem with you and hope that somebody can give me a hint or a solution to this problem.
According to the Zend manual the default escaping method is
htmlspecialcharsbut you can override it using thesetEscapemethod. Set it in the Controller to try out if it works:But it’s strange that “nothing” appears, since htmlspecialchars returns empty strings only if
ENT_IGNOREis provided as flag and thats not the default.