AbanteCart Community

AbanteCart Development => New Features Discussion => Topic started by: yonghan on June 22, 2014, 01:14:18 AM

Title: Put the html form select option etc on tpl file
Post by: yonghan on June 22, 2014, 01:14:18 AM
Hi,i would like to request to put the html select,input type component etc on the tpl file instead using html helper so that we can edit the styles directly without changing the controller.And the controller only pass the array,data etc instead of passing html component.Currently i saw that several input type was rendered via tpl file,several are rendered via controller.Thanks a lot.
Title: Re: Put the html form select option etc on tpl file
Post by: abolabo on July 08, 2014, 04:37:36 AM
first of all check type of your form field variable inside tpl. For ex you have button $form['button_cancel']. If this is object you can change it's style via property style: $form['button_cancel']->style = 'your css pseudoclass';

In case when you have string varible you can redefine button with Ahtml class inside tpl. For ex: $this->html->buildElement( array('type' => 'button', 'name' => 'your button name', ....))
Title: Re: Put the html form select option etc on tpl file
Post by: yonghan on July 08, 2014, 01:53:09 PM
Thanks a lot,i'll try it.