Location: PHPKode > projects > Chalange > com_chalange/views/carreras/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 ChalangeViewCarreras extends JView{
  	function display($tpl=null){  		
  		JTable::addIncludePath(JPATH_COMPONENT.DS.'Tables');  		
   		$chalange=& JTable::getInstance('Chalanges','Table');
   		$mainframe =& JFactory::getApplication();  		
   		$model=& $this->getModel();
   		//$chalangeId = JRequest::getVar( 'id', 0, '', 'int' );
   		$chalangeId= $mainframe->getUserStateFromRequest("$option.chalange_variable",'id');
   		$chalange->load($chalangeId);//cargamos los datos de la chalange
   		//si entramos a esta instancia de componente por primera vez asigmamos el id de chalange
   		//if ($chalangeId!=0) $mainframe->setUserState("$option.chalange_variable","$chalangeId");
   		//else $chalangeId= $mainframe->getUserStateFromRequest("$option.chalange_variable",'id');
  		$races= $model->getCarreras($chalangeId);//cargamos los datos de las carreras
  		$this->assignRef('carreras',$races);
  		$this->assignRef('chalangeId',$chalangeId);
  		$this->assignRef('chalange',$chalange);
  		parent::display($tpl);
  	}
  }
?>
Return current item: Chalange