Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8566233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:36:33+00:00 2026-06-11T17:36:33+00:00

I am coming from codeigniter, and trying to wrap my head around routing. I

  • 0

I am coming from codeigniter, and trying to wrap my head around routing.
I am following the http://codehappy.daylerees.com/using-controllers tutorial

If you scroll down to RESTful controllers, Dayle talks about Home_Controller extending the base_controller and adding public function get_index() and post_index(). I have copied the code, but when I go to

http://localhost/m1/public/account/superwelcome/Dayle/Wales 

I get:

We took a wrong turn. Server Error: 404 (Not Found).

Is there anything obvious that I’m doing wrong ? Should I be putting the code somewhere else? Here’s my code

class Base_Controller extends Controller {

    /**
     * Catch-all method for requests that can't be matched.
     *
     * @param  string    $method
     * @param  array     $parameters
     * @return Response
     */
     public function __call($method, $parameters)
     {
       return Response::error('404');
     }

     public $restful = true;

     public function get_index()
     {
       //
     }
     public function post_index()
     {
       //
     }

}

In the routes.php file I have:

// application/routes.php
Route::get('superwelcome/(:any)/(:any)', 'account@welcome');

my account controller ( from the tutorial) is:

// application/controllers/account.php
class Account_Controller extends Base_Controller
{
       public function action_index()
       {
          echo "This is the profile page.";
       }
       public function action_login()
       {
          echo "This is the login form.";
       }
       public function action_logout()
       {
          echo "This is the logout action.";
       }
       public function action_welcome($name, $place)
       {

          $data = array(
            'name' => $name,
            'place' => $place
          );
          return View::make('welcome', $data);
       }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:36:35+00:00Added an answer on June 11, 2026 at 5:36 pm

    You should change the line in application/controllers/account.php

    public function action_welcome($name, $place)
    

    to

    public function get_welcome($name, $place)
    

    since the Account_Controller inherits $restful = TRUE from Base_Controller class, making action_-prefixed function name unusable.

    Additionally, you must change all the function prefixes in account.php to get_ for the same reason 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using Yii, coming from Codeigniter (CI). I'm trying to set up
I am having a play around with codeigniter and trying to get my head
I'm trying to get my default template working with Laravel. I'm coming from Codeigniter
Coming from CodeIgniter, I'd like to learn Laravel. But I'm breaking my head 2
I am using Codeignitor for programming and coming from c#. its look like a
Coming from a background using Visual Studio and Notepad++ I'm used to the indent
I'm coming from CodeIgniter, and the terminology overlap between it and other MVC frameworks
Coming from a perl background, I have always defined a 2D array using int[][]
Coming from an academic background in mutli-agent systems (developed in Java using JADE )
I am trying to create an article based website using codeigniter. When any article

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.