public function setViewDir($view, $location, $viewtype = '')
{
$view = $this->canonicalizeViewName($view);
if (empty($viewtype)) {
$viewtype = 'default';
}
$location = rtrim($location, '/\\');
if ($this->fileExists("{$location}/{$viewtype}/{$view}.php")) {
$this->setViewLocation($view, $viewtype, "{$location}/{$viewtype}/{$view}.php");
} elseif ($this->fileExists("{$location}/{$viewtype}/{$view}")) {
$this->setViewLocation($view, $viewtype, "{$location}/{$viewtype}/{$view}");
}
}