*
* @return array The array of paths where to look for templates
*/
- public function getPaths($namespace = '')
+ public function getPaths($namespace = '__main__')
{
return isset($this->paths[$namespace]) ? $this->paths[$namespace] : array();
}
* @param string|array $paths A path or an array of paths where to look for templates
* @param string $namespace A path namespace
*/
- public function setPaths($paths, $namespace = '')
+ public function setPaths($paths, $namespace = '__main__')
{
if (!is_array($paths)) {
$paths = array($paths);
* @param string $path A path where to look for templates
* @param string $namespace A path name
*/
- public function addPath($path, $namespace = '')
+ public function addPath($path, $namespace = '__main__')
{
// invalidate the cache
$this->cache = array();
* @param string $path A path where to look for templates
* @param string $namespace A path name
*/
- public function prependPath($path, $namespace = '')
+ public function prependPath($path, $namespace = '__main__')
{
// invalidate the cache
$this->cache = array();
$this->validateName($name);
- $namespace = '';
+ $namespace = '__main__';
if (isset($name[0]) && '@' == $name[0]) {
if (false === $pos = strpos($name, '/')) {
throw new \InvalidArgumentException(sprintf('Malformed template name "%s".', $name));
), $loader->getPaths('named'));
$this->assertEquals("path (final)\n", $loader->getSource('index.html'));
+ $this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html'));
$this->assertEquals("named path (final)\n", $loader->getSource('@named/index.html'));
}
}