(07-01-2016, 10:07 PM)fromberg Wrote: Hi All,
thanks for your feedback and suggestions.
I have tried all but still the same problem. I downloaded the latest CI 4 from repository.
My environment is Windows.
I will keep trying. If any additional tip, would be highly appreciated.
Thanks and regards,
This is controller file inside sub-folder Ajax in Controller folder;
PHP Code:
<?php namespace App\Controllers\Ajax;
class Test extends \CodeIgniter\Controller
{
public function index()
{
echo 'hi Im test in ajax sub folder';
}
//--------------------------------------------------------------------
}
Edit your route file, /application/Config/Routes.php by adding:
PHP Code:
$routes->add('ajax/test', 'Test::index', ['namespace' => 'App\Controllers\Ajax']);
It's works for me. Using CI4, if you namespace the controller, you have to set $routes->setDefaultNamespace('App\Controllers'); and define $routes->add() for each controller(Having 404NotFound problem if I’m did not do this).
Keep calm.