Location: PHPKode > projects > Chalange > com_chalange/administrator/views/chalangeadmin/view.html.php
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );



jimport('joomla.application.component.view');
/**
  * HTML View class for the mycomponent component
  * @package Mycomponent
  */
  class ChalangeAdminViewChalangeAdmin extends JView{
  	function display($tpl=null){
  		JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');  		
   		$row=& JTable::getInstance('Chalanges','Table');
   		$model=& $this->getModel();
  		$cid= JRequest::getVar('cid',array(0),'','array');
  		$id=$cid[0];
  		$task='';
  		if ($id==0){
  			$task='new';
  		}else{ 
  			$task='edit';
  			$row->load($id); //obtengo los datos para esta chalange
  			$races=$model->getRaces($id);//obtengo las carreras para esta chalange
  			$this->assignRef('row',$row);
  			$this->assignRef('races',$races);
  		}
  		$this->assignRef('task',$task);
  		parent::display($tpl);
  	}
  }
?>
Return current item: Chalange