Beckie
Новичок
Пробема с путями
Выдается ошибка:
ERRNO: 8
TEXT: Undefined property: DepartmentsList::$mCategoriesCell
LOCATION: C:\wamp\www\htdocs\shop\presentation\templates_c\1093619261.file.store_front.tpl.php, line 89, at November 16, 2009, 9:08 pm
Showing backtrace:
include("C:\wamp\www\htdocs\shop\presentation\templates_c\1093619261.file...") # line 431, file: C:\wamp\www\htdocs\shop\libs\smarty\sysplugins\smarty_internal_template.php
Smarty_Internal_Template.renderTemplate() # line 516, file: C:\wamp\www\htdocs\shop\libs\smarty\sysplugins\smarty_internal_template.php
Smarty_Internal_Template.getRenderedTemplate() # line 312, file: C:\wamp\www\htdocs\shop\libs\smarty\Smarty.class.php
Smarty.fetch("store_front.tpl", null, null, null) # line 333, file: C:\wamp\www\htdocs\shop\libs\smarty\Smarty.class.php
Smarty.display("store_front.tpl") # line 32, file: C:\wamp\www\htdocs\shop\index.php
А вот внутри 1093619261.file.store_front.tpl.php вот такое:
Настройки Smarty:
$this - это продолжение класса Smarty.
Содержимое файла константов:
httpd.conf Root:
DocumentRoot "c:/wamp/www/htdocs/"
Почему пути в Smarty другие? Как эту проблему решить?
-~{}~ 17.11.09 00:14:
Нашле проблему вот тут {include file=$obj->mCategoriesCell}
Теперь осталось выяснить, почему объект undefined.
Но вопрос про пути все еще открыт.
-~{}~ 17.11.09 13:56:
Когда вместо
Прописываю в ручную вот так:
То список выводится.
Вот содержимое для store_front.tpl, а точнее то, что хоть как-то относится к содержимому переменной, на которую ругаются :
Вот содержимое blank.tpl:
{* Smarty blank page *}
Остальные функции там ответственны за парсинг url и title.
Выдается ошибка:
ERRNO: 8
TEXT: Undefined property: DepartmentsList::$mCategoriesCell
LOCATION: C:\wamp\www\htdocs\shop\presentation\templates_c\1093619261.file.store_front.tpl.php, line 89, at November 16, 2009, 9:08 pm
Showing backtrace:
include("C:\wamp\www\htdocs\shop\presentation\templates_c\1093619261.file...") # line 431, file: C:\wamp\www\htdocs\shop\libs\smarty\sysplugins\smarty_internal_template.php
Smarty_Internal_Template.renderTemplate() # line 516, file: C:\wamp\www\htdocs\shop\libs\smarty\sysplugins\smarty_internal_template.php
Smarty_Internal_Template.getRenderedTemplate() # line 312, file: C:\wamp\www\htdocs\shop\libs\smarty\Smarty.class.php
Smarty.fetch("store_front.tpl", null, null, null) # line 333, file: C:\wamp\www\htdocs\shop\libs\smarty\Smarty.class.php
Smarty.display("store_front.tpl") # line 32, file: C:\wamp\www\htdocs\shop\index.php
А вот внутри 1093619261.file.store_front.tpl.php вот такое:
PHP:
$_smarty_tpl->decodeProperties('a:1:{s:15:"file_dependency";a:2:{s:11:"F2106305833";a:2:{i:0;s:62:"[B]C:\wamp\www\htdocs\shop/presentation/templates\store_front.tpl[/B]";i:1;i:1195995322;}s:11:"F1502188778";a:2:{i:0;s:67:"C:\wamp\www\htdocs\shop/presentation/templates\departments_list.tpl";i:1;i:1195046498;}}}');
$this - это продолжение класса Smarty.
PHP:
$this->template_dir = TEMPLATE_DIR;
$this->compile_dir = COMPILE_DIR;
$this->config_dir = CONFIG_DIR;
$this->plugins_dir[0] = SMARTY_DIR . 'plugins';
$this->plugins_dir[1] = PRESENTATION_DIR . 'smarty_plugins';
Содержимое файла константов:
PHP:
// SITE_ROOT contains the full path to the tshirtshop folder
define('SITE_ROOT', dirname(dirname(__FILE__)));
// Application directories
define('PRESENTATION_DIR', SITE_ROOT . '/presentation/');
define('BUSINESS_DIR', SITE_ROOT . '/business/');
// Settings needed to configure the Smarty template engine
define('SMARTY_DIR', SITE_ROOT . '/libs/smarty/');
define('TEMPLATE_DIR', PRESENTATION_DIR . 'templates');
define('COMPILE_DIR', PRESENTATION_DIR . 'templates_c');
define('CONFIG_DIR', SITE_ROOT . '/include/configs');
httpd.conf Root:
DocumentRoot "c:/wamp/www/htdocs/"
Почему пути в Smarty другие? Как эту проблему решить?

-~{}~ 17.11.09 00:14:
Нашле проблему вот тут {include file=$obj->mCategoriesCell}
Теперь осталось выяснить, почему объект undefined.
Но вопрос про пути все еще открыт.

-~{}~ 17.11.09 13:56:
Когда вместо
PHP:
{include file=$obj->mCategoriesCell}
PHP:
{include file="categories_list.tpl"}
Вот содержимое для store_front.tpl, а точнее то, что хоть как-то относится к содержимому переменной, на которую ругаются :
PHP:
public $mCategoriesCell = 'blank.tpl';
// Initialize presentation object
public function init()
{
// Load department details if visiting a department
if (isset ($_GET['DepartmentId']))
{
$this->mContentsCell = 'department.tpl';
$this->mCategoriesCell = 'categories_list.tpl';
}
elseif (isset($_GET['ProductId']) &&
isset($_SESSION['link_to_continue_shopping']) &&
strpos($_SESSION['link_to_continue_shopping'], 'DepartmentId', 0)
!== false)
{
$this->mCategoriesCell = 'categories_list.tpl';
}
// Load product details page if visiting a product
if (isset ($_GET['ProductId']))
$this->mContentsCell = 'product.tpl';
// Load the page title
$this->mPageTitle = $this->_GetPageTitle();
}
{* Smarty blank page *}
Остальные функции там ответственны за парсинг url и title.
