public function buildForm(FormBuilderInterface $builder, array $options) { $type_view = ZkUserBundle::getContainer()->getParameter('type_view'); $builder->add('module', 'choice', array('choices' => $type_view, 'label' => 'uv_module', 'translation_domain' => 'address', 'attr' => array('class' => 'span2')))->add('name', null, array('label' => 'uv_name', 'translation_domain' => 'address', 'attr' => array('class' => 'span2'))); $builder->add('save', 'submit', array('label' => 'Save', 'attr' => array('class' => 'btn btn-primary'))); if ($this->object->getId()) { $builder->get('module')->setDisabled(true); } }
public function __construct($thisGroup) { $this->thisGroup = $thisGroup; $container = ZkUserBundle::getContainer(); $this->currentUser = $container->get('security.context')->getToken()->getUser(); }
/** * getCurrentUser * */ public function getCurrentUser() { $container = ZkUserBundle::getContainer(); $this->currentUser = $container->get('security.context')->getToken()->getUser(); }