Author Topic: Put the html form select option etc on tpl file  (Read 4477 times)

yonghan

  • Guest
Put the html form select option etc on tpl file
« 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.

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Put the html form select option etc on tpl file
« Reply #1 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', ....))
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

yonghan

  • Guest
Re: Put the html form select option etc on tpl file
« Reply #2 on: July 08, 2014, 01:53:09 PM »
Thanks a lot,i'll try it.

 

Powered by SMFPacks Social Login Mod