Skip to content

Commit

Permalink
Add render method for resources and booleans. Throw UnexpectedValueEx…
Browse files Browse the repository at this point in the history
…ception for resources.
  • Loading branch information
saltybeagle committed Oct 10, 2009
1 parent 5c149a1 commit 54c8d1b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Templates/Savant/Main.php
Expand Up @@ -580,6 +580,16 @@ function render($mixed = null, $template = null)
return $this->$method($mixed, $template);
}

protected function renderResource($resouce, $template = null)
{
throw new UnexpectedValueException('No way to render a resource!');
}

protected function renderBoolean($bool, $template = null)
{
return $this->renderString((string)$bool, $template);
}

protected function renderDouble($double, $template = null)
{
return $this->renderString($double, $template);
Expand Down
7 changes: 7 additions & 0 deletions src/Templates/Savant/UnexpectedValueException.php
@@ -0,0 +1,7 @@
<?php
namespace pear2\Templates\Savant;

class UnexpecteValueException implements Exception extends \UnexpectedValueException
{

}

0 comments on commit 54c8d1b

Please sign in to comment.