Tuman
Новичок
Доступ к объекту из класса
Почему, код:
Работает, а код:
Выдает ошибку: Call to a member function registrate_block() on a non-object in
Почему, код:
PHP:
class cl_test
{
function test()
{
global $tmpl;
echo $tmpl->members->registrate_block();
}
}
PHP:
class cl_test
{
public $tmpl;
function test()
{
echo $this->tmpl->members->registrate_block();
}
}