Symfony: using $this->widgetSchema->setFormFormatterName('list')

自古美人都是妖i 提交于 2019-12-23 05:25:25

问题


im using $this->widgetSchema->setFormFormatterName('list'); this way below to render my form as a list but it is still a table. Any idea?

public function configure()
  {

            parent::configure();

            $this->widgetSchema->setFormFormatterName('list');

  }

}

Any idea?

Javi


回答1:


to apply a formatter to all the forms use the following line in the setup() of your config\ProjectConfiguration.class.php

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    sfWidgetFormSchema::setDefaultFormFormatterName('list');
  }

}


来源:https://stackoverflow.com/questions/2808288/symfony-using-this-widgetschema-setformformatternamelist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!