I am working with smarty , All setup is done on my local server.
I have Problem with accessing root directory .Please read two cases.
Case 1: Below setup code is working when I am opening this url
http://localhost/shopping/login.php.
then out put is
Smarty Installation test...
Testing template directory...
/Applications/XAMPP/xamppfiles/htdocs/shopping/templates is OK.
Testing compile directory...
/Applications/XAMPP/xamppfiles/htdocs/shopping/templates_c is OK.
Testing plugins directory...
Testing cache directory...
/Applications/XAMPP/xamppfiles/htdocs/shopping/cache is OK.
Testing configs directory...
/Applications/XAMPP/xamppfiles/htdocs/shopping/configs/ is OK.
Tests complete.
case 2: теперь, когда я открываю "http: //localhost/shopping/ui/purchaseorder.php" Это вывод.
Smarty Installation Test ...
Testing template directory...
FAILED: /Applications/XAMPP/xamppfiles/htdocs/shopping/UI/templates/ does not exist.
Testing compile directory...
FAILED: /Applications/XAMPP/xamppfiles/htdocs/shopping/UI/templates_c/ does not exist.
Testing plugins directory...
Testing cache directory...
FAILED: /Applications/XAMPP/xamppfiles/htdocs/shopping/UI/cache/ does not exist.
Testing configs directory...
FAILED: /Applications/XAMPP/xamppfiles/htdocs/shopping/UI/configs/ is not a directory.
Tests complete.
< /code>
Пожалуйста, смотрите этот код настройки, задача с этим кодом это предполагает, что URL -адрес является корневым каталогом.
здесь постоянно < /p>
// echo ROOT_URL;
define('ROOT_DIR',dirname(__FILE__).'/');
define('TEMPLATES_DIR',ROOT_DIR.'templates/');
define('TEMPLATES_C_DIR',ROOT_DIR.'templates_c/');
define('TEMPLATES_CACHE_DIR',ROOT_DIR.'cache/');
define('TEMPLATES_CONFIGS_DIR',ROOT_DIR.'configs/');
use Smarty\Smarty;
$smarty = new Smarty();
$smarty->setTemplateDir =TEMPLATES_DIR;
$smarty->setCompileDir =TEMPLATES_C_DIR;
$smarty->setTemplateDir =TEMPLATES_CACHE_DIR;
$smarty->setCacheDir =TEMPLATES_CONFIGS_DIR;
$smarty->caching = 0;
$smarty->testInstall();
Подробнее здесь: https://stackoverflow.com/questions/796 ... -in-smarty
Корневой каталог отсутствует в Smarty ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение