0
下面的代碼在我升級到3.7之前工作,但行「JHtml :: script('com_members/site.js',array(),true);」不再加載site.jsjhtml :: script不再適用於joomla 3.7
class MembersViewMembersELso extends JViewLegacy
{
// Overwriting JView display method
function display($tpl = null)
{
// Get data from the model
$state = $this->get('State');
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Assign data to the view
$this->state = $state;
$this->items = $items;
$this->pagination = $pagination;
// get the stylesheet (with automatic lookup, possible template overrides, etc.)
JHtml::stylesheet('com_members/site.stylesheet.css', array(), true);
// insert js code for onsubmit
JHtml::script('com_members/site.js', array(), true);
// Display the view
parent::display($tpl);
}
}
三江源。我會用你的建議,但是你有什麼想法,爲什麼在Joomla 3.7下JHtml :: Script語句突然失效了? –