PHP CodeIgniter 4 - Form Submission - error Can t find a route for registrations index

0 votes

The route is created in appConfigRoutes.php, and I'm using the form open() helper method within the view to specify the controller method to handle the form submission action.

Still receiving a mistake No route found for "registrations/index."

Please help with this problem. The provided code snippets can be found below.

Error:

enter image description here

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');
Aug 6, 2022 in PHP by Kithuzzz
• 38,000 points
1,700 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

Cant Find Xampp setup for windows 32 bit (Php 7.3.2 )

I downloaded a 64-bit version of xampp ...READ MORE

Jun 7, 2022 in PHP by Kichu
• 19,040 points
1,059 views
0 votes
1 answer

Error:“Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP

Hello @kartik, The best way for getting input string is: $value ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,840 points
37,590 views
0 votes
1 answer

What are the best way to allow plugins for a PHP application?

Hii, Here is an approach I have  used, it's ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,840 points
763 views
0 votes
1 answer

What is the best way to allow plugins for a PHP application?

Hello @kartik, I've used, it's an attempt to ...READ MORE

answered Apr 15, 2020 in PHP by Niroj
• 82,840 points
761 views
0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,840 points
4,340 views
0 votes
1 answer
0 votes
1 answer

CodeIgniter removing index.php from url

To solve your doubt, use the following ...READ MORE

answered Feb 23, 2022 in PHP by Aditya
• 7,680 points
1,261 views
0 votes
0 answers
0 votes
0 answers

php error: The Encrypt library requires the Mcrypt extension in codeigniter

I have a  login and sign-up form and ...READ MORE

Jun 20, 2022 in PHP by Kithuzzz
• 38,000 points
3,534 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP