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


PHP IControl::getValue方法代码示例

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


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

示例1: isLicenseValid

 /**
  * @param \Nette\Forms\IControl
  * @return bool
  */
 public function isLicenseValid(IControl $control)
 {
     $licenses = $control->getValue();
     if (is_string($licenses)) {
         $licenses = array_map('trim', explode(',', $licenses));
     }
     foreach ($licenses as $license) {
         if (!$this->validators->isLicenseValid($license)) {
             return FALSE;
         }
     }
     return TRUE;
 }
开发者ID:newPOPE,项目名称:web-addons.nette.org,代码行数:17,代码来源:FormValidators.php

示例2: validateFloat

 /**
  * Is a control's value float number?
  * @return bool
  */
 public static function validateFloat(IControl $control)
 {
     $value = str_replace(array(' ', ','), array('', '.'), $control->getValue());
     if (Validators::isNumeric($value)) {
         $control->setValue((double) $value);
         return TRUE;
     }
     return FALSE;
 }
开发者ID:rostenkowski,项目名称:nette,代码行数:13,代码来源:Validator.php

示例3: validateLength

 /**
  * Count/length validator. Range is array, min and max length pair.
  * @return bool
  * @internal
  */
 public static function validateLength(IControl $control, $range)
 {
     if (!is_array($range)) {
         $range = array($range, $range);
     }
     $value = $control->getValue();
     return Nette\Utils\Validators::isInRange(is_array($value) ? count($value) : Nette\Utils\Strings::length($value), $range);
 }
开发者ID:pdostal,项目名称:nette-blog,代码行数:13,代码来源:BaseControl.php

示例4: validateEqual

 /**
  * Equal validator: are control's value and second parameter equal?
  * @param  Nette\Forms\IControl
  * @param  mixed
  * @return bool
  */
 public static function validateEqual(IControl $control, $arg)
 {
     $value = $control->getValue();
     foreach (is_array($value) ? $value : array($value) as $val) {
         foreach (is_array($arg) ? $arg : array($arg) as $item) {
             if ((string) $val === (string) ($item instanceof IControl ? $item->value : $item)) {
                 return TRUE;
             }
         }
     }
     return FALSE;
 }
开发者ID:exesek,项目名称:nette20login,代码行数:18,代码来源:BaseControl.php

示例5: validateRange

 /**
  * Rangle validator: is a control's value number in specified range?
  * @param  Nette\Forms\IControl
  * @param  array  min and max value pair
  * @return bool
  */
 public static function validateRange(IControl $control, $range)
 {
     return Nette\Utils\Validators::isInRange($control->getValue(), $range);
 }
开发者ID:radeksimko,项目名称:nette,代码行数:10,代码来源:BaseControl.php

示例6: validateChecked

 /**
  * Filled validator: has been any checkbox checked?
  *
  * @param \Nette\Forms\IControl $control
  * @return bool
  */
 public static function validateChecked(Nette\Forms\IControl $control)
 {
     return $control->getValue() !== NULL;
 }
开发者ID:bazo,项目名称:translation-ui,代码行数:10,代码来源:CheckboxList.php

示例7: validateFilled

 /**
  * Filled validator: is control filled?
  * @param  IControl
  * @return bool
  */
 public static function validateFilled(IControl $control)
 {
     return count($control->getValue()) !== 0;
 }
开发者ID:svobodni,项目名称:web,代码行数:9,代码来源:TagsInput.php

示例8: validateRange

 /**
  * Is entered values within allowed range?
  *
  * @author   Jan Tvrdík
  * @param    DatePicker
  * @param    array             0 => minDate, 1 => maxDate
  * @return   bool
  */
 public static function validateRange(Nette\Forms\IControl $control, $range)
 {
     return ($range[0] === NULL || $control->getValue() >= $range[0]) && ($range[1] === NULL || $control->getValue() <= $range[1]);
 }
开发者ID:soundake,项目名称:pd,代码行数:12,代码来源:DatePicker.php

示例9: validateValid

 /**
  * @param BaseDateTime
  * @return bool
  */
 public static function validateValid(\Nette\Forms\IControl $control)
 {
     $value = $control->getValue();
     return is_null($value) || $value instanceof DateTime;
 }
开发者ID:ludik1,项目名称:transport_company,代码行数:9,代码来源:BaseDateTime.php

示例10: negativeNumber

 public static function negativeNumber(IControl $control)
 {
     return (int) $control->getValue() < 0;
 }
开发者ID:zaxcms,项目名称:forms,代码行数:4,代码来源:TestValidator.php

示例11:

IControl?(object)array('control'=>$rule->arg->getHtmlName()):$rule->arg;}$payload[]=$item;}return$payload;}static
function
validateEqual(IControl$control,$arg){$value=$control->getValue();foreach((is_array($value)?$value:array($value))as$val){foreach((is_array($arg)?$arg:array($arg))as$item){if((string)$val===(string)($item
instanceof
IControl?$item->value:$item)){return
TRUE;}}}return
FALSE;}static
开发者ID:JanTvrdik,项目名称:NetteExtras,代码行数:7,代码来源:loader.php

示例12: validateFilled

 /**
  * Filled validator: has been any file uploaded?
  * @param Forms\IControl
  * @return bool
  */
 public static function validateFilled(Forms\IControl $control)
 {
     $files = $control->getValue();
     return count($files) > 0;
 }
开发者ID:jurasm2,项目名称:multiplefileupload,代码行数:10,代码来源:MultipleFileUpload.php

示例13: validateRange

 /**
  * Validates range
  *
  * @param \Nette\Forms\IControl $control control
  * @param array $range minimum and maximum dates and times
  * @return bool
  */
 public static function validateRange(IControl $control, $range)
 {
     if ($control->getValue() !== '') {
         if ($control->range['min'] !== NULL) {
             if ($control->getValue() < $control->range['min']) {
                 return FALSE;
             }
         }
         if ($control->range['max'] !== NULL) {
             if ($control->getValue() > $control->range['max']) {
                 return FALSE;
             }
         }
     }
     return TRUE;
 }
开发者ID:radekdostal,项目名称:nette-datetimepicker,代码行数:23,代码来源:AbstractDateTimePicker.php

示例14: validateFilled

	/**
	 * Filled validator: has been any filed?
	 *
	 * @param  \Nette\Forms\IControl
	 * @return bool
	 */
	public static function validateFilled(\Nette\Forms\IControl $control)
	{
		return (bool) count(array_filter(
			$control->getValue(), function($file) {
				return $file instanceof FileUpload && $file->isOK();
			}
		));
	}
开发者ID:norbe,项目名称:framework,代码行数:14,代码来源:MultipleFileUpload.php

示例15: validateMinDistanceFrom

 public static function validateMinDistanceFrom(IControl $control, array $args)
 {
     list($distance, $point) = $args;
     return $control->getValue()->getDistanceTo(new GpsPoint($point)) >= $distance;
 }
开发者ID:impala23,项目名称:nette-forms-gpspicker,代码行数:5,代码来源:GpsPositionPicker.php


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