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


PHP opToolkit::appendMobileInputModeAttributesForFormWidget方法代码示例

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


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

示例1: appendMobileInputMode

 protected function appendMobileInputMode()
 {
     parent::appendMobileInputMode();
     foreach ($this as $k => $v) {
         $widget = $this->widgetSchema[$k];
         $validator = $this->validatorSchema[$k];
         if ($widget instanceof opWidgetFormInputIncreased) {
             opToolkit::appendMobileInputModeAttributesForFormWidget($widget, 'numeric');
         }
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:11,代码来源:MemberConfigAccessBlock.class.php

示例2: appendMobileInputMode

 protected function appendMobileInputMode()
 {
     foreach ($this as $k => $v) {
         $widget = $this->widgetSchema[$k];
         $validator = $this->validatorSchema[$k];
         if (!$widget instanceof sfWidgetFormInput) {
             continue;
         }
         if ($widget instanceof sfWidgetFormInputPassword) {
             opToolkit::appendMobileInputModeAttributesForFormWidget($widget, 'alphabet');
         } elseif ($validator instanceof sfValidatorEmail) {
             opToolkit::appendMobileInputModeAttributesForFormWidget($widget, 'alphabet');
         } elseif ($validator instanceof sfValidatorNumber) {
             opToolkit::appendMobileInputModeAttributesForFormWidget($widget, 'numeric');
         }
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:17,代码来源:BaseForm.class.php

示例3: render

 /**
  * @see sfWidgetFormDate
  */
 public function render($name, $value = null, $attributes = array(), $errors = array())
 {
     $dateTimeValue = is_array($value) ? sprintf('%04d-%02d-%02d', $value['year'], $value['month'], $value['day']) : $value;
     try {
         $dateTime = new DateTime($dateTimeValue);
     } catch (Exception $e) {
         $dateTime = new DateTime();
         $dateTimeValue = null;
     }
     $dayDefault = $dateTime->format('j');
     $monthDefault = $dateTime->format('n');
     $year = $dateTime->format('Y');
     $days = $this->getOption('days');
     $months = $this->getOption('months');
     if ($this->getOption('can_be_empty')) {
         $emptyValues = $this->getOption('empty_values');
         $days = array('' => $emptyValues['day']) + $days;
         $months = array('' => $emptyValues['month']) + $months;
         if (!$dateTimeValue) {
             $dayDefault = $emptyValues['day'];
             $monthDefault = $emptyValues['month'];
             $year = $emptyValues['year'];
         }
     }
     if (is_array($value) && !checkdate((int) $value['month'], (int) $value['day'], (int) $value['year'])) {
         $dayDefault = $value['day'];
         $monthDefault = $value['month'];
         $year = $value['year'];
     }
     // days
     $widget = new sfWidgetFormSelect(array('choices' => $days), array_merge($this->attributes, $attributes));
     $date['%day%'] = $widget->render($name . '[day]', $dayDefault);
     // months
     $widget = new sfWidgetFormSelect(array('choices' => $months), array_merge($this->attributes, $attributes));
     $date['%month%'] = $widget->render($name . '[month]', $monthDefault);
     // years
     $attributes['size'] = '5';
     $widget = new sfWidgetFormInput(array(), array_merge(array('class' => 'input_text'), $this->attributes, $attributes));
     if ('mobile_frontend' === sfConfig::get('sf_app')) {
         opToolkit::appendMobileInputModeAttributesForFormWidget($widget, 'numeric');
     }
     $date['%input_year%'] = $widget->render($name . '[year]', $year);
     return strtr($this->getOption('format'), $date);
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:47,代码来源:opWidgetFormDate.class.php

示例4: configure

 public function configure()
 {
     $this->setWidget('mail_address', new sfWidgetFormInputText());
     $this->setValidator('mail_address', new sfValidatorPass());
     if ($this->getOption('invited')) {
         $this->setWidget('message', new sfWidgetFormTextarea());
         $this->setValidator('message', new sfValidatorPass());
         $this->widgetSchema->setLabel('message', 'Message(Arbitrary)');
     }
     $callback = new sfValidatorCallback(array('callback' => array($this, 'validate')));
     $callback->setMessage('invalid', 'invalid e-mail address');
     $this->validatorSchema->setPostValidator($callback);
     if (sfConfig::get('op_is_use_captcha', false)) {
         $this->embedForm('captcha', new opCaptchaForm());
     }
     if ('mobile_frontend' === sfConfig::get('sf_app')) {
         opToolkit::appendMobileInputModeAttributesForFormWidget($this->getWidget('mail_address'), 'alphabet');
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:19,代码来源:InviteForm.class.php

示例5: slot

$hasRequiredField = false;
?>

<?php 
slot('form');
foreach ($forms as $form) {
    echo $form->renderHiddenFields();
    foreach ($form as $name => $field) {
        if ($field->isHidden()) {
            continue;
        }
        $attributes = array();
        $widget = $field->getWidget();
        $validator = $form->getValidator($name);
        if ($widget instanceof sfWidgetFormInputPassword) {
            $widget = opToolkit::appendMobileInputModeAttributesForFormWidget($widget, 'alphabet');
        }
        if ($widget instanceof opWidgetFormProfile) {
            $widget = $widget->getOption('widget');
            $validator = $validator->getOption('validator');
        }
        if ($widget instanceof sfWidgetFormChoice) {
            if ($widget->getRenderer() instanceof sfWidgetFormSelectRadio || $widget->getRenderer() instanceof sfWidgetFormSelectCheckbox) {
                $widget->setOption('renderer_options', array_merge(array('formatter' => array('opWidgetFormSelectFormatterMobile', 'formatter'), 'separator' => "<br>\n"), $widget->getOption('renderer_options')));
            }
        } elseif ($widget instanceof sfWidgetFormSelectRadio || $widget instanceof sfWidgetFormSelectCheckbox) {
            $widget->setOption('formatter', array('opWidgetFormSelectFormatterMobile', 'formatter'));
            $widget->setOption('separator', "<br>\n");
        }
        if ($options['mark_required_field'] && !$validator instanceof sfValidatorPass && !$validator instanceof sfValidatorSchema && $validator->getOption('required')) {
            echo sprintf('<font color="%s">*</font>', opColorConfig::get('core_color_22'));
开发者ID:Kazuhiro-Murota,项目名称:OpenPNE3,代码行数:31,代码来源:_partsForm.php


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