ลิงก์หน้า view
โค้ด: เลือกทั้งหมด
http://localhost/Joomla_3.10.11/administrator/index.php?option=com_mexample&view=customers
ตำแหน่งไฟล์ view ไฟล์ view.html.phpAn error has occurred.
0 Call to a member function getGroup() on bool
โค้ด: เลือกทั้งหมด
<?php
/**
* @package Joomla.Administrator
* @subpackage com_mexample
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
class MExampleViewCustomers extends Joomla\CMS\MVC\View\HtmlView
{
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->addToolbar();
parent::display($tpl);
}
public function addToolbar()
{
\Joomla\CMS\Toolbar\ToolbarHelper::title(JText::_('COM_MEXAMPLE_CUSTOMERS'));
\Joomla\CMS\Toolbar\ToolbarHelper::addNew('customer.add');
\Joomla\CMS\Toolbar\ToolbarHelper::editList('customer.edit');
\Joomla\CMS\Toolbar\ToolbarHelper::deleteList(JText::_('COM_MEXAMPLE_ARE_YOU_SURE'), 'customers.remove');
\Joomla\CMS\Toolbar\ToolbarHelper::preferences('com_mexample');
}
}
โค้ด: เลือกทั้งหมด
<?php
/**
* @package Joomla.Administrator
* @subpackage com_mexample
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo JRoute::_('index.php?option=com_mexample&view=customers'); ?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Search tools bar
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="categoryList">
<thead>
<tr>
<th width="1%">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="hidden-phone">
<span title="<?php echo sprintf('%d-%d', $item->lft, $item->rgt); ?>">
<?php echo (int) $item->id; ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // Load the batch processing form if user is allowed ?>
<?php if ($user->authorise('core.create', 'com_tags')
&& $user->authorise('core.edit', 'com_tags')
&& $user->authorise('core.edit.state', 'com_tags')) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_TAGS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer'),
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>