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


PHP Zend_Form::getView方法代码示例

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


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

示例1: getForm

 /**
  * Генерирует форму для заполнения доп данных
  * @return Zend_Form $form Форма для завершения регистрации
  */
 public function getForm($params)
 {
     $form = new Zend_Form();
     // Устанавливаем декораторы
     $form->setAction($form->getView()->url($params, 'auth_openid_complete'))->setAttrib('id', 'zend_form');
     //Email
     $email = new Zend_Form_Element_Text('email');
     $email->setRequired(true)->addValidator('EmailAddress', false, array('domain' => false))->addValidator(new ZendExtra_Validate_Email())->setOptions(array('domain' => false))->setLabel('Email:')->setDescription($form->getView()->translate('Enter email for recieving password'))->setAttrib('onBlur', 'validate(this);');
     $form->addElement($email);
     // Кнопка "Отправить"
     $submit = new Zend_Form_Element_Text('submit');
     $html = '<dt></dt><dd><a class="btn-base btn-normal" href="javascript:;" onClick=\'$("#zend_form").submit();\'><span></span>' . $form->getView()->translate('submit') . '</a></dd>';
     $submit->setDecorators(array('decorator' => array('br' => new ZendExtra_Form_Decorator_HtmlCode(array('tag' => $html, 'placement' => Zend_Form_Decorator_Abstract::PREPEND)))))->setOrder(100);
     $form->addElement($submit);
     return $form;
 }
开发者ID:netandreus,项目名称:exlibris,代码行数:20,代码来源:Abstract.php

示例2: _recursivelyPrepareForm

 protected function _recursivelyPrepareForm(Zend_Form $form)
 {
     $belongsTo = $form instanceof Zend_Form ? $form->getElementsBelongTo() : null;
     $elementContent = '';
     $separator = $this->getSeparator();
     $translator = $form->getTranslator();
     $view = $form->getView();
     foreach ($form as $item) {
         $item->setView($view)->setTranslator($translator);
         if ($item instanceof Zend_Form_Element) {
             $item->setBelongsTo($belongsTo);
         } elseif (!empty($belongsTo) && $item instanceof Zend_Form) {
             if ($item->isArray()) {
                 $name = $this->mergeBelongsTo($belongsTo, $item->getElementsBelongTo());
                 $item->setElementsBelongTo($name, true);
             } else {
                 $item->setElementsBelongTo($belongsTo, true);
             }
             $this->_recursivelyPrepareForm($item);
         } elseif (!empty($belongsTo) && $item instanceof Zend_Form_DisplayGroup) {
             foreach ($item as $element) {
                 $element->setBelongsTo($belongsTo);
             }
         }
     }
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:26,代码来源:PrepareElements.php

示例3: testCanSetView

 public function testCanSetView()
 {
     $view = new Zend_View();
     $this->assertNull($this->form->getView());
     $this->form->setView($view);
     $received = $this->form->getView();
     $this->assertSame($view, $received);
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:8,代码来源:FormTest.php

示例4: testCanSetView

 public function testCanSetView()
 {
     $view = new View\PhpRenderer();
     $test = $this->form->getView();
     $this->assertNotSame($view, $test);
     $this->form->setView($view);
     $received = $this->form->getView();
     $this->assertSame($view, $received);
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:9,代码来源:FormTest.php

示例5: testFormShouldEnableView

 public function testFormShouldEnableView()
 {
     $form = new Zend_Form();
     $view = new Zend_View();
     $form->setView($view);
     $this->assertFalse(false !== $form->getView()->getPluginLoader('helper')->getPaths('ZendX_JQuery_View_Helper'));
     ZendX_JQuery::enableForm($form);
     $this->assertTrue(false !== $form->getView()->getPluginLoader('helper')->getPaths('ZendX_JQuery_View_Helper'));
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:9,代码来源:JQueryTest.php

示例6: enableForm

 /**
  * Dojo-enable a form instance
  *
  * @param  Zend_Form $form
  * @return void
  */
 public static function enableForm(Zend_Form $form)
 {
     $form->addPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')->addPrefixPath('Zend_Dojo_Form_Element', 'Zend/Dojo/Form/Element', 'element')->addElementPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')->addDisplayGroupPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator')->setDefaultDisplayGroupClass('Zend_Dojo_Form_DisplayGroup');
     foreach ($form->getSubForms() as $subForm) {
         self::enableForm($subForm);
     }
     if (null !== ($view = $form->getView())) {
         self::enableView($view);
     }
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:16,代码来源:Dojo.php

示例7: enableForm

 /**
  * jQuery-enable a form instance
  *
  * @param  \Zend_Form $form
  * @return void
  */
 public static function enableForm(\Zend_Form $form)
 {
     $form->addPrefixPath('ZendX_JQuery_Form_Decorator', 'ZendX/JQuery/Form/Decorator', 'decorator')->addPrefixPath('ZendX_JQuery_Form_Element', 'ZendX/JQuery/Form/Element', 'element')->addElementPrefixPath('ZendX_JQuery_Form_Decorator', 'ZendX/JQuery/Form/Decorator', 'decorator')->addDisplayGroupPrefixPath('ZendX_JQuery_Form_Decorator', 'ZendX/JQuery/Form/Decorator');
     foreach ($form->getSubForms() as $subForm) {
         self::enableForm($subForm);
     }
     if (null !== ($view = $form->getView())) {
         self::enableView($view);
     }
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:16,代码来源:JQuery.php

示例8: testIfViewIsSetInTime

 /**
  * @group ZF-10149
  */
 public function testIfViewIsSetInTime()
 {
     try {
         $form = new Zend_Form(array('view' => new MyTestView()));
         $this->assertTrue($form->getView() instanceof MyTestView);
         $form = new Zend_Form(array('view' => new StdClass()));
         $this->assertNull($form->getView());
         $result = $form->render();
     } catch (Zend_Form_Exception $e) {
         $this->fail('Setting a view object using the options array should not throw an exception');
     }
     $this->assertNotEquals($result, '');
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:16,代码来源:FormTest.php

示例9: getView

 /** @inheritdoc */
 public function getView()
 {
     if (null === $this->_view) {
         $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
         if (!$viewRenderer->view) {
             $view = new Zend_View();
             $view->doctype('XHTML1_STRICT');
             $viewRenderer->setView($view);
         }
     }
     return parent::getView();
 }
开发者ID:bombayworks,项目名称:currycms,代码行数:13,代码来源:Form.php


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