Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
Changed regex
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed May 4, 2014
1 parent adca9d0 commit 0ef6302
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ $view->updateCompile();
// Were the files current before render() was run?
$view->wasCacheCurrent();
$view->wasCompileCurrent();

// Is the template error free?
$view->isTemplateValid();

// Get the error information for the template
$view->getTemplateError();

// Get an array of loaded plugins
$view->getLoadedPlugins();

// Get the number of loaded plugins
$view->getNumberLoadedPlugins();
```

# Plugins
Expand Down
10 changes: 5 additions & 5 deletions src/SurfStack/Templating/Template_Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ protected function loadPlugins()
switch ($parent)
{
case 'Block':
$return[$name] = '/\{\s*('.$name.')\s*(.*?)\}(.[^\}\{]*?)\{\/\s*'.$name.'\s*\}/i';
$return[$name] = '/\{\s*('.$name.')\s*(.*?)\}(.*?)\{\/\s*'.$name.'\s*\}/i';
break;
case 'Slice':
$return[$name] = '/\{\s*('.$name.')\s*(.*?)\}/i';
Expand All @@ -665,7 +665,7 @@ protected function loadPlugins()
* Get an array of loaded plugins
* @return array
*/
public function getLoadedPlugins()
function getLoadedPlugins()
{
return $this->getInternal('PluginsLoaded');
}
Expand All @@ -674,7 +674,7 @@ public function getLoadedPlugins()
* Get the number of loaded plugins
* @return int
*/
public function getNumberLoadedPlugins()
function getNumberLoadedPlugins()
{
return $this->getInternal('PluginCount');
}
Expand Down Expand Up @@ -902,11 +902,11 @@ function isTemplateValid()
}

/**
* Returns an array of error information from error_get_last() for the template
* Returns an array of error information from error_get_last() for the compile template
* or an empty array if successful
* @return array
*/
function getCompileTemplateError()
function getTemplateError()
{
// If the compile is not current
if (!$this->isCompileCurrent())
Expand Down
2 changes: 1 addition & 1 deletion tests/SurfStack/Templating/Template_Engine_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function testVariableSliceBadMessage()

$this->view->setTemplate('sliceVariable.tpl');

$arr = $this->view->getCompileTemplateError();
$arr = $this->view->getTemplateError();

$this->assertSame($arr['message'], 'Undefined variable: missing');
}
Expand Down

0 comments on commit 0ef6302

Please sign in to comment.