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


PHP Arrays::isArray方法代碼示例

本文整理匯總了PHP中Thin\Arrays::isArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Arrays::isArray方法的具體用法?PHP Arrays::isArray怎麽用?PHP Arrays::isArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Thin\Arrays的用法示例。


在下文中一共展示了Arrays::isArray方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resolveCommands

 /**
  * Resolve an array of commands through the application.
  *
  * @param  array|dynamic  $commands
  * @return void
  */
 public function resolveCommands($commands)
 {
     $commands = Arrays::isArray($commands) ? $commands : func_get_args();
     foreach ($commands as $command) {
         $this->resolve($command);
     }
 }
開發者ID:schpill,項目名稱:thin,代碼行數:13,代碼來源:Application.php

示例2: render

 /**
  * Render the gravatar image HTML
  *
  * @param array $options [optional] The email to be used to generate the URL
  * or a keyed array of option=>value pairs, for example:
  * <code>
  * echo $gravatar->render('john@johndoe.com');
  * </code>
  * or
  * <code>
  * echo $gravatar->render([
  *     $gravatar::OPTION_EMAIL      => 'john@johndoe.com',
  *     $gravatar::OPTION_IMAGE_SIZE => 120
  * ]);
  * </code>
  *
  * @return string The img HTML tag containing the gravatar image
  *
  *
  */
 public function render($options = array())
 {
     // check if the input is an array, and if not, assume it's an email address
     if (!\Thin\Arrays::isArray($options)) {
         $options = [self::OPTION_EMAIL => strval($options)];
     }
     $options = $options + $this->options;
     // set HTML attributes
     $attributes = new \Thin\Html\Attributes();
     $attributes->set($this->attributes)->set('src', $this->getUrl($options))->set('width', $options[self::OPTION_IMAGE_SIZE])->set('height', $options[self::OPTION_IMAGE_SIZE]);
     // build the HTML output and return it
     return "<img {$attributes} />";
 }
開發者ID:schpill,項目名稱:thin,代碼行數:33,代碼來源:Gravatar.php

示例3: __set

 /**
  * Set a value in the config.
  *
  * Only allow setting of a property if $allowModifications  was set to true
  * on construction. Otherwise, throw an exception.
  *
  * @param  string $name
  * @param  mixed  $value
  * @return void
  * @throws Exception\RuntimeException
  */
 public function __set($name, $value)
 {
     if ($this->allowModifications) {
         if (Arrays::isArray($value)) {
             $value = new static($value, true);
         }
         if (null === $name) {
             $this->data[] = $value;
         } else {
             $this->data[$name] = $value;
         }
         $this->count++;
     } else {
         throw new Exception\RuntimeException('Config is read only');
     }
 }
開發者ID:schpill,項目名稱:thin,代碼行數:27,代碼來源:Setting.php


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