variable.templatesDir
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- o5
- Člen | 416
Bylo by mozne pridat do formatLayoutTemplateFiles() a formatTemplateFiles() promennou z configu napr.: variable.templatesDir?
https://api.nette.org/…esenter.html#…
https://api.nette.org/…esenter.html#…
/**
* Formats layout template file names.
* @param string
* @param string
* @return array
*/
public function formatLayoutTemplateFiles($presenter, $layout)
{
$appDir = Environment::getVariable('appDir');
$templatesDir = Environment::getVariable('templatesDir'); //+
$path = '/' . str_replace(':', 'Module/', $presenter);
$pathP = substr_replace($path, '/'.$templatesDir, strrpos($path, '/'), 0);
$list = array(
"$appDir$pathP/@$layout.phtml",
"$appDir$pathP.@$layout.phtml",
);
while (($path = substr($path, 0, strrpos($path, '/'))) !== FALSE) {
$list[] = "$appDir$path/$templatesDir/@$layout.phtml";
}
return $list;
}
/**
* Formats view template file names.
* @param string
* @param string
* @return array
*/
public function formatTemplateFiles($presenter, $view)
{
$appDir = Environment::getVariable('appDir');
$templatesDir = Environment::getVariable('templatesDir'); //+
$path = '/' . str_replace(':', 'Module/', $presenter);
$pathP = substr_replace($path, '/'.$templatesDir, strrpos($path, '/'), 0);
$path = substr_replace($path, '/'.$templatesDir, strrpos($path, '/'));
return array(
"$appDir$pathP/$view.phtml",
"$appDir$pathP.$view.phtml",
"$appDir$path/@global.$view.phtml",
);
}
- pave.kucera
- Člen | 122
Ta proměnná původně existovala, ale David ji zrušil. Viz https://forum.nette.org/…ura-a-moduly :)