mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Support passing a single array to Context::gets()
This commit is contained in:
parent
202c0172b3
commit
0e5797882f
1 changed files with 7 additions and 4 deletions
|
|
@ -2024,17 +2024,20 @@ class Context
|
||||||
/**
|
/**
|
||||||
* Get one more vars in object vars with given arguments(key1, key2, key3,...)
|
* Get one more vars in object vars with given arguments(key1, key2, key3,...)
|
||||||
*
|
*
|
||||||
* @return object
|
* @return ?object
|
||||||
*/
|
*/
|
||||||
public static function gets()
|
public static function gets()
|
||||||
{
|
{
|
||||||
$num_args = func_num_args();
|
$args_list = func_get_args();
|
||||||
if($num_args < 1)
|
if (count($args_list) < 1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (count($args_list) === 1 && is_array($args_list[0]))
|
||||||
|
{
|
||||||
|
$args_list = $args_list[0];
|
||||||
|
}
|
||||||
|
|
||||||
$args_list = func_get_args();
|
|
||||||
$output = new stdClass;
|
$output = new stdClass;
|
||||||
self::$_user_vars = self::$_user_vars !== null ? self::$_user_vars : new stdClass;
|
self::$_user_vars = self::$_user_vars !== null ? self::$_user_vars : new stdClass;
|
||||||
foreach($args_list as $key)
|
foreach($args_list as $key)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue