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


PHP Form::addSelect方法代码示例

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


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

示例1: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Basic settings');
     $form->addSelect('driver', 'Driver')->setItems($this->drivers, false)->setDefaultValue('pdo_mysql');
     $form['driver']->addCondition($form::IS_IN, array('pdo_mysql', 'oci8', 'pdo_oci'))->toggle('group-charset');
     $form['driver']->addCondition($form::IS_IN, array('pdo_pgsql', 'pdo_mysql', 'oci8', 'pdo_oci', 'pdo_sqlsrv'))->toggle('group-connection');
     $form['driver']->addCondition($form::EQUAL, 'pdo_sqlite')->toggle('group-sqlite');
     $form->addGroup('Connection settings');
     $form->addText('user', 'Username');
     $form->addPassword('password', 'Password');
     $form->addGroup()->setOption('id', 'group-connection');
     $form->addText('host', 'Host');
     $form->addText('port', 'Port')->getControlPrototype()->placeholder[] = 'default';
     $form->addText('dbname', 'Database');
     $form->addGroup()->setOption('id', 'group-sqlite');
     $form->addTextWithSelect('path', 'Path')->setItems(array('%tempDir%/database.db'), false);
     $form->addCheckbox('memory', 'Db in memory');
     $form->addGroup()->setOption('id', 'group-charset');
     $form->addTextWithSelect('charset', 'Charset')->setItems(array('utf8'), false);
     $backups = $this->getBackups();
     if (count($backups)) {
         $form->addGroup('Restore from backup');
         $form->addSelect('_backup', 'Backup name', $backups)->setPrompt('--------');
     }
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:30,代码来源:SystemDatabaseFormFactory.php

示例2: 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

示例3: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup();
     $form->addText('name', 'Name');
     $form->addText('localUrl', 'URL');
     $form->addText('title', 'Title');
     $form->addText('keywords', 'Keywords');
     $form->addText('description', 'Description');
     $form->addManyToOne('author', 'Author');
     $form->addSelect('robots', 'Robots')->setItems(RouteEntity::getRobotsValues(), FALSE);
     $form->addSelect('changefreq', 'Change frequency')->setItems(RouteEntity::getChangefreqValues(), FALSE)->setPrompt('-------');
     $form->addSelect('priority', 'Priority')->setItems(RouteEntity::getPriorityValues(), FALSE)->setPrompt('-------');
     // layout
     $form->setCurrentGroup($form->addGroup());
     $form->addCheckbox('copyLayoutFromParent', 'Layout from parent');
     $form['copyLayoutFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-layout_' . $form->data->id);
     $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout_' . $form->data->id));
     $form->addManyToOne('layout', 'Layout');
     $form->setCurrentGroup($form->addGroup());
     $form->addCheckbox('copyLayoutToChildren', 'Share layout with children');
     $form['copyLayoutToChildren']->addCondition($form::EQUAL, FALSE)->toggle('group-layout2_' . $form->data->id);
     $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout2_' . $form->data->id));
     $form->addManyToOne('childrenLayout', 'Share new layout');
     // cache
     $form->setCurrentGroup($form->addGroup());
     $form->addCheckbox('copyCacheModeFromParent', 'Cache mode from parent');
     $form['copyCacheModeFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-cache_' . $form->data->id);
     $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-cache_' . $form->data->id));
     $form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off');
     $form->setCurrentGroup($form->addGroup());
     $form->addFileEntityInput('photo', 'Photo');
     $form->addTextArea('notation', 'Notation');
     $form->addTextArea('text', 'Text');
     $form->addGroup('Dates');
     $form->addDateTime('created', 'Created')->setDisabled(TRUE);
     $form->addDateTime('updated', 'Updated')->setDisabled(TRUE);
     $form->addDateTime('released', 'Released')->addRule($form::FILLED);
     $form->addDateTime('expired', 'Expired');
     $form->addGroup('Tags');
     $form->addContentTags('tags');
     $aliases = $form->addMany('aliases', function (\Venne\Forms\Container $container) use($form) {
         $container->setCurrentGroup($form->addGroup('URL alias'));
         $container->addText('aliasUrl', 'Url')->setRequired();
         $container->addText('aliasLang', 'Language alias');
         $container->addText('aliasDomain', 'Domain url');
         $container->addSubmit('remove', 'Remove alias')->addRemoveOnClick();
     });
     $aliases->addSubmit('add', 'Add alias')->addCreateOnClick();
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:54,代码来源:RouteFormFactory.php

示例4: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     $form->addSelect('type', 'Type')->setItems(array('presenter', 'component'), FALSE)->addCondition($form::EQUAL, 'presenter')->toggle($form->name . '-presenter')->endCondition()->addCondition($form::EQUAL, 'component')->toggle($form->name . '-component');
     $form->addGroup()->setOption('id', $form->name . '-presenter');
     $form->addSelect('presenter', 'Presenter');
     $form->addGroup()->setOption('id', $form->name . '-component');
     $form->addSelect('component', 'Component');
     $form->addGroup('Target');
     $form->addSelect('target', 'Target module')->setTranslator(NULL)->setItems(array_keys($this->modules), FALSE)->getControlPrototype()->onChange = 'this.form.submit();';
     $form->addSelect('layout', 'Target layout');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:17,代码来源:OverloadFormFactory.php

示例5: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     $form->addSelect('target', 'Target module')->setTranslator(NULL)->setItems(array_keys($this->modules), FALSE);
     $form->addSelect('type', 'Type', $this->types)->addCondition($form::EQUAL, self::TYPE_LAYOUT)->toggle('form-layout')->endCondition()->addCondition($form::EQUAL, self::TYPE_TEMPLATE)->toggle('form-template');
     $form->addGroup()->setOption('id', 'form-layout');
     $form->addText('layoutName', 'Layout');
     $form->addGroup()->setOption('id', 'form-template');
     $form->addSelect('layout', 'Layout');
     $form->addText('template', 'Template');
     $form->addGroup('Template')->setOption('class', 'full');
     $form->addCode('text', NULL, NULL, 30)->getControlPrototype()->attrs['class'] = 'input-block-level';
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:18,代码来源:LayouteditFormFactory.php

示例6: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addSelect('mode', 'Registration mode', PageEntity::getModes())->addCondition($form::IS_IN, array(PageEntity::MODE_MAIL, PageEntity::MODE_MAIL_CHECKUP))->toggle('form-group-email');
     $form->addSelect('socialMode', 'Login provider mode', PageEntity::getSocialModes());
     $form->addSelect('userType', 'User type', $this->getUserTypes());
     $form->addManyToMany('roles', 'Roles for new user');
     $form->addGroup('E-mail')->setOption('id', 'form-group-email');
     $form->addText('mailFrom', 'From')->addConditionOn($form['mode'], $form::IS_IN, array(PageEntity::MODE_MAIL, PageEntity::MODE_MAIL_CHECKUP))->addRule($form::EMAIL);
     $form->addText('sender', 'Sender');
     $form->addText('subject', 'Subject');
     $form->addEditor('email', 'E-mail body');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:18,代码来源:RegistrationFormFactory.php

示例7: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('appId', 'App ID');
     $form->addText('secret', 'Secret');
     $form->addSelect('cookie', 'Use cookie', array(TRUE => 'yes', FALSE => 'no'));
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:social-module,代码行数:10,代码来源:SocialFormFactory.php

示例8: 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

示例9: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addText('name', 'Name');
     $form->addSelect('file', 'File')->setItems($this->templateManager->getLayouts());
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:LayoutFormFactory.php

示例10: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Authentication');
     $form->addSelect('autologin', 'Auto login')->setItems($this->securityManager->getLoginProviders(), FALSE)->setPrompt('Deactivated')->addCondition($form::EQUAL, '')->elseCondition()->toggle('form-autoregistration');
     $form->addGroup()->setOption('id', 'form-autoregistration');
     $form->addSelect('autoregistration', 'Auto registration')->setPrompt('Deactivated')->setItems(array_keys($this->registrations), FALSE);
     $forgotPassword = $form->addContainer('forgotPassword');
     $forgotPassword->setCurrentGroup($form->addGroup('Forgot password'));
     $enabled = $forgotPassword->addCheckbox('enabled', 'Enabled');
     $enabled->addCondition($form::EQUAL, TRUE)->toggle('form-reset');
     $forgotPassword->setCurrentGroup($form->addGroup()->setOption('id', 'form-reset'));
     $forgotPassword->addText('emailSubject', 'Subject')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED);
     $forgotPassword->addText('emailSender', 'Sender')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED);
     $forgotPassword->addText('emailFrom', 'From')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED)->addRule($form::EMAIL);
     $forgotPassword->addTextArea('emailText', 'Text')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:21,代码来源:SystemAuthenticationFormFactory.php

示例11: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('name', 'Name');
     $form->addManyToOne('account', 'Account')->addRule($form::FILLED);
     $form->addText('identificationFormat', 'ID format')->addRule($form::FILLED);
     $form->addSelect('identificationInterval', 'ID interval', AccountEntity::getIntervals())->addRule($form::FILLED);
     $form->addText('due', 'Invoice due')->addRule($form::FILLED)->addRule($form::INTEGER);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:invoices-module,代码行数:13,代码来源:AccountFormFactory.php

示例12: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup('Global meta informations');
     $form->addText('name', 'Website name')->addRule($form::FILLED);
     $form->addText('title', 'Title')->setOption('description', '(%n - name, %s - separator, %t - local title)');
     $form->addText('titleSeparator', 'Title separator');
     $form->addText('keywords', 'Keywords');
     $form->addText('description', 'Description');
     $form->addText('author', 'Author');
     $form->addGroup('System');
     $form->addTextWithSelect('routePrefix', 'Route prefix');
     $form->addTextWithSelect('oneWayRoutePrefix', 'One way route prefix');
     $form->addSelect('theme', 'Module width theme', $this->getModules())->setPrompt('off');
     $form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off');
     $form['cacheMode']->addCondition($form::EQUAL, 'time')->toggle('cacheValue');
     $form->addGroup()->setOption('id', 'cacheValue');
     $form->addSelect('cacheValue', 'Minutes')->setItems(array(1, 2, 5, 10, 15, 20, 30, 40, 50, 60, 90, 120), FALSE);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:23,代码来源:WebsiteFormFactory.php

示例13: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup();
     $langMode = $form->addSelect('langMode', 'Language mode', ElementEntity::getLangModes());
     $langMode->addCondition($form::EQUAL, ElementEntity::LANGMODE_SPLIT)->toggle('form-group-language');
     $form->setCurrentGroup($form->addGroup()->setOption('id', 'form-group-language'));
     $form->addManyToOne('language', 'Language')->addConditionOn($langMode, $form::EQUAL, ElementEntity::LANGMODE_SPLIT)->addRule($form::FILLED);
     $form->addGroup();
     $mode = $form->addSelect('mode', 'Share data with', ElementEntity::getModes());
     $mode->addCondition($form::IS_IN, array(1))->toggle('form-group-layout')->endCondition()->addCondition($form::IS_IN, array(2, 4))->toggle('form-group-page')->endCondition()->addCondition($form::EQUAL, 4)->toggle('form-group-route');
     $form->addGroup()->setOption('id', 'form-group-layout');
     $form->addManyToOne('layout', 'Layout')->addConditionOn($mode, $form::IS_IN, array(1))->addRule($form::FILLED);
     $form->addGroup()->setOption('id', 'form-group-page');
     $page = $form->addManyToOne('page', 'Page');
     $page->addConditionOn($mode, $form::IS_IN, array(2, 4))->addRule($form::FILLED);
     $form->addGroup()->setOption('id', 'form-group-route');
     $form->addManyToOne('route', 'Route')->setDependOn($page, 'page')->addConditionOn($mode, $form::EQUAL, 4)->addRule($form::FILLED);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:23,代码来源:BasicFormFactory.php

示例14: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup();
     $form->addFileEntityInput('image', 'Image');
     $form->addText('alt', 'Alt');
     if (!$form->data->hideWidth || !$form->data->hideHeight || !$form->data->hideFormat) {
         $form->addGroup('Size');
         if (!$form->data->hideWidth) {
             $form->addText('width', 'Width')->addCondition($form::FILLED)->addRule($form::INTEGER);
         }
         if (!$form->data->hideHeight) {
             $form->addText('height', 'Height')->addCondition($form::FILLED)->addRule($form::INTEGER);
         }
         if (!$form->data->hideFormat) {
             $form->addSelect('format', 'Format', array(0 => 'Fit', 1 => 'Shrink only', 2 => 'Stretch', 4 => 'Fill', 8 => 'Exact'));
         }
     }
     if (!$form->data->hideType) {
         $form->addSelect('type', 'Type', array('png' => 'PNG', 'jpeg' => 'JPEG', 'gif' => 'GIF'))->setPrompt('-- default --');
     }
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:26,代码来源:AbstractImageFormFactory.php

示例15: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $route = $form->addContainer('mainRoute');
     $group = $form->addGroup('Settings');
     $form->addText('name', 'Name')->addRule($form::FILLED);
     $route->setCurrentGroup($group);
     $route->addTextArea('notation', 'Notation');
     $form->addText('items', 'Items')->addRule($form::FILLED)->addRule($form::INTEGER);
     $form->addGroup('Target');
     $form->addSelect('class', 'Route type', $this->getClasses())->setPrompt('--------');
     $form->addManyToMany('targetPages', 'Target pages');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:17,代码来源:RssFormFactory.php


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