2013-06-27 41 views
2

我有一個上傳到文件夾的腳本,我想在上傳完成後成功顯示一個視圖。如何在Joomla控制器中顯示視圖?

/component 
    /admin/ 
    /views/ 
     /components/ 
     view.html.php 
     /tmpl/ 
      default.php 
      modal.php // I want to load and output this file from controller.php 
    component.php 
    controller.php 
/site/ 

我願做這樣的事情,在我的控制器

$view = $this->getView(/* params for modal.php to load*/); //get the view 
$this->view->display(); 

謝謝

回答

4

嘗試使用:

$view = $this->getView('components', 'html'); 
$view->setLayout('modal'); 
$view->display(); 

JRequest::setVar('view', 'components'); 
JRequest::setVar('layout', 'modal'); 
+1

Thanx。我已經找到了解決方案。 – MontrealDevOne

相關問題