Commit f9cc66d3 by Seldaek

git-svn-id: svn://dwoo.org/dwoo/trunk@51 0598d79b-80c4-4d41-97ba-ac86fbbd088b

parent dc02338d
...@@ -322,7 +322,7 @@ class Dwoo ...@@ -322,7 +322,7 @@ class Dwoo
// try to get cached template // try to get cached template
$file = $_tpl->getCachedTemplate($this); $file = $_tpl->getCachedTemplate($this);
$doCache = $file === true; $doCache = $file === true;
$cacheLoaded = $doCache === false && is_string($file); $cacheLoaded = is_string($file);
// cache is present, run it // cache is present, run it
if($cacheLoaded === true) if($cacheLoaded === true)
...@@ -366,7 +366,7 @@ class Dwoo ...@@ -366,7 +366,7 @@ class Dwoo
$this->template = null; $this->template = null;
// building cache // building cache
if($doCache) if($doCache === true)
{ {
$_tpl->cache($this, $out); $_tpl->cache($this, $out);
if($_output === true) if($_output === true)
...@@ -777,16 +777,24 @@ class Dwoo ...@@ -777,16 +777,24 @@ class Dwoo
{ {
if(is_array($value) === true) if(is_array($value) === true)
{ {
if($checkIsEmpty) if($checkIsEmpty === false)
return count($value) > 0;
else
return true; return true;
else
return count($value) > 0;
} }
elseif($value instanceof Iterator) elseif($value instanceof Iterator)
{ {
if($checkIsEmpty) if($checkIsEmpty === false)
{
return true;
}
else
{
if($allowNonCountable === false)
{ {
if($allowNonCountable) return count($value) > 0;
}
else
{ {
if($value instanceof Countable) if($value instanceof Countable)
return count($value) > 0; return count($value) > 0;
...@@ -796,11 +804,7 @@ class Dwoo ...@@ -796,11 +804,7 @@ class Dwoo
return $value->valid(); return $value->valid();
} }
} }
else
return count($value) > 0;
} }
else
return true;
} }
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment