09-07-2020, 03:18 AM
To add a filter to a route you do it like so.
See the filter in the dashboard route? If they are not logged in it will load the login view.
PHP Code:
<?php
namespace Insitefx\Admin\Config;
/**
* Insitefx/Name: routes file.
*/
/** @var TYPE_NAME $routes */
$routes->group('', ['namespace' => 'Insitefx\Admin\Controllers'], function($routes)
{
$routes->get('dashboard', 'Dashboard::index', ['filter' => 'login']);
});
See the filter in the dashboard route? If they are not logged in it will load the login view.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )