Skip to content

Commit

Permalink
$cell_data = [];
Browse files Browse the repository at this point in the history
if($test_data !== NULL) { // optional cell datas
	$cell_data[‘test’] = $test_data;
}
view_cell(‘test’, $cell_data); // array_key_exists null fix.
  • Loading branch information
byazrail committed Nov 29, 2016
1 parent 0a8b199 commit 6816f12
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions system/View/Cell.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function render(string $library, $params = null, int $ttl = 0, string $ca
}
elseif (
($paramCount === 1)
&& ($paramArray !== null)
&& (
(! array_key_exists($refParams[0]->name, $paramArray))
|| (
Expand All @@ -111,20 +112,23 @@ public function render(string $library, $params = null, int $ttl = 0, string $ca
$fireArgs = [];
$method_params = [];

foreach($refParams as $arg)
if($paramArray !== null)
{
$method_params[$arg->name] = true;
if (array_key_exists($arg->name, $paramArray))
foreach($refParams as $arg)
{
$fireArgs[$arg->name] = $paramArray[$arg->name];
$method_params[$arg->name] = true;
if (array_key_exists($arg->name, $paramArray))
{
$fireArgs[$arg->name] = $paramArray[$arg->name];
}
}
}

foreach ($paramArray as $key => $val)
{
if (! isset($method_params[$key]))
foreach ($paramArray as $key => $val)
{
throw new \InvalidArgumentException("{$key} is not a valid param name.");
if (! isset($method_params[$key]))
{
throw new \InvalidArgumentException("{$key} is not a valid param name.");
}
}
}

Expand Down Expand Up @@ -225,4 +229,4 @@ protected function determineClass(string $library)
}

//--------------------------------------------------------------------
}
}

0 comments on commit 6816f12

Please sign in to comment.