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


PHP Form::addManyToMany方法代码示例

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


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

示例1: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('itemsPerPage', 'Items per page');
     $form->addManyToMany('pages', 'Pages');
     $form->addManyToMany('categories', 'Categories');
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:BlogFormFactory.php

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

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

示例4: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addManyToMany('accounts', 'Accounts');
     $form->addText('itemsPerPage', 'Items per page')->addRule($form::FILLED)->addRule($form::NUMERIC);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:PageFormFactory.php

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

示例6: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     $form->addText('name', 'Name');
     if ($form->data->id) {
         $form->addManyToOne('parent', 'Parent')->setCriteria(array('invisible' => FALSE))->setOrderBy(array('path' => 'ASC'));
     }
     $form->addGroup('Permissions');
     $form->addManyToOne('author', 'Owner');
     $form->addManyToMany('write', 'Write');
     $form->addManyToMany('read', 'Read');
     $form->addCheckbox('protected', 'Protected');
     $form->addCheckbox('recursively', 'Change recursively');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:19,代码来源:DirFormFactory.php

示例7: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addText('itemsPerPage', 'Items per page');
     $form->addManyToMany('roles', 'Roles');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:11,代码来源:UserFormFactory.php

示例8: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Kontakty');
     $form->addText('city', 'Město');
     $form->addText('street', 'Ulice');
     $form->addText('zip', 'PSČ');
     $form->addText('phone', 'Telefon');
     $form->addText('email', 'E-mail');
     $form->addText('account', 'Číslo účtu');
     $form->addGroup('Sociální sítě');
     $form->addText('fb', 'Facebook');
     $form->addGroup('Lidé');
     $form->addManyToOne('coordinator', 'Koordinátor');
     $form->addManyToMany('members', 'Členové');
     $form->addManyToMany('supporters', 'Přiznivci');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:21,代码来源:FormFactory.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
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     if ($form->data->id) {
         $form->addText('name', 'Name')->addCondition($form::FILLED);
     } else {
         $form->addUpload('file', 'File')->addCondition($form::FILLED);
     }
     if ($form->data->id) {
         $form->addManyToOne('parent', 'Parent')->setCriteria(array('invisible' => FALSE))->setOrderBy(array('path' => 'ASC'));
     }
     $form->addGroup('Permissions');
     $form->addManyToOne('author', 'Owner');
     $form->addManyToMany('write', 'Write');
     $form->addCheckbox('protected', 'Protected')->addCondition($form::EQUAL, TRUE)->toggle('form-permissions');
     $form->addGroup()->setOption('id', 'form-permissions');
     $form->addManyToMany('read', 'Read');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:23,代码来源:FileFormFactory.php

示例11: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $extendedRoute = $form->data;
     $form->addGroup('Settings');
     $form->addText('subject', 'Předmět')->addRule($form::FILLED);
     $box = $form->addMany('boxes', function (Container $box) use($form) {
         $box->setCurrentGroup($form->addGroup('Box'));
         $box->addText('name', 'Nadpis');
         $box->addTextArea('text', 'text');
         $box->addFileEntityInput('photo', 'Photo');
         $box->addSubmit('remove', 'Smazat box')->addRemoveOnClick();
     }, function () use($extendedRoute) {
         return new BoxEntity($extendedRoute);
     });
     $box->addSubmit('add', 'Přidat box')->addCreateOnClick();
     // metodu vytváří replicator
     $form->addGroup();
     $form->addManyToMany('events', 'Events');
     $form->addManyToMany('blogs', 'Blogs');
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:newsletter-module,代码行数:24,代码来源:NewsletterFormFactory.php

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

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

示例14: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $route->setCurrentGroup($group);
     $route->addFileEntityInput('photo', 'Photo');
     $route->addManyToOne('author', 'Author')->setDisabled(TRUE);
     $form->addManyToOne('category', 'Main category');
     $form->addManyToMany('categories', 'Categories');
     $route->addDateTime('released', 'Release date')->addRule($form::FILLED);
     $route->addDateTime('expired', 'Expiry date');
     $route->addTextArea('notation', 'Notation');
     $route->setCurrentGroup($form->addGroup('Content'));
     $route->addContentEditor('text', NULL, NULL, 20);
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:20,代码来源:BlogFormFactory.php


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