當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TPropertyValue::ensureString方法代碼示例

本文整理匯總了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);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:12,代碼來源:TJuiCallbackPageStateTracker.php

示例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));
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:20,代碼來源:TException.php

示例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));
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:22,代碼來源:TSqlMapException.php

示例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), '');
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:10,代碼來源:TCaptchaValidator.php

示例5: setCacheKey

 /**
  * @param string cache key to be appended to the default calculation scheme
  */
 public function setCacheKey($value)
 {
     $this->_cacheKey = TPropertyValue::ensureString($value);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:7,代碼來源:TOutputCacheCalculateKeyEventParameter.php

示例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), '');
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:7,代碼來源:TTabPanel.php

示例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), '');
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:7,代碼來源:TWizard.php

示例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, ''), '');
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:8,代碼來源:TPager.php

示例9: setValue

 /**
  * @param string value of the item
  */
 public function setValue($value)
 {
     $this->_value = TPropertyValue::ensureString($value);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:7,代碼來源:TListItem.php

示例10: setHandle

 /**
  * Set the handle id or css class
  * @param string
  */
 public function setHandle($value)
 {
     $this->setViewState('DragHandle', TPropertyValue::ensureString($value), null);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:8,代碼來源:TDraggable.php

示例11: setTagName

 /**
  * @param string the tag name of this control.
  */
 public function setTagName($value)
 {
     $this->_tagName = TPropertyValue::ensureString($value);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:7,代碼來源:THtmlElement.php

示例12: setHashAlgorithm

 /**
  * @param string hashing algorithm used to generate HMAC.
  */
 public function setHashAlgorithm($value)
 {
     $this->_hashAlgorithm = TPropertyValue::ensureString($value);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:7,代碼來源:TSecurityManager.php

示例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);
         }
     }
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:32,代碼來源:TListControl.php

示例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);
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:9,代碼來源:TConditional.php

示例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));
 }
開發者ID:pradosoft,項目名稱:prado,代碼行數:10,代碼來源:TKeyboard.php


注:本文中的Prado\TPropertyValue::ensureString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。