我開發一個自定義joomla 1.5組件,它在本地工作正常(wamp服務器,php 5.3.5)和工具欄功能添加/編輯和刪除不起作用在我的託管帳戶(apache ,PHP 5.2.16)joomla組件不能在我的主機帳戶上工作
我有兩個工具欄,當我點擊第二個工具欄上的重定向到第一個
這是我的代碼
Controller.php這樣
class GalGallerifficController extends JController
{
/**
* Method to display the view
*
* @access public
*/
/**
* constructor (registers additional tasks to methods)
* @return void
*/
function __construct()
{
parent::__construct();
// Register Extra tasks
$this->registerTask('add' , 'edit');
}
/**
* display the edit form
* @return void
*/
function edit()
{
JRequest::setVar('view', 'gallery');
JRequest::setVar('layout', 'form' );
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
/**
* remove record(s)
* @return void
*/
function remove()
{
$model = $this->getModel('gallery');
if(!$model->delete()) {
$msg = JText::_('Error: One or More Gallery(s) Could not be Deleted');
} else {
$msg = JText::_('Gallery(s) Deleted');
}
$this->setRedirect('index.php?option=com_galleriffic', $msg);
}
}
個第二控制器/ galleryitems.php
class GalGallerifficControllerGalleryItems extends JController
{
function __construct()
{
parent::__construct();
// Register Extra tasks
$this->registerTask('add' , 'edit');
}
/**
* display the edit form
* @return void
*/
function edit()
{
JRequest::setVar('view', 'galleryitem');
JRequest::setVar('layout', 'form' );
JRequest::setVar('hidemainmenu', 1);
parent::display();
}
/**
* remove record(s)
* @return void
*/
function remove()
{
$model = $this->getModel('gallery');
if(!$model->delete()) {
$msg = JText::_('Error: One or More Gallery(s) Could not be Deleted');
} else {
$msg = JText::_('Gallery(s) Deleted');
}
$this->setRedirect('index.php?option=com_galleriffic', $msg);
}
function display()
{
parent::display();
}
}
和galleryitems查看
class GalGallerifficViewGalleryItems extends JView
{
function display($tpl = null)
{
JToolBarHelper::title(JText::_('Galleriffic Gallery Items'), 'generic.png');
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNewX();
// Get data from the model
$items =& $this->get('Data');
$this->assignRef('items', $items);
parent::display($tpl);
}
}
任何想法,爲什麼出現這種情況?
在此先感謝:)
當你說它不起作用,你可以請更具體一點。你有沒有收到任何錯誤信息? – Nick 2011-02-09 04:40:16