I'm using the form_open()
helper method within the view to indicate the controller method to handle the form submission action and have the route defined in app\Config\Routes.php
.
I'm still getting an error Can't find a route for 'registrations/index'
.
Please assist with the issue. The code snippets are provided below.
register.php
view file: <?php echo form_open('/registrations/index'); ?>
Registrations.php
controller:class Registrations extends BaseController {
public function index() {
$data['coursename'] = $this->getCourseName();
log_message('info','name field >' . $this->request->getVar('iname') . '<<');
echo view('templates/header');
echo view('pages/register', $data);
echo view('templates/footer');
}
Routes.php
$routes->get('/registrations/index', 'Registrations::index');
I think your AutoRoutes is set to false by default.
add this line in your Routes.php
$routes->setAutoRoute(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With