当前位置: 首页>>代码示例>>PHP>>正文


PHP Fieldset::__construct方法代码示例

本文整理汇总了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')));
 }
开发者ID:WafaSara,项目名称:blog-project,代码行数:7,代码来源:CategoryFieldset.php

示例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'))));
 }
开发者ID:odegroot,项目名称:ers,代码行数:7,代码来源:ProductVariantFieldset.php

示例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"))));
 }
开发者ID:bantudevelopment,项目名称:polysmis,代码行数:32,代码来源:FsClassmodule.php

示例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')));
 }
开发者ID:ngen,项目名称:zf2navigation,代码行数:7,代码来源:NavigationPageParamsFieldset.php

示例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()));
 }
开发者ID:rlandas,项目名称:zf2-zendformcollections,代码行数:7,代码来源:CategoryFieldset.php

示例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)')));
     }
 }
开发者ID:jonathan1212,项目名称:zend-tutorial,代码行数:26,代码来源:TJurisdictionProductFieldset.php

示例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')));
 }
开发者ID:edorosh,项目名称:ZfDealsApp,代码行数:7,代码来源:ProductFieldset.php

示例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' => 'Количество:')));
 }
开发者ID:khusamov,项目名称:leading,代码行数:7,代码来源:ProductFieldset.php

示例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)));
 }
开发者ID:CATSInformatica,项目名称:CatsSys,代码行数:7,代码来源:ExamQuestionFieldset.php

示例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)));
 }
开发者ID:WafaSara,项目名称:blog-project,代码行数:7,代码来源:CommentFilterFieldset.php

示例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')));
 }
开发者ID:Primetron,项目名称:Edusoft,代码行数:26,代码来源:SectionFieldset.php

示例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'))));
 }
开发者ID:khusamov,项目名称:leading,代码行数:7,代码来源:ProductSelectorFieldset.php

示例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")]]);
 }
开发者ID:iteaoffice,项目名称:contact,代码行数:33,代码来源:ContactFieldset.php

示例14: __construct

 public function __construct($name = "", $options = array())
 {
     if ($name == "") {
         $name = 'UserProfileFieldset';
     }
     parent::__construct($name, $options);
 }
开发者ID:xelax90,项目名称:skeleton-module,代码行数:7,代码来源:UserProfileFieldset.php

示例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)));
 }
开发者ID:veniva,项目名称:zcms,代码行数:7,代码来源:CategoryContentFieldset.php


注:本文中的Zend\Form\Fieldset::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。