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


PHP Form::addManyToOne方法代码示例

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


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

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

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

示例3: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('startDepth', 'Start depth')->addCondition($form::FILLED)->addRule($form::INTEGER);
     $form->addText('maxDepth', 'Max depth')->addCondition($form::FILLED)->addRule($form::INTEGER);
     $form->addManyToOne('root', 'Root page');
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:NavigationFormFactory.php

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

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

示例6: configure

 public function configure(Form $form)
 {
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Notation', NULL, 4)->getControlPrototype()->attrs['class'] = 'input-block-level';
     $form->addManyToOne('linkedRoute', 'Linked route')->setCriteria(array('page' => $form->data->extendedPage->linkedPage->id));
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:8,代码来源:GalleryFormFactory.php

示例7: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Options');
     $form->addManyToOne('rootPage', 'Root page')->setPrompt(NULL);
     $form->addText('maxDepth', 'Maximal depth')->addRule($form::INTEGER);
     $form->addText('maxWidth', 'Maximal width')->addRule($form::INTEGER);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:12,代码来源:PageFormFactory.php

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

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

示例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)
 {
     $form->addManyToOne('account', 'Account');
     $form->addManyToOne('offset', 'Offset');
     $form->addText('paymentId', 'Payment ID');
     $form->addDateTime('date', 'Date');
     $form->addText('amount', 'Amount');
     $form->addText('constantSymbol', 'Constant sb.');
     $form->addText('variableSymbol', 'Variable sb.');
     $form->addText('specificSymbol', 'Specific sb.');
     $form->addText('userIdentification', 'User identific.');
     $form->addTextArea('message', 'Message')->addRule($form::MAX_LENGTH, NULL, 140);
     $form->addText('type', 'Type');
     $form->addText('performed', 'Performed')->addRule($form::MAX_LENGTH, NULL, 50);
     $form->addText('specification', 'Specification');
     $form->addText('comment', 'Comment');
     $form->addText('bic', 'BIC');
     $form->addText('instructionId', 'Instruction ID');
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:23,代码来源:PaymentFormFactory.php

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

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

示例14: configure

 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $route->setCurrentGroup($group);
     $route->addTextArea('description', 'Description')->getControlPrototype()->attrs['class'] = 'input-block-level';
     $route->addFileEntityInput('photo', 'Photo');
     $form->addManyToOne('parent', 'Parent');
     //$form->addManyToMany('types', 'Types');
     $form->addTags('typesAsArray', 'Types')->setDelimiter('[;]+')->setJoiner(';');
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:catalog-module,代码行数:13,代码来源:CategoryFormFactory.php

示例15: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addText('itemsPerPage', 'Items per page');
     $form->addManyToOne('linkedPage', 'Linked 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,代码行数:16,代码来源:PageFormFactory.php


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