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


PHP Set::set方法代碼示例

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


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

示例1: set

 /**
  * @param string $key
  * @param Tag    $tag
  *
  * @throws InvalidTagException if the passed $value is not a Tag
  */
 public function set($key, $tag)
 {
     if ($tag instanceof Tag) {
         throw InvalidTagException::build([], ['invalidTag' => $tag]);
     }
     parent::set($key, $tag);
 }
開發者ID:cubicmushroom,項目名稱:slim-service-manager,代碼行數:13,代碼來源:TagSet.php

示例2: set

 /**
  * Set cookie
  *
  * The second argument may be a single scalar value, in which case
  * it will be merged with the default settings and considered the `value`
  * of the merged result.
  *
  * The second argument may also be an array containing any or all of
  * the keys shown in the default settings above. This array will be
  * merged with the defaults shown above.
  *
  * @param string $key   Cookie name
  * @param mixed  $value Cookie settings
  */
 public function set($key, $value)
 {
     if (is_array($value)) {
         $cookieSettings = array_replace($this->defaults, $value);
     } else {
         $cookieSettings = array_replace($this->defaults, array('value' => $value));
     }
     parent::set($key, $cookieSettings);
 }
開發者ID:patrickglasgow,項目名稱:HonsProject,代碼行數:23,代碼來源:Cookies.php

示例3: setData

 /**
  * DEPRECATION WARNING! This method will be removed in the next major point release
  *
  * Set data for view
  */
 public function setData()
 {
     $args = func_get_args();
     if (count($args) === 1 && is_array($args[0])) {
         $this->data->replace($args[0]);
     } elseif (count($args) === 2) {
         $this->data->set($args[0], $args[1]);
     } else {
         throw new \InvalidArgumentException('Cannot set View data with provided arguments. Usage: `View::setData( $key, $value );` or `View::setData([ key => value, ... ]);`');
     }
 }
開發者ID:mt8,項目名稱:wp-slim-framework,代碼行數:16,代碼來源:View.php

示例4: setData

 /**
  * DEPRECATION WARNING! This method will be removed in the next major point release
  *
  * Set data for view
  */
 public function setData()
 {
     $args = func_get_args();
     if (count($args) === 1 && is_array($args[0])) {
         $this->data->replace($args[0]);
     } elseif (count($args) === 2) {
         // Ensure original behavior is maintained. DO NOT invoke stored Closures.
         if (is_object($args[1]) && method_exists($args[1], '__invoke')) {
             $this->data->set($args[0], $this->data->protect($args[1]));
         } else {
             $this->data->set($args[0], $args[1]);
         }
     } else {
         throw new \InvalidArgumentException('Cannot set View data with provided arguments. Usage: `View::setData( $key, $value );` or `View::setData([ key => value, ... ]);`');
     }
 }
開發者ID:nakaikaz,項目名稱:SlotGame,代碼行數:21,代碼來源:View.php

示例5: __set

 public function __set($name, $value)
 {
     $this->container->set($name, $value);
 }
開發者ID:boeingtuan,項目名稱:task-manager,代碼行數:4,代碼來源:Slim.php


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