本文整理汇总了PHP中Prado\TPropertyValue::ensureString方法的典型用法代码示例。如果您正苦于以下问题:PHP TPropertyValue::ensureString方法的具体用法?PHP TPropertyValue::ensureString怎么用?PHP TPropertyValue::ensureString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prado\TPropertyValue
的用法示例。
在下文中一共展示了TPropertyValue::ensureString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateJuiOptions
/**
* Updates the options of the jQueryUI widget.
* @param array list of widget options to change.
*/
protected function updateJuiOptions($options)
{
foreach ($options as $key => $value) {
$options[$key] = $key . ': ' . (is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value));
}
$code = "jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { " . implode(', ', $options) . " });";
$this->_control->getPage()->getClientScript()->registerEndScript(sprintf('%08X', crc32($code)), $code);
}
示例2: __construct
/**
* Constructor.
* @param string error message. This can be a string that is listed
* in the message file. If so, the message in the preferred language
* will be used as the error message. Any rest parameters will be used
* to replace placeholders ({0}, {1}, {2}, etc.) in the message.
*/
public function __construct($errorMessage)
{
$this->_errorCode = $errorMessage;
$errorMessage = $this->translateErrorMessage($errorMessage);
$args = func_get_args();
array_shift($args);
$n = count($args);
$tokens = array();
for ($i = 0; $i < $n; ++$i) {
$tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]);
}
parent::__construct(strtr($errorMessage, $tokens));
}
示例3: __construct
/**
* Constructor, similar to the parent constructor. For parameters that
* are of SimpleXmlElement, the tag name and its attribute names and values
* are expanded into a string.
*/
public function __construct($errorMessage)
{
$this->setErrorCode($errorMessage);
$errorMessage = $this->translateErrorMessage($errorMessage);
$args = func_get_args();
array_shift($args);
$n = count($args);
$tokens = array();
for ($i = 0; $i < $n; ++$i) {
if ($args[$i] instanceof SimpleXMLElement) {
$tokens['{' . $i . '}'] = $this->implodeNode($args[$i]);
} else {
$tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]);
}
}
parent::__construct(strtr($errorMessage, $tokens));
}
示例4: setCaptchaControl
/**
* Sets the ID path of the CAPTCHA control to validate.
* The ID path is the dot-connected IDs of the controls reaching from
* the validator's naming container to the target control.
* @param string the ID path
*/
public function setCaptchaControl($value)
{
$this->setViewState('CaptchaControl', TPropertyValue::ensureString($value), '');
}
示例5: setCacheKey
/**
* @param string cache key to be appended to the default calculation scheme
*/
public function setCacheKey($value)
{
$this->_cacheKey = TPropertyValue::ensureString($value);
}
示例6: setCssUrl
/**
* @param string URL for the CSS file including all relevant CSS class definitions.
*/
public function setCssUrl($value)
{
$this->setViewState('CssUrl', TPropertyValue::ensureString($value), '');
}
示例7: setFinishDestinationUrl
/**
* @param string the URL that the browser will be redirected to if the wizard finishes.
*/
public function setFinishDestinationUrl($value)
{
$this->setViewState('FinishDestinationUrl', TPropertyValue::ensureString($value), '');
}
示例8: setButtonCssClass
/**
* @param Sets the css class of the buttons that will be rendered by this pager.
* @since 3.2.1
*/
public function setButtonCssClass($value)
{
$this->setViewState('ButtonCssClass', TPropertyValue::ensureString($value, ''), '');
}
示例9: setValue
/**
* @param string value of the item
*/
public function setValue($value)
{
$this->_value = TPropertyValue::ensureString($value);
}
示例10: setHandle
/**
* Set the handle id or css class
* @param string
*/
public function setHandle($value)
{
$this->setViewState('DragHandle', TPropertyValue::ensureString($value), null);
}
示例11: setTagName
/**
* @param string the tag name of this control.
*/
public function setTagName($value)
{
$this->_tagName = TPropertyValue::ensureString($value);
}
示例12: setHashAlgorithm
/**
* @param string hashing algorithm used to generate HMAC.
*/
public function setHashAlgorithm($value)
{
$this->_hashAlgorithm = TPropertyValue::ensureString($value);
}
示例13: formatDataValue
/**
* Formats the text value according to a format string.
* If the format string is empty, the original value is converted into
* a string and returned.
* If the format string starts with '#', the string is treated as a PHP expression
* within which the token '{0}' is translated with the data value to be formated.
* Otherwise, the format string and the data value are passed
* as the first and second parameters in {@link sprintf}.
* @param string format string
* @param mixed the data to be formatted
* @return string the formatted result
*/
protected function formatDataValue($formatString, $value)
{
if ($formatString === '') {
return TPropertyValue::ensureString($value);
} else {
if ($formatString[0] === '#') {
$expression = strtr(substr($formatString, 1), array('{0}' => '$value'));
try {
if (eval("\$result={$expression};") === false) {
throw new Exception('');
}
return $result;
} catch (Exception $e) {
throw new TInvalidDataValueException('listcontrol_expression_invalid', get_class($this), $expression, $e->getMessage());
}
} else {
return sprintf($formatString, $value);
}
}
}
示例14: setCondition
/**
* Sets the PHP expression to be evaluated for conditionally displaying content.
* The context of the expression is the template control containing TConditional.
* @param string the PHP expression used for determining which template to use.
*/
public function setCondition($value)
{
$this->_condition = TPropertyValue::ensureString($value);
}
示例15: setForControl
/**
* Sets the ID path of the {@link TTextBox} control.
* The ID path is the dot-connected IDs of the controls reaching from
* the keyboard's naming container to the target control.
* @param string the ID path
*/
public function setForControl($value)
{
$this->setViewState('ForControl', TPropertyValue::ensureString($value));
}