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


PHP Zend_Form::render方法代码示例

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


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

示例1: render

 /**
  * Setup decorators and properties and return render output
  * 
  * @return string
  */
 public function render()
 {
     $this->addElements();
     $this->setupElementsCommon();
     $this->setupElementsUnique();
     $this->setupForm();
     return $this->form->render();
 }
开发者ID:TBeijen,项目名称:Zend_Form_Without_MVC,代码行数:13,代码来源:My_Form_Renderer_Edit.php

示例2: render

 /**
  * Render
  * @param  Zend_View_Interface $view
  * @return Zend_View
  */
 public function render(Zend_View_Interface $view = null)
 {
     if (!empty($this->_type)) {
         $this->setAttrib('class', trim('form-' . $this->_type . ' ' . $this->getAttrib('class')));
     }
     return parent::render($view);
 }
开发者ID:cliftonscott,项目名称:zend-twitter-bootstrap,代码行数:12,代码来源:Form.php

示例3: render

 /**
  * Render form
  *
  * @param  Zend_View_Interface $view
  * @return string
  */
 public function render(Zend_View_Interface $view = null)
 {
     if (null === $view && $this->_view === null) {
         $view = new Zend_View();
     }
     return parent::render($view);
 }
开发者ID:nvdnkpr,项目名称:Enlight,代码行数:13,代码来源:Form.php

示例4: render

 public function render()
 {
     $requiredSuffx = '<span title="This field is required." class="form-required">*</span>';
     foreach ($this->getElements() as $element) {
         $decorator = $element->getDecorator('Label');
         if ($decorator) {
             if ($element->getLabel()) {
                 // need to check this, since label decorator can be blank
                 $element->setLabel($element->getLabel() . "&nbsp;");
             }
             $decorator->setOption('requiredSuffix', $requiredSuffx);
             $decorator->setOption('escape', false);
         }
         if ($element->getErrors()) {
             $this->addElementClass($element, 'error');
         }
         // Add a wrapper div to all elements other than add and remove buttons.
         if ($element->getName() != 'add' && $element->getName() != 'remove') {
             if ($element->getName() == 'id' || $element->getType() == 'Zend_Form_Element_Hidden' && preg_match('/_id/', $element->getName())) {
                 $element->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-item ele-id clearfix'))));
             } else {
                 if ($element->getName() == 'save_and_view' || $element->getName() == 'save') {
                     $element->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-item ele-submit-buttons clearfix'))));
                 } else {
                     $element->addDecorators(array(array(array('wrapperAll' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-item clearfix'))));
                 }
             }
         } else {
             $element->removeDecorator('label');
         }
     }
     $output = parent::render();
     return $output;
 }
开发者ID:relyd,项目名称:aidstream,代码行数:34,代码来源:SimplifiedForm.php

示例5: render

 public function render(Zend_View_Interface $view = null)
 {
     $decorators = array(array('ViewHelper'), array('Label'));
     $elements = $this->getElements();
     $elements_name = array();
     foreach ($elements as $element) {
         $type = explode('_', $element->getType());
         $type = strtolower(array_pop($type));
         $element->setAttrib('class', $type);
         if ($type == 'hidden' || $type == 'submit' || $type == 'button' || $type == 'reset') {
             $element->setDecorators($decorators[0]);
         } else {
             if ($type == 'file') {
                 $element->setDecorators(array('File', $decorators[1]));
             } else {
                 $element->setDecorators($decorators);
             }
         }
         array_push($elements_name, $element->getName());
     }
     if (count($elements_name) > 0) {
         $this->addDisplayGroup($elements_name, $this->getName(), array('legend' => $this->getLegend()));
         $this->setDisplayGroupDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'id' => 'div-' . $this->getName()))));
     }
     return parent::render($view);
 }
开发者ID:robertsonmello,项目名称:projetos,代码行数:26,代码来源:Abstract.php

示例6: testEmptyFormNameShouldNotRenderEmptyFormId

 public function testEmptyFormNameShouldNotRenderEmptyFormId()
 {
     $form = new Zend_Form();
     $form->setMethod('post')->setAction('/foo/bar')->setView($this->getView());
     $html = $form->render();
     $this->assertNotContains('id=""', $html, $html);
 }
开发者ID:lortnus,项目名称:zf1,代码行数:7,代码来源:FormTest.php

示例7: testEnctypeDefaultsToMultipartWhenFileElementIsAttachedToDisplayGroup

 /**
  * @group ZF-5370
  */
 public function testEnctypeDefaultsToMultipartWhenFileElementIsAttachedToDisplayGroup()
 {
     $this->form->addElement('file', 'txt')->addDisplayGroup(array('txt'), 'txtdisplay')->setView(new Zend_View());
     $html = $this->form->render();
     $this->assertContains('id="txt"', $html);
     $this->assertContains('name="txt"', $html);
     $this->assertRegexp('#<form[^>]+enctype="multipart/form-data"#', $html, $html);
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:11,代码来源:FormTest.php

示例8: testRenderedSubFormDtShouldContainNoBreakSpace

 /**
  * @see ZF-3272
  */
 public function testRenderedSubFormDtShouldContainNoBreakSpace()
 {
     $subForm = new Zend_Form_SubForm(array('elements' => array('foo' => 'text', 'bar' => 'text')));
     $form = new Zend_Form();
     $form->addSubForm($subForm, 'foobar')->setView(new Zend_View());
     $html = $form->render();
     $this->assertContains('<dt>&nbsp;</dt>', $html);
 }
开发者ID:lortnus,项目名称:zf1,代码行数:11,代码来源:SubFormTest.php

示例9: testDisplayGroupsShouldInheritSubFormNamespace

 /**
  * @see ZF-2883
  */
 public function testDisplayGroupsShouldInheritSubFormNamespace()
 {
     $this->form->addElement('text', 'foo')->addElement('text', 'bar')->addDisplayGroup(array('foo', 'bar'), 'foobar');
     $form = new Zend_Form();
     $form->addSubForm($this->form, 'attributes');
     $html = $form->render(new Zend_View());
     $this->assertContains('name="attributes[foo]"', $html);
     $this->assertContains('name="attributes[bar]"', $html);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:12,代码来源:SubFormTest.php

示例10: render

 /**
  * Overriding zend form render.
  */
 public function render()
 {
     $requiredSuffx = '<span title="This field is required." class="form-required">*</span>';
     foreach ($this->getElements() as $element) {
         $element = $this->decorateElement($element);
     }
     $output = parent::render();
     return $output;
 }
开发者ID:relyd,项目名称:aidstream,代码行数:12,代码来源:BaseForm.php

示例11: testLabelIdIsCorrect

 public function testLabelIdIsCorrect()
 {
     $form = new \Zend_Form();
     $form->setElementsBelongTo('comment');
     $this->element->setLabel("My Captcha");
     $form->addElement($this->element);
     $html = $form->render($this->getView());
     $expect = sprintf('for="comment-%s-input"', $this->element->getName());
     $this->assertRegexp("/<label [^>]*?{$expect}/", $html, $html);
 }
开发者ID:stunti,项目名称:zf2,代码行数:10,代码来源:FigletTest.php

示例12: render

 /**
  * Wrap parent to provide a default Zend_View if none
  * is given
  *
  * @param Zend_View_Interface $view
  * @return string
  */
 public function render(Zend_View_Interface $view = NULL)
 {
     if (NULL === $view) {
         if (NULL == $this->getView()) {
             $this->setView(new Zend_View());
         }
         $view = $this->getView();
     }
     return parent::render($view);
 }
开发者ID:jbrinley,项目名称:BuggyPress,代码行数:17,代码来源:BuggyPress_Form.php

示例13: testRenderElement

 public function testRenderElement()
 {
     $form = new Zend_Form();
     $form->addElement($this->element);
     $view = new Zend_View();
     $view->addHelperPath('Application/View/Helper', 'Application_View_Helper');
     $form->setAction('/foo.php?bar')->setView($view);
     $html = $form->render();
     $this->assertContains('<input type="date" name="foo" id="foo" value="" disabled="1">', $html);
 }
开发者ID:aporat,项目名称:application_form_element_input,代码行数:10,代码来源:InputTest.php

示例14: render

 /**
  * Set default render
  */
 public function render($content = null)
 {
     $this->setAttrib('class', $this->getAttrib('class') . ' formLayout');
     $defaultDecorators = array('FormElements', 'Form');
     $defaultGroupDecorators = array('FormElements', 'Fieldset');
     $this->setElementDecorators(array('Composite'));
     $this->setDisplayGroupDecorators($defaultGroupDecorators);
     $this->setSubFormDecorators($defaultDecorators);
     $this->setDecorators($defaultDecorators);
     return parent::render($content);
 }
开发者ID:hartum,项目名称:basezf,代码行数:14,代码来源:Form.php

示例15: render

    public function render(Zend_View_Interface $view = null)
    {
        jQuery::evalScript('
			$(".z-form fieldset legend").click(function(){
				$(this).parent().find(">dl").toggle("blind",200);
			})
		');
        if (!$this->getAttrib('id')) {
            $this->setAttrib('id', 'z-admin-form-' . rand(1000000, 10000000));
        }
        return parent::render($view);
    }
开发者ID:Konstnantin,项目名称:zf-app,代码行数:12,代码来源:Form.php


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