app/controllers/backend/UserController.php: adding listing of users.
This commit is contained in:
parent
7c458a8052
commit
bdde1d9ac7
2 changed files with 45 additions and 2 deletions
|
|
@ -2,9 +2,18 @@
|
|||
|
||||
namespace App\Controller\Backend;
|
||||
|
||||
use App\Model\Data\User;
|
||||
|
||||
class UserController extends \Phalcon\Mvc\Controller
|
||||
{
|
||||
public function indexAction()
|
||||
/**
|
||||
* @param $page
|
||||
*/
|
||||
public function indexAction($page = 1)
|
||||
{
|
||||
$paginator = User::getPaginationList($page,15);
|
||||
|
||||
$this->view->pagination_url = '/admin/user/list/';
|
||||
$this->view->page = $paginator->getPaginate();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,36 @@
|
|||
|
||||
<h1>Backend</h1>
|
||||
<div class="section">
|
||||
|
||||
<h1>Users</h1>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Username</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Type</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for item in page.items %}
|
||||
<tr>
|
||||
<td>{{ item.id }}</td>
|
||||
<td>{{ item.username }}</td>
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.email }}</td>
|
||||
<td>{{ item.type }}</td>
|
||||
<td>{{ item.status }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<nav class="text-center" aria-label="Page navigation">
|
||||
{{ partial('pagination') }}
|
||||
</nav>
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue