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


PHP Zend_Form::getAction方法代码示例

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


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

示例1: checkMarkup

 public function checkMarkup($html)
 {
     $this->assertFalse(empty($html));
     $this->assertContains('<form', $html);
     $this->assertRegexp('/<form[^>]+action="' . $this->form->getAction() . '"/', $html);
     $this->assertRegexp('/<form[^>]+method="' . $this->form->getMethod() . '"/i', $html);
     $this->assertRegexp('#<form[^>]+enctype="application/x-www-form-urlencoded"#', $html);
     $this->assertContains('</form>', $html);
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:9,代码来源:FormTest.php

示例2: testCanSetObjectStateByPassingConfigObjectToConstructor

 public function testCanSetObjectStateByPassingConfigObjectToConstructor()
 {
     $config = new Zend_Config($this->getOptions());
     $form = new Zend_Form($config);
     $this->assertEquals('foo', $form->getName());
     $this->assertEquals('someform', $form->getAttrib('class'));
     $this->assertEquals('/foo/bar', $form->getAction());
     $this->assertEquals('put', $form->getMethod());
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:9,代码来源:FormTest.php

示例3: getFormAsArray

 /**
  * Return an array of form elements.
  *
  * @param Zend_Form $form
  * @return array
  */
 public function getFormAsArray(Zend_Form $form)
 {
     $array = array();
     $array['action'] = $form->getAction();
     $array['method'] = $form->getMethod();
     foreach ($form->getElements() as $element) {
         $element->removeDecorator('HtmlTag');
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $array[$element->getName()] = $element;
     }
     return $array;
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:19,代码来源:GlobalController.php

示例4: getForm

 /**
  * @param unknown_type $formName
  * @param unknown_type $options
  * @throws Exception
  * @return Zend_Form
  */
 public function getForm($formName, $options = null, $useTemplate = false)
 {
     if (is_null(self::$_forms)) {
         if (is_file(APPLICATION_PATH . '/configs/forms.ini')) {
             $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/forms.ini');
         } else {
             $config = new Zend_Config(include_once APPLICATION_PATH . '/configs/forms.php');
         }
         $config = $config->toArray();
         self::$_forms = $config;
     }
     if (!array_key_exists($formName, $config)) {
         throw new Exception("Form not exist");
     }
     if ($useTemplate) {
         //$form = new Zend_Form_Template($config[$formName]);
         //$form->setTemplate($formName, $options);
         $form = new Zend_Form($config[$formName]);
         $elements = $form->getElements();
         foreach ($elements as &$element) {
             $element->removeDecorator('Label');
             $element->removeDecorator('HtmlTag');
             $element->removeDecorator('DtDdWrapper');
             $element->removeDecorator('Description');
             $element->removeDecorator('Errors');
             $element->addDecorator(array('data' => 'Errors'), array('tag' => 'p', 'class' => 'description'));
         }
         $filter = new Zend_Filter_Word_CamelCaseToDash();
         $formName = $filter->filter($formName);
         $options['viewScript'] = 'forms/' . $formName . '.phtml';
         $form->setDecorators(array(array('viewScript', $options)));
     } else {
         $form = new Zend_Form($config[$formName]);
         /*  $form->addElementPrefixPath('Zend_Decorator',
             'Zend/Decorator/',
             'decorator');
             $form->setDecorators(array('Default'));*/
         //Zend_Debug::dump($form->getDecorator('Errors'));
         /*$elements = $form->getElements();
                     foreach ($elements as &$element) {
         
                         $element->setDecorators(
                             array(
                             'ViewHelper',
                             'Errors',
                             array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element')),
                             'Label',
                             array(array('row' => 'HtmlTag'), array('tag' => 'li'))
                             )
                         );
         
                         //Zend_Debug::dump($element->getDecorator('Errors'));
         
                     };*/
         /*
                     $form->setElementDecorators(array(
                         'ViewHelper',
                         array('Errors', array('class' => 'help-inline control-error')),
                         array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'controls')),
                         array(array('label' => 'Label'), array('class' => 'control-label')),
                         array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'control-group')),
                     ));
         */
         // $form->addElement("text", "naem", $opt);
         /* $form->setDecorators(array(
                'FormElements',
                array('Form', array('class' => 'form-horizontal'))
            ));*/
         //Zend_Debug::dump($form);
         // вынести декораторы
     }
     $formAction = $form->getAction();
     $routes = $this->getRouterNames();
     $actionParams = array();
     if (is_array($options) && array_key_exists('actionParams', $options)) {
         $actionParams = $options['actionParams'];
     }
     if (in_array($formAction, $routes)) {
         if (array_key_exists("actionParams", $config[$formName]) && is_array($config[$formName]['actionParams'])) {
             $actionParams = $config[$formName]['actionParams'];
         }
         $form->setAction($this->_url($actionParams, $formAction));
     }
     //Zend_Debug::dump($form);
     return $form;
 }
开发者ID:sb15,项目名称:legacy-library,代码行数:92,代码来源:WebCore.php


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