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


PHP Zend_View_Interface::formText方法代码示例

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


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

示例1: getHtml

 /**
  *
  * @static
  * @param string $value
  * @param Zend_View_Interface $view
  * @return string
  */
 public static function getHtml($value, Zend_View_Interface $view = null)
 {
     $value = json_decode($value, true);
     if (!is_array($value)) {
         $value = json_decode(self::getSaveValue('25'), true);
     }
     $html = '<script type="text/javascript">
         function removeRate(id) {
             $(\'#wraper-\' + id).remove();
         }
         function addRate() {
             var rand = Math.floor(Math.random() * 2147483647);
             var html = $(\'#shippingmultirate-template\').html();
             html = html.replace(/{template_id}/g, rand)
                 .replace(/{template}/g, \'confValue[\' + rand + \']\');
             $(\'#shippingmultirate-template\').before(html);
         }
     </script>';
     $i = 1;
     foreach ($value as $subcode => $item) {
         $html .= '<div id="wraper-' . $i . '">' . 'Subcode : ' . $view->formText('confValue[' . $i . '][subcode]', $subcode, array('size' => '10')) . 'Title : ' . $view->formText('confValue[' . $i . '][title]', $item['title'], array('size' => '10')) . 'Price : ' . $view->formText('confValue[' . $i . '][price]', $item['price'], array('size' => '10')) . 'Min Subtotal : ' . $view->formText('confValue[' . $i . '][minOrderTotal]', isset($item['minOrderTotal']) ? $item['minOrderTotal'] : '', array('size' => '10')) . 'Max Subtotal : ' . $view->formText('confValue[' . $i . '][maxOrderTotal]', isset($item['maxOrderTotal']) ? $item['maxOrderTotal'] : '', array('size' => '10')) . $view->formButton('shippingmultirate-template-remove', 'Remove', array('onclick' => 'removeRate(' . $i . ');')) . '</div>';
         $i++;
     }
     $html .= '<div id="shippingmultirate-template" style="display:none" >' . '<div id="wraper-{template_id}">' . 'Subcode : ' . $view->formText('{template}[subcode]', $subcode, array('size' => '10')) . 'Title : ' . $view->formText('{template}[title]', $item['title'], array('size' => '10')) . 'Price : ' . $view->formText('{template}[price]', $item['price'], array('size' => '10')) . 'Min Subtotal : ' . $view->formText('{template}[minOrderTotal]', isset($item['minOrderTotal']) ? $item['minOrderTotal'] : '', array('size' => '10')) . 'Max Subtotal : ' . $view->formText('{template}[maxOrderTotal]', isset($item['maxOrderTotal']) ? $item['maxOrderTotal'] : '', array('size' => '10')) . $view->formButton('shippingmultirate-template-remove', 'Remove', array('onclick' => 'removeRate(\'{template_id}\');')) . '</div>' . '</div>' . $view->formButton('shippingmultirate-template-add', 'Add', array('onclick' => 'addRate();'));
     return $html;
 }
开发者ID:rguedes,项目名称:axiscommerce,代码行数:33,代码来源:ShippingFlatRateMultiPrice.php

示例2: questionElement

 /**
  * Generate the form element required for a particular question/response
  *
  * @param  QuestionModel question object for which an element is being generated 
  * @param  ResponseModel response object
  * @return string
  */
 public function questionElement($q, $r)
 {
     $b = new Tag_Builder();
     $responseText = $this->view->h($r->responseText);
     switch (strtolower(substr($q->format, 0, 1))) {
         case 'd':
             return '<br/>' . $this->view->formText("q{$q->questionID}", $responseText, array('class' => 'calendarText', 'size' => 13, 'readonly' => 1)) . $this->view->linkTo('#showCalendar', $this->view->imageTag('icons/calendar.png', array('id' => "c{$q->questionID}", 'class' => 'calendarButton', 'title' => 'calendar')));
         case 't':
             return '<br/>' . $this->view->formText("q{$q->questionID}", $responseText, array('size' => 50));
         case 's':
             $response = '<br/>';
             if (count($q->prompts) > 4) {
                 $options = '';
                 foreach ($q->prompts as $prompt) {
                     $class = $prompt['requireAddlInfo'] ? 'require-addl' : null;
                     $selected = $prompt['promptID'] == $responseText ? 'selected' : null;
                     $options .= $b->option(array_filter(array('value' => $prompt['promptID'], 'class' => $class, 'selected' => $selected)), $this->view->h($prompt['value']));
                     $response .= $this->rulesElements($prompt);
                 }
                 $response .= $b->select(array('name' => "q{$q->questionID}"), $options);
             } else {
                 foreach ($q->prompts as $prompt) {
                     $class = $prompt['requireAddlInfo'] ? 'require-addl' : null;
                     $checked = $prompt['promptID'] == $r->responseText ? 'checked' : null;
                     $response .= $b->input(array_filter(array('type' => 'radio', 'value' => $prompt['promptID'], 'name' => "q{$q->questionID}", 'checked' => $checked, 'class' => $class)));
                     $response .= $this->rulesElements($prompt);
                     $response .= $b->label($this->view->h($prompt['value']));
                 }
             }
             return $response;
         case 'm':
             $response = '<br/>';
             foreach (split(',', $responseText) as $id) {
                 $responseIDs[$id] = true;
             }
             foreach ($q->prompts as $prompt) {
                 $class = $prompt['requireAddlInfo'] ? 'require-addl' : null;
                 $checked = isset($responseIDs[$prompt['promptID']]) ? 'checked' : null;
                 $response .= $b->input(array_filter(array('type' => 'checkbox', 'value' => $prompt['promptID'], 'name' => "q{$q->questionID}_m{$prompt['promptID']}", 'checked' => $checked, 'class' => $class)));
                 $response .= $this->rulesElements($prompt);
                 $response .= $b->label($this->view->h($prompt['value']));
                 $response .= '<br/>';
             }
             return $response;
         case '_':
             return $this->view->formHidden("q{$q->questionID}", '');
         default:
             throw new Exception('Unrecognized question type');
     }
     return '';
 }
开发者ID:humansky,项目名称:qframe,代码行数:58,代码来源:PageHelpers.php

示例3: getHtml

 /**
  *
  * @param array $value
  * @param Zend_View_Interface $view
  * @return string
  */
 public static function getHtml($value, Zend_View_Interface $view = null)
 {
     $value = json_decode($value, true);
     foreach (self::_getOptions() as $options) {
         switch ($options['type']) {
             case 'bool':
                 $html .= $view->formRadio('confValue[' . $options['name'] . ']', $value[$options['id']], null, array('1' => Axis::translate()->__(' Yes'), '0' => Axis::translate()->__(' No')));
                 break;
             case 'select':
                 $html .= $view->formSelect('confValue[' . $options['name'] . ']', $value[$options['id']], null, $options['config_options']);
                 break;
             case 'multiple':
                 $html .= '<br />';
                 foreach ($options['config_options'] as $key => $dataItem) {
                     $html .= $view->formCheckbox('confValue[' . $options['name'] . '][' . $key . ']', isset($value[$options['name']][$key]) && $value[$options['name']][$key] ? 1 : null, null, array(1, 0)) . " {$dataItem} <br /> ";
                 }
                 break;
             case 'text':
                 $html .= $view->formTextarea('confValue[' . $options['name'] . ']', $value[$options['id']], array('rows' => 8, 'cols' => 45));
                 break;
             default:
                 $html .= $view->formText('confValue[' . $options['name'] . ']', $value[$options['id']], array('size' => '50'));
         }
     }
     return $html;
 }
开发者ID:rommmka,项目名称:axiscommerce,代码行数:32,代码来源:TestJson.php

示例4: getHtml

 /**
  *
  * @static
  * @param string $value
  * @param Zend_View_Interface $view
  * @return string
  */
 public static function getHtml($value, Zend_View_Interface $view = null)
 {
     $value = Zend_Json_Decoder::decode($value);
     $html = '';
     foreach (self::_getOptions() as $options) {
         $html .= $options['name'] . ' ' . $view->formText('confValue[' . $options['name'] . ']', $value[$options['id']], array('size' => '50'));
     }
     return $html;
 }
开发者ID:rommmka,项目名称:axiscommerce,代码行数:16,代码来源:CacheTagLifetime.php

示例5: renderDate

 /**
  * Render form controls for a date question
  *
  * @param  ModelQuestionModel question being rendered
  * @return string
  */
 public function renderDate(ModelQuestionModel $question)
 {
     $name = "response[{$question->questionID}][target]";
     $value = $question->hasModelResponse() ? $question->nextModelResponse()->target : null;
     return $this->view->formText($name, $value, array('class' => 'calendarText', 'size' => 13, 'readonly' => 1)) . $this->view->linkTo('#showCalendar', $this->view->imageTag('icons/calendar.png', array('id' => "c{$question->questionID}", 'class' => 'calendarButton', 'title' => 'calendar')));
 }
开发者ID:humansky,项目名称:qframe,代码行数:12,代码来源:CompareHelpers.php

示例6: getHtml

 /**
  *
  * @static
  * @param array $value
  * @param Zend_View_Interface $view
  * @return string
  */
 public static function getHtml($value, Zend_View_Interface $view = null)
 {
     $html = $view->formText('confValue', $value);
     return $html;
 }
开发者ID:rommmka,项目名称:axiscommerce,代码行数:12,代码来源:ShippingTableRateImport.php

示例7: getHtml

 /**
  *
  * @param string $value
  * @param Zend_View_Interface $view
  * @return string
  */
 public static function getHtml($value, Zend_View_Interface $view = null)
 {
     return $view->formText('confValue', Axis_Crypt::factory()->decrypt($value), array('size' => '50'));
 }
开发者ID:rommmka,项目名称:axiscommerce,代码行数:10,代码来源:Crypt.php


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