/** * Method to render the view. * * @return string The rendered view. * * @since 12.1 * @throws RuntimeException */ public function render() { $projects = $this->model->getProjects(); $this->items = $projects; $this->setLayout('default'); $this->defaultTitle = JText::_('COM_MONITOR_PROJECTS'); return parent::render(); }
/** * Method to render the view. * * @return string The rendered view. * * @since 12.1 * @throws RuntimeException */ public function render() { $this->prefix = 'project'; $projects = $this->model->getProjects(); $this->items = $projects; $this->setLayout('default'); $this->addToolbar(); return parent::render(); }
/** * Method to get the field input markup. * * @return string The field input markup. * * @since 11.1 */ protected function getOptions() { $options = array(); JLoader::register('MonitorModelAbstract', JPATH_ROOT . '/administrator/components/com_monitor/model/abstract.php'); JLoader::register('MonitorModelProject', JPATH_ROOT . '/administrator/components/com_monitor/model/project.php'); $model = new MonitorModelProject(null, false); $projects = $model->getProjects(); foreach ($projects as $project) { $options[] = JHtml::_('select.option', $project->id, $project->name); $selected = $this->value && $this->value == $project->id ? ' selected' : ''; } $options = array_merge(parent::getOptions(), $options); return $options; }