$this in template of compoent's view - Joomla! Forum - community, help and support
let have component client side folder structure:
views/component/view.html.php
views/component/tmpl/default.php
in default php have function:
the problem that: $this null...
even if use global:
and if rename $this:
problem don't solving.
views/component/view.html.php
views/component/tmpl/default.php
in default php have function:
code: select all
function addbasepath($path)
{
return $this->basepath . $path;
}the problem that: $this null...
even if use global:
code: select all
function addbasepath($path)
{
global $this;
return $this->basepath . $path;
}and if rename $this:
code: select all
$self = $this;
function addbasepath($path)
{
global $self;
return $self->basepath . $path;
}problem don't solving.
why not way?:
code: select all
function addbasepath($thispointer, $path)
{
return $thispointer->basepath . $path;
}
addbasepath($this, $somepath);
Comments
Post a Comment