/** * Test JView::addTemplatePath() * * @since 11.3 */ public function testAddTemplatePath() { $ds = DIRECTORY_SEPARATOR; // Reset the internal _path property so we can track it more easily. TestReflection::setValue($this->class, '_path', array('helper' => array(), 'template' => array())); $this->class->addTemplatePath(JPATH_ROOT . '/libraries'); $this->assertAttributeEquals(array('helper' => array(), 'template' => array(realpath(JPATH_ROOT . '/libraries') . $ds)), '_path', $this->class); $this->class->addTemplatePath(JPATH_ROOT . '/cache'); $this->assertAttributeEquals(array('helper' => array(), 'template' => array(realpath(JPATH_ROOT . '/cache') . $ds, realpath(JPATH_ROOT . '/libraries') . $ds)), '_path', $this->class); }
function fetchTemplateChiaSe($templatePath, $templateName, $data = null) { $template = new JView(); $template->addTemplatePath($templatePath); if (!empty($data)) { $template->assignRef('data', $data); } $template->setLayout($templateName); return $template->loadTemplate(); }
function fetchTienIchTemplate($tienIchIds, $templatePath, $templateName, $listAllFlag = true, $lang) { // TODO: remove hard code // $tienIchIds = '1-1,1-2,2-6'; $data = null; // $lang = ilandCommonUtils::getLanguage(); // lay tat ca du lieu tien ich $allList = U_ReModelProperties::layDanhSachTienIch($lang); $data = U_ReModelProperties::parseTienIch($tienIchIds, $allList, $listAllFlag); // fetch template tien ich $template = new JView(); $template->addTemplatePath($templatePath); $template->assignRef('allFlag', $listAllFlag); $template->assignRef('tienIchAllList', $data); $template->setLayout($templateName); return $template->loadTemplate(); return $data; }
public function addTemplatePath($path) { parent::addTemplatePath($path); return $this; }