($tpl); ? - Joomla! Forum - community, help and support
i looked through beginners tutorial , able understand of being documented directly or implied reference, except this....($tpl);
$tpl defined , used , not mentioned @ in tutorial, leaving poor newbies me in dark.
question : $tpl ? used ? defined ? there global $tpl?
i above example taken tutorial, $tpl defined null , call parent jview made null.
why bother defining @ ?
i'm sure there reason this. if explained.
thanks.
p/s tutorials simple , clear. , have effect of supressing cryptic joomla classes , terminologies, perhaps speak php only. fine that's langauge j! built upon. thank tutorial.
code: select all
class helloviewhello extends jview
{
function display($tpl = null)
{
------------------
------------------
------------------
------------------
parent::display($tpl);
}
}
$tpl defined , used , not mentioned @ in tutorial, leaving poor newbies me in dark.
question : $tpl ? used ? defined ? there global $tpl?
i above example taken tutorial, $tpl defined null , call parent jview made null.
why bother defining @ ?
i'm sure there reason this. if explained.
thanks.
p/s tutorials simple , clear. , have effect of supressing cryptic joomla classes , terminologies, perhaps speak php only. fine that's langauge j! built upon. thank tutorial.
hi,
if drill down jview class wil find display() call loadtemplate($tpl) create filename template load.
this filename created as
$file = isset($tpl) ? $this->_layout.'_'.$tpl : $this->_layout;
hence if $tpl happens null, name comes $this->_layout, otherwise it's appended: $this->_layout.'_'.$tpl
in example frontpage can have layout called 'default' , knows 2 views: 'list' , 'item'.
if 1 of these view-names provided template file becomes 'default_list.php' or 'default_item.php'. these sort of "subtemplates" "default.php" template.
it's matter of names, schemas, , defaults
have fun,
cirtap
jalil wrote:i'm sure there reason this. if explained.
thanks.
if drill down jview class wil find display() call loadtemplate($tpl) create filename template load.
this filename created as
$file = isset($tpl) ? $this->_layout.'_'.$tpl : $this->_layout;
hence if $tpl happens null, name comes $this->_layout, otherwise it's appended: $this->_layout.'_'.$tpl
in example frontpage can have layout called 'default' , knows 2 views: 'list' , 'item'.
if 1 of these view-names provided template file becomes 'default_list.php' or 'default_item.php'. these sort of "subtemplates" "default.php" template.
it's matter of names, schemas, , defaults
have fun,
cirtap
Comments
Post a Comment