joomla/com_wk1_6/site/views/wk1/view.html.php

<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_wk1
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
 
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
/**
 * HTML View class for the wk1 Component
 *
 * @since  0.0.2
 */
class Wk1ViewWk1 extends JViewLegacy
{
    /**
     * Display the wk1 view ==> methode braucht gar nichts zu machen und kann weggelassen werden, dann arbeit parent::dispolay
     *
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
     *
     * @return  void
     */
    function display($tpl = null)
    {
        // Assign data to the view 
        wkTrace('Wk1ViewWk1 display');
        $this->vmTitle = $this->getModel()->getTitle(JFactory::getApplication()->input->get('titleId'));
        // $this->vmTitle = $this->get('Title'); dieser code aus dem Ursprungs Tutorial ist eigenlich nicht sauber, wiesol daten aus Modell in View kopieren? View kann sowieso auf Modell zugreifen
        // Check for errors.
        if (count($errors = $this->get('Errors')))
        {
            JLog::add(implode('<br />', $errors), JLog::WARNING, 'jerror');
 
            return false;
        }

        // $this->get('List')['view html'] = __file__; // funktioniert nicht, keine Referenz irgendwo in call kette
 
        // Display the view
        parent::display($tpl);
    }
}