$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:

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

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support