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


PHP Form::addGroup方法代码示例

本文整理汇总了PHP中Venne\Forms\Form::addGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addGroup方法的具体用法?PHP Form::addGroup怎么用?PHP Form::addGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Venne\Forms\Form的用法示例。


在下文中一共展示了Form::addGroup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configure

 public function configure(Form $form)
 {
     $_this = $this;
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $route->setCurrentGroup($group);
     $form->addText('name', 'Name');
     $form->addText('price', 'Price')->setDefaultValue(0)->addCondition($form::FILLED)->addRule($form::FLOAT);
     $form->addText('rrp', 'RRP')->addCondition($form::FILLED)->addRule($form::FLOAT);
     $route->addTextArea('notation', 'Description');
     $route->addFileEntityInput('photo', 'Image');
     $form->addText('inStock', 'In stock')->addCondition($form::FILLED)->addRule($form::FLOAT);
     $form->addGroup('');
     $form->addManyToOne('category', 'Main category');
     $form->addManyToMany('categories', 'Next categories');
     $form->addGroup();
     $form->addManyToMany('labels', 'Labels');
     $tags = $form->addContainer('tags');
     $tags->setCurrentGroup($group = $form->addGroup());
     $form->addGroup('Types');
     $form->addTags('typesAsArray', 'Types')->setSuggestCallback(function () use($_this, $form) {
         $ret = array();
         foreach ($_this->getTagsFromCategories($form) as $tag) {
             $ret[$tag] = $tag;
         }
         return $ret;
     })->setDelimiter('[;]+')->setJoiner(';');
     $form->addGroup();
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:catalog-module,代码行数:30,代码来源:ProductFormFactory.php

示例2: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $group = $form->addGroup('Registration');
     $userTypes = array();
     foreach ($this->securityManager->getUserTypes() as $name => $val) {
         $userTypes[$name] = $val->getName();
     }
     $registrations = $form->addDynamic('registrations', function (Container $registration) use($form, $group, $userTypes) {
         $group = $form->addGroup('Registration');
         $registration->setCurrentGroup($group);
         $registration->addCheckbox('enabled', 'Enabled')->addCondition($form::EQUAL, TRUE)->toggle('reg-' . $registration->name);
         $registration->setCurrentGroup($registration->form->addGroup()->setOption('id', 'reg-' . $registration->name));
         $registration->addText('name', 'Name');
         $registration->addSelect('userType', 'Type', $userTypes);
         $registration->addSelect('mode', 'Mode', PageEntity::getModes())->addCondition($form::IS_IN, array(PageEntity::MODE_MAIL, PageEntity::MODE_MAIL_CHECKUP))->toggle('email-' . $registration->name);
         $registration->addSelect('loginProviderMode', 'Login provider mode', PageEntity::getSocialModes());
         $registration->addMultiSelect('roles', 'Roles', $this->getRoles());
         $email = $registration->addContainer('email');
         $email->setCurrentGroup($form->addGroup()->setOption('id', 'email-' . $registration->name));
         $email->addText('subject', 'Subject');
         $email->addText('sender', 'Sender');
         $email->addText('from', 'From');
         $email->addTextArea('text', 'Text');
         $registration->addSubmit('_remove', 'Remove')->addRemoveOnClick();
     }, 1);
     $registrations->setCurrentGroup($group);
     $registrations->addSubmit('_add', 'Add')->addCreateOnClick();
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:33,代码来源:SystemRegistrationFormFactory.php

示例3: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Person');
     $form->addSelect('type', 'Person', PersonEntity::getTypes());
     $form->addText('name', 'Name');
     $form->addFileEntityInput('logo', 'Logo');
     $form->addManyToMany('users', 'Users');
     $form->addTextArea('description', 'Description');
     $form->addGroup('Address');
     $form->addText('street', 'Street');
     $form->addText('number', 'Number');
     $form->addText('city', 'City');
     $form->addText('zip', 'ZIP');
     $form->addGroup('Contacts');
     $form->addText('email', 'Email')->addCondition($form::FILLED)->addRule($form::EMAIL);
     $form->addText('phone', 'Phone');
     $form->addText('fax', 'Fax');
     $form->addText('website', 'Website')->addCondition($form::FILLED)->addRule($form::URL);
     $form->addGroup('Billing information');
     $form->addText('identificationNumber', 'IN');
     $form->addText('taxIdentificationNumber', 'TIN');
     $form->addText('registration', 'Registration');
     $form->addCheckbox('taxpayer', 'Taxpayer');
     $form->addFileEntityInput('signature', 'Signature');
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:29,代码来源:PersonFormFactory.php

示例4: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $container = $form->addContainer('_inputs');
     $container->setCurrentGroup($form->addGroup());
     $container->addText('_email', 'E-mail')->addRule($form::EMAIL)->setRequired(true);
     $container->addText('_name', 'Name')->setRequired(true);
     foreach ($form->data->inputs as $key => $input) {
         if ($input->getType() === InputEntity::TYPE_GROUP) {
             $container->setCurrentGroup($form->addGroup($input->getLabel()));
             continue;
         }
         $control = $container->add($input->getType(), 'input_' . $key, $input->getLabel());
         if ($input->required) {
             $control->setRequired(true);
         }
         if (in_array($input->getType(), array(InputEntity::TYPE_SELECT, InputEntity::TYPE_CHECKBOX_LIST, InputEntity::TYPE_RADIO_LIST))) {
             $items = array();
             foreach ($input->getItems() as $item) {
                 $items[$item] = $item;
             }
             $control->setItems($items);
         }
     }
     $form->addGroup();
     $form->addSaveButton('Send');
 }
开发者ID:svobodni,项目名称:web,代码行数:29,代码来源:MailformfrontFormFactory.php

示例5: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $entity = $form->data;
     $form->addGroup('Supplier');
     $form->addManyToOne('supplier', 'person')->addRule($form::FILLED);
     $form->addGroup('Customer');
     $form->addManyToOne('customer', 'person')->addRule($form::FILLED);
     $form->addGroup('Billing information');
     $form->addText('identification', 'Identification');
     $form->addText('amount', 'Amount')->addRule($form::FILLED)->addRule($form::FLOAT);
     $form->addManyToOne('payment', 'Payment');
     $form->addSelect('type', 'Type')->setItems(InvoiceEntity::getTypes());
     $form->addSelect('state', 'State')->setItems(InvoiceEntity::getStates());
     $form->addText('constantSymbol', 'Constant sb.');
     $form->addText('variableSymbol', 'Variable sb.');
     $form->addText('specificSymbol', 'Specific sb.');
     $group = $form->addGroup('Items');
     $recipients = $form->addMany('items', function (Container $container) use($group, $form) {
         $container->setCurrentGroup($group);
         $container->addText('name', 'Name')->addRule($form::FILLED);
         $container->addText('unitValue', 'Unit value')->addRule($form::FILLED)->addRule($form::FLOAT);
         $container->addText('units', 'Units')->addRule($form::FILLED)->addRule($form::INTEGER);
         $container->addText('qUnit', 'Quantity unit')->addRule($form::FILLED);
         $container->addText('tax', 'Tax')->addRule($form::FLOAT);
         $container->addCheckbox('unitValueIsTaxed', 'Value is taxed');
         $container->addSubmit('remove', 'Remove')->addRemoveOnClick();
     }, function () use($entity) {
         return new ItemEntity($entity);
     });
     $recipients->setCurrentGroup($group);
     $recipients->addSubmit('add', 'Add item')->addCreateOnClick();
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:invoices-module,代码行数:37,代码来源:InvoiceFormFactory.php

示例6: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addText('itemsPerPage', 'Items per page');
     $form->addText('messageMaxLength', 'Message max length')->addCondition($form::FILLED)->addRule($form::NUMERIC);
     $form->addGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:11,代码来源:PageFormFactory.php

示例7: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Content');
     $form->addCheckbox('autoThumbnails', 'Auto thumbnails')->setDefaultValue(TRUE)->addCondition($form::EQUAL, TRUE)->toggle('form-lightbox');
     $form->addGroup()->setOption('id', 'form-lightbox');
     $form->addCheckbox('autoLightbox', 'Auto lightbox')->setDefaultValue(TRUE);
     $form->addGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:12,代码来源:ContentFormFactory.php

示例8: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Options');
     $form->addRadioList('section', 'Section', array('all' => 'All', 'namespace' => 'Namespace', 'sessions' => 'Sessions'))->setDefaultValue('all')->addCondition($form::EQUAL, 'namespace')->toggle('namespace');
     $form->addGroup('Namespace')->setOption('id', 'namespace');
     $form->addText('namespace');
     $form->setCurrentGroup();
     $form->addSaveButton('Clear');
 }
开发者ID:svobodni,项目名称:web,代码行数:12,代码来源:CacheFormFactory.php

示例9: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Options');
     $form->addManyToOne('newsletter', 'Newsletter')->setOrderBy(array('created' => 'DESC'))->setPrompt(NULL);
     $form->addCheckbox('allUsers', 'Send to all')->addCondition($form::EQUAL, FALSE)->toggle('form-users');
     $form->addGroup()->setOption('id', 'form-users');
     $form->addManyToMany('users', 'Users');
     $form->addGroup();
     $form->addSaveButton('Odeslat newsletter');
 }
开发者ID:venne,项目名称:newsletter-module,代码行数:13,代码来源:MessageFormFactory.php

示例10: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addText('itemsPerPage', 'Items per page');
     $form->addGroup('Notation');
     $form->addCheckbox('notationInHtml', 'In HTML format');
     $form->addCheckbox('autoNotation', 'Auto generate')->addCondition($form::EQUAL, true)->toggle('notationLength');
     $form->addGroup()->setOption('id', 'notationLength');
     $form->addText('notationLength', 'Length')->addRule($form::INTEGER);
     $form->addGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:15,代码来源:PageFormFactory.php

示例11: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $route->setCurrentGroup($group);
     $route->addTextArea('notation', 'Notation');
     $form->addManyToOne('parent', 'Parent');
     $route->addFileEntityInput('photo', 'Photo');
     $form->addGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:15,代码来源:CategoryFormFactory.php

示例12: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup();
     $form->addText('itemsPerPage', 'Items per page');
     $form->addManyToMany('pages', 'Pages');
     $form->addManyToMany('categories', 'Categories');
     $form->addGroup('Dimensions');
     $form->addText('width', 'Width')->addCondition($form::FILLED)->addRule($form::INTEGER);
     $form->addText('height', 'Height')->addCondition($form::FILLED)->addRule($form::INTEGER);
     $form->addGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:15,代码来源:SliderFormFactory.php

示例13: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     $user = $form->addOne('user');
     $user->addMany('loginProviders', function (\Venne\Forms\Container $container) use($form) {
         $container->setCurrentGroup($form->addGroup($container->data->type));
         $container->addSelect('type', 'Type')->setItems($this->securityManager->getLoginProviders(), false);
         $container->addText('uid', 'UID');
         $container->addSubmit('remove', 'Remove')->addRemoveOnClick();
     });
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:16,代码来源:UserSocialFormFactory.php

示例14: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     /* containers */
     $nette = $form->addContainer('nette');
     $venne = $form->addContainer('venne');
     $doctrine = $form->addContainer('doctrine');
     /** @var $debugger \Nette\Forms\Container */
     $debugger = $nette->addContainer('debugger');
     $application = $nette->addContainer('application');
     $routing = $nette->addContainer('routing');
     $container = $nette->addContainer('container');
     $security = $nette->addContainer('security');
     /* application */
     $application->setCurrentGroup($form->addGroup('Application'));
     $application->addSelect('catchExceptions', 'Catch exceptions', array(TRUE => 'yes', FALSE => 'no'))->setDefaultValue(TRUE);
     /* session */
     $session = $venne->addContainer('session');
     $session->setCurrentGroup($form->addGroup('Session'));
     $session->addTextWithSelect('savePath', 'Save path')->setItems(array('%tempDir%/sessions' => '%tempDir%/sessions'));
     /* debugger */
     $debugger->setCurrentGroup($group = $form->addGroup('Debugger'));
     $debugger->addSelect('strictMode', 'Strict mode')->setItems(array(TRUE => 'yes', FALSE => 'no'));
     $debugger->addText('edit', 'Editor');
     $debugger->addText('browser', 'Browser');
     $debugger->addText('email', 'E-mail for logs')->addCondition($form::FILLED)->addRule($form::EMAIL);
     $application->setCurrentGroup($group);
     $application->addCheckbox('debugger', 'Debugger panel in bluescreen')->setDefaultValue(TRUE);
     $routing->setCurrentGroup($group);
     $routing->addCheckbox('debugger', 'Routing panel')->setDefaultValue(TRUE);
     $container->setCurrentGroup($group);
     $container->addCheckbox('debugger', 'DI panel')->setDefaultValue(TRUE);
     $security->setCurrentGroup($group);
     $security->addCheckbox('debugger', 'Security panel')->setDefaultValue(TRUE);
     $doctrine->setCurrentGroup($group);
     $doctrine->addCheckbox('debugger', 'Database panel')->setDefaultValue(TRUE);
     /* session */
     $container = $nette->addContainer('session');
     $container->setCurrentGroup($form->addGroup('Sessions'));
     $container->addCheckbox('autoStart', 'Autostart')->setDefaultValue(FALSE);
     $container->addText('expiration', 'Expiration');
     //->setItems(array('+ 1 day', '+ 10 days', '+ 30 days', '+ 1 year'), false);
     $container->addText('cookiePath', 'Cookie path')->setDefaultValue('/');
     $container->addText('cookieDomain', 'Cookie domain');
     /* templating */
     $nette->setCurrentGroup($form->addGroup('Templating'));
     $nette->addSelect('xhtml', 'XHTML', array(TRUE => 'yes', FALSE => 'no'))->setDefaultValue(TRUE);
     $doctrine->setCurrentGroup($form->addGroup('Doctrine'));
     $doctrine->addSelect('cacheClass', 'Cache type', DoctrineExtension::getCaches());
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:54,代码来源:SystemApplicationFormFactory.php

示例15: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Redirection');
     $form->addRadioList('type', 'Type', array('page' => 'Page', 'url' => 'URL'));
     $form['type']->addCondition($form::EQUAL, 'page')->toggle('page');
     $form['type']->addCondition($form::EQUAL, 'url')->toggle('url');
     $form['type']->getControlPrototype()->onClick = 'if( $(this).val() == "page" ) { $("#url").find("input").val("") } else ( $("#page").find("select").val("") );';
     $form->addGroup()->setOption('id', 'url');
     $form->addText('redirectUrl', 'URL');
     $form->addGroup()->setOption('id', 'page');
     $form->addManyToOne('redirect', 'Page');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:17,代码来源:RedirectFormFactory.php


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