Welcome Guest, Not a member yet? Register   Sign In
Bug in routes with path in controller
#5

Am also experiencing the same issue with routes with parameters
PHP Code:
    $routes->group('usergroups', ['filter' => 'ajax'], function($routes){
        
$routes->add('(:num)/edit''Backend/Users::editGroup/$1', ['as' => 'edit_group']);
    }); 

This route is not working. Am getting 404 error. Controller method is not found: index

I have controller in:  App/Controllers/Backend/Users.php

PHP Code:
<?php 
namespace App\Controllers\Backend;

use 
App\Controllers\Backend;
use 
App\Models\Backend\UserModel;

class 
Users extends Backend
{
    protected $userModel;

    public function __construct(){
    
parent::__construct();
    
$this->userModel = new UserModel();
    }

    public function editGroup($groupId)    
    {
    
$data['group'] = $this->userModel->getGroupDetails($groupId);
    echo 
view'backend/users/edit_group'$data);
    }


how can i fix this issue?
Reply


Messages In This Thread
Bug in routes with path in controller - by acy29 - 11-22-2019, 05:44 AM
RE: Bug in routes with path in controller - by midhunlalkc - 11-30-2019, 05:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB