本文整理汇总了PHP中Zend\Form\Fieldset::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Fieldset::__construct方法的具体用法?PHP Fieldset::__construct怎么用?PHP Fieldset::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\Fieldset
的用法示例。
在下文中一共展示了Fieldset::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(EntityManager $entityManager)
{
parent::__construct('category');
$this->entityManager = $entityManager;
$this->setHydrator(new DoctrineHydrator($entityManager, 'Blog\\Entity\\Category'));
$this->add(array('name' => 'label', 'type' => 'Text', 'options' => array('label' => 'Nom de la catégorie')));
}
示例2: __construct
public function __construct()
{
parent::__construct('ProductVariantFieldset');
$this->setHydrator(new ClassMethodsHydrator(false))->setObject(new Category());
$this->setLabel('Product Variant');
$this->add(array('type' => 'Zend\\Form\\Element\\Select', 'name' => 'variant', 'attributes' => array('class' => 'form-control form-element'), 'options' => array('label' => 'Product Variant', 'label_attributes' => array('class' => 'media-object'))));
}
示例3: __construct
public function __construct($academicperiodid, \Doctrine\ORM\EntityManager $em = null, $classid = null, $classmodule = null)
{
$this->em = $em;
$this->classid = $classid;
$this->academicperiodid = $academicperiodid;
parent::__construct('Classmodule');
$this->setHydrator(new ClassMethodsHydrator(false))->setObject(new Classmodule());
if ($classmodule == NULL) {
$this->add(array('name' => 'fkModuleid', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => 'form-control', 'id' => 'fkModuleid'), 'options' => array('label' => 'Module:*', 'value_options' => $this->getAvailableModules(), 'empty_option' => "--Select module--")));
} else {
$this->add(array('name' => 'fkModuleid', 'type' => 'Hidden'));
}
/*
* Configure examweight field to form
*/
$this->add(array('name' => 'exweight', 'type' => 'Zend\\Form\\Element\\Number', 'attributes' => array('class' => 'form-control', 'id' => 'exweight'), 'options' => array('label' => 'Exam weight*:')));
/*
* Configure id field to form
*/
$this->add(array('name' => 'pkClassmoduleid', 'type' => 'hidden'));
/*
* Configure academic period
*/
$this->add(array('name' => 'fkAcademicperiod', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('class' => 'form-control', 'id' => 'fkAcademicperiod'), 'options' => array('label' => 'Semester:*', 'value_options' => $this->getSemesters(), 'empty_option' => "--Select semester--")));
/*
* Configure examweight field to form
*/
$this->add(array('name' => 'cwkweight', 'type' => 'Zend\\Form\\Element\\Number', 'attributes' => array('class' => 'form-control', 'id' => 'cwkweight'), 'options' => array('label' => 'Course work weight:*')));
$this->add(array('name' => 'fkClassid', 'type' => 'hidden'));
$this->add(array('type' => 'Zend\\Form\\Element\\Radio', 'name' => 'isCore', 'options' => array('label' => 'Is core:*', 'value_options' => array("1" => "Yes", "0" => "No"))));
$this->add(array('type' => 'Zend\\Form\\Element\\Radio', 'name' => 'isProject', 'options' => array('label' => 'Is project:*', 'value_options' => array("1" => "Yes", "0" => "No"))));
}
示例4: __construct
public function __construct()
{
// we want to ignore the name passed
parent::__construct('navigation_page_params');
$this->add(array('name' => 'param_name', 'attributes' => array('type' => 'text', 'placeholder' => 'Name', 'id' => 'param_name'), 'options' => array('label' => 'Name')));
$this->add(array('name' => 'param_value', 'attributes' => array('type' => 'text', 'placeholder' => 'Value', 'id' => 'param_value'), 'options' => array('label' => 'Value')));
}
示例5: __construct
public function __construct()
{
parent::__construct('category');
$this->setHydrator(new ArraySerializableHydrator())->setObject(new Category());
$this->setLabel('Category');
$this->add(array('name' => 'name', 'options' => array('label' => 'Name of the category'), 'attributes' => array()));
}
示例6: __construct
public function __construct($name = null, $options = array())
{
parent::__construct('tJurisdictionProduct', $options);
/*if (null === $this->em) {
var_dump('hid');
$this->em = $this->getFormFactory()->getFormElementManager()->getServiceLocator();//->get('doctrine.entitymanager.orm_default');
}
var_dump($this->em);
exit;*/
$this->setHydrator(new ClassMethodsHydrator(false))->setObject(new JurProductCustom());
for ($x = 1; $x <= 3; $x++) {
$this->setLabel('CA');
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'eSubmissionDate' . $x, 'options' => array('label' => 'Submission (Estimated)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'eApprovalDate' . $x, 'options' => array('label' => 'Approval (Estimated)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'eReleaseDate' . $x, 'options' => array('label' => 'Master Release (Estimated)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'eLaunchDate' . $x, 'options' => array('label' => 'Launch (Estimated)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'eRegulatorDate' . $x, 'options' => array('label' => 'Regulator (Estimated)')));
// result
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'rSubmissionDate' . $x, 'options' => array('label' => 'Submission (Result)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'rApprovalDate' . $x, 'options' => array('label' => 'Approval (Result)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'rReleaseDate' . $x, 'options' => array('label' => 'Master Release (Result)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'rLaunchDate' . $x, 'options' => array('label' => 'Launch (Result)')));
$this->add(array('type' => 'Zend\\Form\\Element\\Date', 'name' => 'rRegulatorDate' . $x, 'options' => array('label' => 'Regulator (Result)')));
}
}
示例7: __construct
public function __construct()
{
parent::__construct('product');
$this->add(array('name' => 'id', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Product-ID:')));
$this->add(array('name' => 'name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Product name')));
$this->add(array('name' => 'stock', 'attributes' => array('type' => 'number'), 'options' => array('label' => '# number')));
}
示例8: __construct
public function __construct()
{
parent::__construct('product');
$this->add(array('name' => 'productId', 'type' => 'Zend\\Form\\Element\\Text', 'options' => array('label' => 'ID товара:')));
$this->add(array('name' => 'name', 'type' => 'Zend\\Form\\Element\\Text', 'options' => array('label' => 'Название товара:')));
$this->add(array('name' => 'stock', 'type' => 'Zend\\Form\\Element\\Number', 'attributes' => array('step' => 1, 'min' => 0), 'options' => array('label' => 'Количество:')));
}
示例9: __construct
public function __construct(ObjectManager $obj, $questionType = ExamQuestion::QUESTION_TYPE_CLOSED, $numberOfAnswers = self::DEFAULT_NUMBER_OF_ANSWERS, $name = null, $options = [])
{
parent::__construct($name, $options);
$this->questionType = $questionType;
$this->setHydrator(new DoctrineHydrator($obj))->setObject(new ExamQuestion());
$this->add(array('name' => 'examQuestionEnunciation', 'type' => 'textarea', 'attributes' => array('rows' => 15, 'id' => 'question-enunciation'), 'options' => array('label' => 'Enunciado')))->add(array('name' => 'examQuestionType', 'type' => 'select', 'options' => array('label' => 'Tipo de questão', 'value_options' => array(['value' => ExamQuestion::QUESTION_TYPE_CLOSED, 'label' => ExamQuestion::QUESTION_TYPE_CLOSED_DESC, 'selected' => $questionType === ExamQuestion::QUESTION_TYPE_CLOSED], ['value' => ExamQuestion::QUESTION_TYPE_OPEN, 'label' => ExamQuestion::QUESTION_TYPE_OPEN_DESC, 'selected' => $questionType === ExamQuestion::QUESTION_TYPE_OPEN])), 'attributes' => array('id' => 'question-type')))->add(array('name' => 'subject', 'type' => 'select', 'options' => array('label' => 'Disciplina', 'value_options' => $this->getSubjects($obj)), 'attributes' => array('id' => 'subject')))->add(array('name' => 'answerOptions', 'type' => 'Zend\\Form\\Element\\Collection', 'options' => array('count' => $numberOfAnswers, 'should_create_template' => true, 'allow_add' => true, 'allow_remove' => true, 'template_placeholder' => '__placeholder__', 'target_element' => new ExamAnswerFieldset($obj, 'exam-answer'))))->add(array('type' => 'Zend\\Form\\Element\\Radio', 'name' => 'correctAnswer', 'options' => array('label' => 'Resposta Correta', 'value_options' => self::generateAnswers($numberOfAnswers), 'disable_inarray_validator' => true, 'inline' => true)));
}
示例10: __construct
public function __construct(EntityManager $entityManager)
{
parent::__construct('filter-comment');
$this->entityManager = $entityManager;
$this->setHydrator(new DoctrineHydrator($entityManager, 'Blog\\Entity\\Comment'));
$this->add(array('type' => 'DoctrineModule\\Form\\Element\\ObjectSelect', 'name' => 'post', 'options' => array('object_manager' => $entityManager, 'label' => 'Article', 'target_class' => 'Blog\\Entity\\Post', 'display_empty_item' => true, 'empty_item_label' => '', 'property' => 'title', 'is_method' => true, 'find_method' => array('name' => 'getOpenOrderByTitle')), 'allow_empty' => true, 'required' => false, 'attributes' => array('id' => 'post-list', 'multiple' => false)));
}
示例11: __construct
public function __construct(ObjectManager $objectManager)
{
parent::__construct('section');
$this->setHydrator(new DoctrineHydrator($objectManager, 'Admin\\Entity\\Section'))->setObject(new Section());
$this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
$this->add(array('name' => 'name', 'attributes' => array('type' => 'text', 'placeholder' => 'Enter section name', 'class' => 'form-control', 'id' => 'name'), 'options' => array('label' => 'Name'), 'label_attributes' => array('class' => 'input')));
$this->add(array('name' => 'shortname', 'attributes' => array('type' => 'text', 'placeholder' => 'Short name', 'class' => 'form-control'), 'options' => array('label' => 'shortname'), 'label_attributes' => array('class' => 'input')));
//$objectManager->getRepository('OmniBlog\Form\CategoryPostAssociation')->findBy(array('post_id' => $this->po))
//$this->getEntityManager()->find('OmniBlog\Entity\Post', $id);
//DoctrineModule\Form\Element\ObjectMultiCheckbox $xmy = new \DoctrineModule\Form\Element\ObjectMultiCheckbox();
//$subjectFieldset = new SubjectFieldset($objectManager);
// $this->add(array(
// 'type' => 'DoctrineModule\Form\Element\ObjectMultiCheckbox',
// 'name' => 'subjects',
/// 'options' => array(
/// 'label' => 'Select Subjects',
// 'object_manager' => $objectManager,
// 'should_create_template' => true,
// 'target_class' => 'Admin\Entity\Subject',
/// 'property' => 'name',
// 'target_element' => $subjectFieldset,
// ),
// ));
$subjectFieldset = new SubjectFieldset($objectManager);
$this->add(array('type' => 'DoctrineModule\\Form\\Element\\ObjectMultiCheckbox', 'name' => 'subject', 'options' => array('label' => 'Select Subjects', 'object_manager' => $objectManager, 'should_create_template' => true, 'target_class' => 'Admin\\Entity\\Subject', 'property' => 'code', 'target_element' => $subjectFieldset), 'label_attributes' => array('class' => 'checkbox')));
}
示例12: __construct
public function __construct()
{
parent::__construct('productSelector');
$this->setHydrator(new \Zend\Stdlib\Hydrator\Reflection());
$this->setObject(new \ZfDeals\Entity\Product());
$this->add(array('name' => 'id', 'type' => 'Zend\\Form\\Element\\Select', 'options' => array('label' => 'Produkt-ID:', 'value_options' => array('1' => 'Label 1', '2' => 'Label 2'))));
}
示例13: __construct
/**
* @param EntityManager $entityManager
* @param Entity\EntityAbstract $object
*/
public function __construct(EntityManager $entityManager, Entity\EntityAbstract $object)
{
parent::__construct($object->get('underscore_entity_name'));
$doctrineHydrator = new DoctrineHydrator($entityManager);
$this->setHydrator($doctrineHydrator)->setObject($object);
$builder = new AnnotationBuilder();
/**
* Go over the different form elements and add them to the form
*/
foreach ($builder->createForm($object)->getElements() as $element) {
/**
* Go over each element to add the objectManager to the EntitySelect
*/
if ($element instanceof EntitySelect || $element instanceof EntityMultiCheckbox) {
$element->setOptions(array_merge_recursive($element->getOptions(), ['object_manager' => $entityManager]));
}
if ($element instanceof Radio) {
$attributes = $element->getAttributes();
$valueOptionsArray = 'get' . ucfirst($attributes['array']);
$element->setOptions(array_merge_recursive($element->getOptions(), ['value_options' => $object->{$valueOptionsArray}()]));
}
//Add only when a type is provided
if (array_key_exists('type', $element->getAttributes())) {
$this->add($element);
}
}
$this->add(['type' => '\\Zend\\Form\\Element\\Select', 'name' => 'organisation', 'options' => ['disable_inarray_validator' => true, "label" => _("txt-organisation"), "help-block" => _("txt-organisation-help-block")]]);
$this->add(['type' => '\\Zend\\Form\\Element\\Text', 'name' => 'branch', 'options' => ["label" => _("txt-branch"), "help-block" => _("txt-branch-help-block")]]);
}
示例14: __construct
public function __construct($name = "", $options = array())
{
if ($name == "") {
$name = 'UserProfileFieldset';
}
parent::__construct($name, $options);
}
示例15: __construct
public function __construct()
{
parent::__construct('content');
$this->setHydrator(new ClassMethodsHydrator(false))->setObject(new CategoryContent());
$this->add(array('name' => 'alias', 'options' => array('label' => 'Alias'), 'attributes' => array('maxlength' => $this->maxAliasLength)));
$this->add(array('name' => 'title', 'options' => array('label' => 'Name'), 'attributes' => array('maxlength' => $this->maxTitleLength)));
}