Jump to content

Pre Processing Of Data For Admin Form


vladimircape

Recommended Posts

I have field_option like

blablab' => array(
'title'      => $this->l('Text for META area'),
'hint'       => $this->l('Set the text for META tag in main page.'),
'type'       => 'textarea'
)

these value stored in configuration table

because it's html data, system didn't store it correctly, and not displayed.

 

I try to save <meta>tag but can't i raw and made htmlspecialchars in preSave

 

How to prepare value before display?

Link to comment
Share on other sites

you can add a 'callback' parameter to that array. You can pass in the firs argument as the current value, and the second as current row of elements.

In the callback function, you can try printing out the field and see how it's displayed. If you need some formatting, you can try Tools::nl2br or stripslashes

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...