daveyrow Posted August 23, 2016 Share Posted August 23, 2016 (edited) Hello, is it possile to set attributes to inputs in defining array? Like: array( 'type' => 'text', 'label' => $this->l('Path:'), 'name' => 'path', 'col' => 4, 'class' => 'toggle_import_type toggle_item_xml', 'attribute' => array( 'readonly' => 'readonly', 'data-custom' => 'whatever' ) ) with result of <input name="path" readonly="readonly" data-custom="whatever" etc.... it would be cool if it can, btw its not dificult to customize the helper, i can contribute if more people would like this thing Edited August 23, 2016 by daveyrow (see edit history) Link to comment Share on other sites More sharing options...
fkomaralp Posted August 20, 2020 Share Posted August 20, 2020 Hi from 2020!! I'm searching this question's answer. I'm already examined all prestashop repository i can't get any result. So, anyway I found a solution in the Prestashop sources. If you want to add a someting like data-products-url="/api/products" you can't do this anyway with HelperForm class seems like this class doesn't supports add custom attributes. You can store global javascript variable with your controller or module class if you want by using bellow code. Media::addJsDef([ 'your_data_attribute' => "your_data", ]); Why HelperForm doesn't support custom attributes? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now