當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Form::setView方法代碼示例

本文整理匯總了PHP中Zend\Form\Form::setView方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::setView方法的具體用法?PHP Form::setView怎麽用?PHP Form::setView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Form\Form的用法示例。


在下文中一共展示了Form::setView方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setView

 /**
  * Set the view object
  *
  * Ensures that the view object has the dojo view helper path set.
  *
  * @param  \Zend\View\ViewEngine $view
  * @return \Zend\Dojo\Form\Element\Dijit
  */
 public function setView(View $view = null)
 {
     if (null !== $view) {
         if (false === $view->getPluginLoader('helper')->getPaths('Zend\\Dojo\\View\\Helper')) {
             $view->addHelperPath('Zend/Dojo/View/Helper', 'Zend\\Dojo\\View\\Helper');
         }
     }
     return parent::setView($view);
 }
開發者ID:heiglandreas,項目名稱:zf2,代碼行數:17,代碼來源:Form.php

示例2: setView

 /**
  * Set the view object
  *
  * Ensures that the view object has the dojo view helper path set.
  *
  * @param  \Zend\View\Renderer $view
  * @return \Zend\Dojo\Form\Element\Dijit
  */
 public function setView(View $view = null)
 {
     if (null !== $view) {
         if (false === $view->getBroker()->isLoaded('dojo')) {
             $loader = new \Zend\Dojo\View\HelperLoader();
             $view->getBroker()->getClassLoader()->registerPlugins($loader);
         }
     }
     return parent::setView($view);
 }
開發者ID:RomanShumkov,項目名稱:zf2,代碼行數:18,代碼來源:Form.php

示例3: setupForm

 public function setupForm()
 {
     $form1 = new SubForm();
     $form1->addElement('text', 'foo', array('label' => 'Sub Foo: ', 'required' => true, 'validators' => array('NotEmpty', 'Alpha')))->addElement('text', 'bar', array('label' => 'Sub Bar: ', 'required' => true, 'validators' => array('Alpha', 'Alnum')));
     $form2 = new Form();
     $form2->addElement('text', 'foo', array('label' => 'Master Foo: ', 'required' => true, 'validators' => array('NotEmpty', 'Alpha')))->addElement('text', 'bar', array('required' => true, 'validators' => array('Alpha', 'Alnum')))->addSubForm($form1, 'sub');
     $form2->isValid(array('foo' => '', 'bar' => 'foo 2 u 2', 'sub' => array('foo' => '', 'bar' => 'foo 2 u 2')));
     $form2->setView($this->getView());
     $this->decorator->setElement($form2);
     $this->form = $form2;
     return $form2;
 }
開發者ID:navtis,項目名稱:xerxes-pazpar2,代碼行數:12,代碼來源:FormErrorsTest.php

示例4: __invoke

 public function __invoke(FormModel $model, $route)
 {
     $form = new ZendForm();
     foreach ($model->getElements() as $element) {
         $type = $element->getType();
         $name = $element->getName();
         $options = (array) Json::decode($element->getOptions());
         $form->addElement($type, $name, $options);
     }
     $form->addElement('hidden', IndexController::ID, array('value' => $model->getId()));
     $url = $this->getView()->url(array(), array('name' => $route . '/send'));
     $form->setView($this->getView())->setAction($url);
     return $form;
 }
開發者ID:bb-drummer,項目名稱:Zcmf,代碼行數:14,代碼來源:Form.php

示例5: testMultiFileWithOneFile

 public function testMultiFileWithOneFile()
 {
     $form = new Form();
     $element = new FileElement('file');
     $element->setMultiFile(1);
     $subform0 = new SubForm();
     $subform0->addElement($element);
     $subform1 = new SubForm();
     $subform1->addSubform($subform0, 'subform0');
     $subform2 = new SubForm();
     $subform2->addSubform($subform1, 'subform1');
     $subform3 = new SubForm();
     $subform3->addSubform($subform2, 'subform2');
     $form->addSubform($subform3, 'subform3');
     $form->setView(new View());
     $output = (string) $form;
     $this->assertNotContains('name="file[]"', $output);
 }
開發者ID:alab1001101,項目名稱:zf2,代碼行數:18,代碼來源:FileTest.php

示例6: testSubFormGetsUniqueIdWithName

 /**
  * @group ZF-2950
  */
 public function testSubFormGetsUniqueIdWithName()
 {
     $form = new Form();
     $form->setView($this->getView())->setName('testform')->addSubForm(new \Zend\Form\SubForm(), 'testform');
     $html = $form->render();
     $this->assertContains('<dt id="testform-label">&#160;</dt>', $html);
     $this->assertContains('<dd id="testform-element">', $html);
 }
開發者ID:rafalwrzeszcz,項目名稱:zf2,代碼行數:11,代碼來源:FormTest.php


注:本文中的Zend\Form\Form::setView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。