Question about JView and $this->items (J! 2.5). - Joomla! Forum - community, help and support


hi,
in developing mvc component tutorial helloworldviewhelloworlds extends jview class following.

code: select all

<?php
 
// no direct access file
defined('_jexec') or die;
 
jimport('joomla.application.component.view');
 
class helloworldviewhelloworlds extends jview
{
        function display($tpl = null)
        {
                // data model
                $items = $this->get('items');
                $pagination = $this->get('pagination');
 
                // assign data view
                $this->items = $items;
                $this->pagination = $pagination;
 
                // display template
                parent::display($tpl);
        }
}
?>

everything clear excepting lines

code: select all

 // assign data view
$this->items = $items;
$this->pagination = $pagination;


as far understand $this->items means items either member of class helloworldviewhelloworlds or inhereted jview. however, cant see declaration of items in helloworldviewhelloworlds.
i had @ jview class couldnt find items declaration in class either.
so question items come from? (i c/c++ programmer, maybe missing php programming).

i'm no expert here learned myself.

this data assignment. doing here making items available in view's layout (in other words tmpl/default.php or whatever called it).

this:

code: select all

$this->items = $items;


is same writing:

code: select all

 $this->assignref( 'items', $items );


what's happening here jview's display method "include" (php include) layout, therefore $this-><whatever> available use in layout code





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