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


PHP Hash::set方法代码示例

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


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

示例1: setLabel

 /**
  * Add a label
  *
  * @return void
  * @author Justin Palmer
  **/
 public static function setLabel($key, $value)
 {
     if (!self::$Labels instanceof Hash) {
         self::$Labels = new Hash();
     }
     self::$Labels->set($key, $value);
 }
开发者ID:ToddBudde,项目名称:phrails,代码行数:13,代码来源:FlashForm.php

示例2: send

 /**
  * 	Send email $to with using the $template file in the
  * 	/app/view/email/ directory otherwise you changed {@link $viewDir}
  * 	@param $to
  * 	@param string			$template	Filename of template to use
  * 	@param string			$subject		Optional alternate subject that should be used
  * 	@param array(string)	$data		optional additional associated array data to render in the view
  * 	@return boolean	true if mail was successfully send, otherwise false
  */
 public function send($to, $template, $subject = null, $data = array())
 {
     // use user logged in email for reply adress
     if ($this->controller->UserLogin->loggedin()) {
         $this->headers->set('Reply-To', $this->controller->UserLogin->User->get('email'));
         $this->headers->set('From', $this->controller->UserLogin->User->get('email'));
     }
     // render content
     $view = Library::create('ephFrame.lib.view.View', array($this->viewDir, $template, array_merge($this->controller->data->toArray(), $data)));
     $view->theme = $this->controller->theme;
     // send mail and return result
     return @mail($to, $subject == null ? $this->subject : $subject, $view->render(), $this->headers->implodef(RTLF, '%s: %s'));
 }
开发者ID:Ephigenia,项目名称:harrison,代码行数:22,代码来源:ViewMailer.php

示例3: rule

 /**
  * Add a rule to a column
  *
  * @return void
  * @author Justin Palmer
  **/
 public function rule($column, Rule $rule)
 {
     //Make sure the property exists.
     $this->model->hasProperty($column);
     if ($rule instanceof RequiredRule) {
         $this->required[] = $column;
     }
     //Get the rules for this property.
     $rules = $this->rules->get($column);
     if ($rules === null) {
         $rules = array();
     }
     $rules[] = $rule;
     $this->rules->set($column, $rules);
 }
开发者ID:ToddBudde,项目名称:phrails,代码行数:21,代码来源:Schema.php

示例4: decodeHash

 public function decodeHash()
 {
     $h = new Hash();
     $this->nextToken();
     $this->skipBlanks();
     if ($this->c === 125) {
         $this->nextToken();
         return $h;
     }
     while ($this->c !== 125) {
         $key = $this->decodeString();
         $this->skipBlanks();
         if ($this->c !== 58) {
             throw new HException("Expected ':'.");
         }
         $this->nextToken();
         $this->skipBlanks();
         $o = $this->localDecode();
         $h->set($key, $o);
         $this->skipBlanks();
         if ($this->c === 44) {
             $this->nextToken();
             $this->skipBlanks();
         } else {
             if ($this->c !== 125) {
                 throw new HException("Expected ',' or '}'. " . $this->getPositionRepresentation());
             }
         }
         unset($o, $key);
     }
     $this->nextToken();
     return $h;
 }
开发者ID:komcdo,项目名称:winnow,代码行数:33,代码来源:JSon.class.php

示例5: __set

 /**
  * __set vars
  *
  * @return void
  * @author Justin Palmer
  **/
 public function __set($key, $value)
 {
     if (!$this->columns()->isKey($key)) {
         throw new NoColumnInTableException($key, $this->table_name());
     }
     $this->props_changed[] = $key;
     $this->props->set($key, $value);
 }
开发者ID:ToddBudde,项目名称:phrails,代码行数:14,代码来源:Model.php

示例6: hashOfAssociativeArray

 static function hashOfAssociativeArray($arr)
 {
     $h = new Hash();
     reset($arr);
     while (list($k, $v) = each($arr)) {
         $h->set($k, $v);
     }
     return $h;
 }
开发者ID:ralcr,项目名称:Apple-s-Dictionary-App-database-generator,代码行数:9,代码来源:Lib.class.php

示例7: fromProperties

 static function fromProperties($prop)
 {
     $ht = new Hash();
     $key = "";
     $value = "";
     foreach ($prop as $key => $value) {
         $ht->set($key, $value);
     }
     return $ht;
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:10,代码来源:PropertiesTools.class.php

示例8: computeInverse

 static function computeInverse($dict)
 {
     $keys = $dict->keys();
     $outDict = new Hash();
     while ($keys->hasNext()) {
         $key = $keys->next();
         $outDict->set($dict->get($key), $key);
         unset($key);
     }
     return $outDict;
 }
开发者ID:komcdo,项目名称:winnow,代码行数:11,代码来源:ConfigurationKeys.class.php

示例9: key

 public function key()
 {
     $reg = "^";
     $chars = _hx_explode("", $this->str);
     $ch = "";
     $inKey = false;
     $keyName = "";
     $matchIndex = 0;
     $keys = new Hash();
     while (($ch = $chars->shift()) !== null) {
         if ($ch == ":") {
             $matchIndex++;
             $keyName = "";
             $inKey = true;
         } else {
             if ($inKey && _hx_deref(new EReg("[^a-z]", "i"))->match($ch)) {
                 $inKey = false;
                 $keys->set($keyName, $matchIndex);
                 $reg .= "([a-zA-Z0-9]+)" . $this->escape($ch);
             } else {
                 if ($inKey) {
                     $keyName .= $ch;
                 } else {
                     $reg .= $this->escape($ch);
                 }
             }
         }
     }
     if ($inKey) {
         $keys->set($keyName, $matchIndex);
         $reg .= "([a-zA-Z0-9]+)";
     }
     $reg .= "\$";
     haxe_Log::trace("(key) From pattern: " . $this->str . " we created expression: " . $reg . " and found these keys: " . $keys, _hx_anonymous(array("fileName" => "Route.hx", "lineNumber" => 144, "className" => "sinatra.RouteParser", "methodName" => "key")));
     return new EReg($reg, "");
 }
开发者ID:slaskis,项目名称:hxsinatra,代码行数:36,代码来源:RouteParser.class.php

示例10: Hash

 function __construct(Controller $controller)
 {
     $this->controller = $controller;
     $filters = new Hash();
     $filters->set(self::before, new Hash());
     $filters->set($this->exceptName(self::before), new Hash());
     $filters->set(self::around, new Hash());
     $filters->set($this->exceptName(self::around), new Hash());
     $filters->set(self::after, new Hash());
     $filters->set($this->exceptName(self::after), new Hash());
     $this->filters = $filters;
 }
开发者ID:ToddBudde,项目名称:phrails,代码行数:12,代码来源:Filters.php

示例11: computeDigest

 public function computeDigest($mml, $param)
 {
     $ss = $this->getEditorParametersList();
     $i = null;
     $renderParams = new Hash();
     $_g1 = 0;
     $_g = $ss->length;
     while ($_g1 < $_g) {
         $i1 = $_g1++;
         $key = $ss[$i1];
         $value = com_wiris_system_PropertiesTools::getProperty($param, $key, null);
         if ($value !== null) {
             $renderParams->set($key, $value);
         }
         unset($value, $key, $i1);
     }
     if ($mml !== null) {
         $renderParams->set("mml", $mml);
     }
     $s = com_wiris_util_sys_IniFile::propertiesToString($renderParams);
     return $this->plugin->getStorageAndCache()->codeDigest($s);
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:22,代码来源:RenderImpl.class.php

示例12: getMultipart

 static function getMultipart($maxSize)
 {
     $h = new Hash();
     $buf = null;
     $curname = null;
     php_Web::parseMultipart(array(new _hx_lambda(array(&$buf, &$curname, &$h, &$maxSize), "php_Web_1"), 'execute'), array(new _hx_lambda(array(&$buf, &$curname, &$h, &$maxSize), "php_Web_2"), 'execute'));
     if ($curname !== null) {
         $h->set($curname, $buf->b);
     }
     return $h;
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:11,代码来源:Web.class.php

示例13: getMultipart

 static function getMultipart($maxSize)
 {
     $h = new Hash();
     $buf = null;
     $curname = null;
     php_Web::parseMultipart(array(new _hx_lambda(array("buf" => &$buf, "curname" => &$curname, "h" => &$h, "maxSize" => &$maxSize), null, array('p', '_'), "{\n\t\t\tif(\$curname !== null) {\n\t\t\t\t\$h->set(\$curname, \$buf->b);\n\t\t\t}\n\t\t\t\$curname = \$p;\n\t\t\t\$buf = new StringBuf();\n\t\t\t\$maxSize -= strlen(\$p);\n\t\t\tif(\$maxSize < 0) {\n\t\t\t\tthrow new HException(\"Maximum size reached\");\n\t\t\t}\n\t\t}"), 'execute2'), array(new _hx_lambda(array("buf" => &$buf, "curname" => &$curname, "h" => &$h, "maxSize" => &$maxSize), null, array('str', 'pos', 'len'), "{\n\t\t\t\$maxSize -= \$len;\n\t\t\tif(\$maxSize < 0) {\n\t\t\t\tthrow new HException(\"Maximum size reached\");\n\t\t\t}\n\t\t\t\$buf->b .= _hx_substr(\$str, \$pos, \$len);\n\t\t}"), 'execute3'));
     if ($curname !== null) {
         $h->set($curname, $buf->b);
     }
     return $h;
 }
开发者ID:slaskis,项目名称:hxsinatra,代码行数:11,代码来源:Web.class.php


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