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


PHP Zend_Form_Element::setView方法代码示例

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


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

示例1: setView

 /**
  * Set the view object
  *
  * Ensures that the view object has the jQuery view helper path set.
  *
  * @param  Zend_View_Interface $view
  * @return ZendX_JQuery_Form_Element_UiWidget
  */
 public function setView(Zend_View_Interface $view = null)
 {
     if (null !== $view) {
         if (false === $view->getPluginLoader('helper')->getPaths('ZendX_JQuery_View_Helper')) {
             $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
         }
     }
     return parent::setView($view);
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:17,代码来源:UiWidget.php

示例2: testRetrievingLabelRetrievesLabelWithTranslationAndPrefixAndSuffix

 public function testRetrievingLabelRetrievesLabelWithTranslationAndPrefixAndSuffix()
 {
     require_once 'Zend/Translate.php';
     $translate = new Zend_Translate('array', array('My Label' => 'Translation'), 'en');
     $translate->setLocale('en');
     $element = new Zend_Form_Element('foo');
     $element->setView($this->getView())->setLabel('My Label')->setTranslator($translate);
     $this->decorator->setElement($element)->setOptions(array('optionalPrefix' => '> ', 'optionalSuffix' => ':', 'requiredPrefix' => '! ', 'requiredSuffix' => '*:'));
     $label = $this->decorator->getLabel();
     $this->assertEquals('> Translation:', $label);
     $element->setRequired(true);
     $label = $this->decorator->getLabel();
     $this->assertEquals('! Translation*:', $label);
 }
开发者ID:Tony133,项目名称:zf-web,代码行数:14,代码来源:LabelTest.php

示例3: testLabelIsNotTranslatedTwice

 /**
  * @group ZF-8694
  */
 public function testLabelIsNotTranslatedTwice()
 {
     // Init translator
     require_once 'Zend/Translate.php';
     $translate = new Zend_Translate(array('adapter' => 'array', 'content' => array('firstLabel' => 'secondLabel', 'secondLabel' => 'thirdLabel'), 'locale' => 'en'));
     // Create element
     $element = new Zend_Form_Element('foo');
     $element->setView($this->getView())->setLabel('firstLabel')->setTranslator($translate);
     $this->decorator->setElement($element);
     // Test
     $this->assertEquals('secondLabel', $this->decorator->getLabel());
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:15,代码来源:LabelTest.php

示例4: testDescriptionIsNotTranslatedTwice

 /**
  * @group ZF-8694
  */
 public function testDescriptionIsNotTranslatedTwice()
 {
     // Init translator
     require_once 'Zend/Translate.php';
     $translate = new Zend_Translate(array('adapter' => 'array', 'content' => array('firstDescription' => 'secondDescription', 'secondDescription' => 'thirdDescription'), 'locale' => 'en'));
     // Create element
     $element = new Zend_Form_Element('foo');
     $element->setView($this->getView())->setDescription('firstDescription')->setTranslator($translate);
     $this->decorator->setElement($element);
     // Test
     $this->assertEquals('<p class="hint">secondDescription</p>', trim($this->decorator->render('')));
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:15,代码来源:DescriptionTest.php

示例5: testRenderAppendsOnRequest

 public function testRenderAppendsOnRequest()
 {
     $element = new Zend_Form_Element('foo');
     $element->setView($this->getView())
             ->setLabel('My Label');
     $this->decorator->setElement($element)
                     ->setOptions(array('placement' => 'APPEND'));
     $content = 'test content';
     $test = $this->decorator->render($content);
     $this->assertRegexp('#' . $content . '.*?<label#s', $test);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:11,代码来源:LabelTest.php

示例6: testRenderImplicitAppendsOnRequest

 /**
  * @group ZF-6667
  */
 public function testRenderImplicitAppendsOnRequest()
 {
     $element = new Zend_Form_Element('foo');
     $element->setView($this->getView())->setLabel('My Label');
     $this->decorator->setElement($element)->setOptions(array('placement' => 'IMPLICIT_APPEND', 'separator' => ' '));
     $content = 'test content';
     $actual = $this->decorator->render($content);
     $expected = '<label class="optional">test content My Label</label>';
     $this->assertEquals($expected, $actual);
 }
开发者ID:ramyarangan,项目名称:CS50Organizations,代码行数:13,代码来源:LabelTest.php


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