Cytat(pinochet @ 4.01.2009, 21:44:44 )

Spróbuj bez tych nawiasów :] Metodę na pewno da się wykonać ale moze w Smartach działą to na zasadzie jakiegoś ifa i nie da się zagłębiać "->" ?
Tak:
<?php
{$Article->ShowCategory->ShowName()}
?>
? W tym wypadku tez nie dziala:
Kod
Call to a member function ShowName() on a non-object
Wyglada na to ze jednak bede musial osobno przekazac smrty'emu obiekt Article i osobno Category. No coz, trudno :]
Cytat(pinochet @ 4.01.2009, 21:44:44 )

Spróbuj bez tych nawiasów :] Metodę na pewno da się wykonać ale moze w Smartach działą to na zasadzie jakiegoś ifa i nie da się zagłębiać "->" ?
Ok dzieki za linka, wczesniej nie zauwazylem Twojego posta. Pozwole sobie wkkleic tutaj wykorzystane rozwiazanie dla potomnych:
<?php
/*
* Template.class.php
*/
require_once dirname(__FILE__).'/Smarty.class.php';
class Template extends Smarty
{
public $compiler_file = 'Smarty_Compiler_New.class.php';
public $compiler_class = 'Smarty_Compiler_New';
function __construct()
{
$this->Smarty();
// here you can define all the paths
$views_path = SystemConfig::$viewsPath;
$temp_path = SystemConfig::$tempPath;
$this->template_dir = $views_path;
$this->cache_dir = $views_path . 'configs';
$this->compile_dir = $temp_path . 'tpl_compile';
$this->config_dir = $temp_path . 'tpl_cache';
$this->plugins_dir[] = 'customs';
}
}
?>
oraz
<?php
/*
* Smarty_Compiler_New.class.php
*/
require_once dirname(__FILE__).'/Smarty_Compiler.class.php';
class Smarty_Compiler_New extends Smarty_Compiler {
var $_obj_call_regexp = null;
function __construct()
{
$this->Smarty_Compiler();
$this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ''.'(?:' . $this->_obj_ext_regexp . '(?:' . $this->_obj_params_regexp . '|' . $this->_obj_single_param_regexp . '(?:s*,s*' . $this->_obj_single_param_regexp . ')*))*' . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
}
}
?>
Wszystko dziala pieknie jak nalezy, dzieki za pomoc.