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

  • SEARCH
  • Home
  • 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 8197025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:39:14+00:00 2026-06-07T05:39:14+00:00

I want to take url params in controller’s action, like method params (like in

  • 0

I want to take url params in controller’s action, like method params (like in CodeIgniter). I want to have routing for UNLIMITED params amount (0, 5, 10 …).

url: http://localhost/controller/action/param1/param2/..../param10...

And action will be:

function action_something($param1, $param2, .... $param10) { ... }

Is it possible? I have simple application, and I want to have one default routing for every cases..

  • 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-07T05:39:15+00:00Added an answer on June 7, 2026 at 5:39 am

    You can achieve that by adding an “overflow” route to your bootstrap.php file:

    Route::set('default', '(<controller>(/<action>(/<overflow>)))', array('overflow' => '.*?'))
        ->defaults(array(
            'controller' => 'api',
            'action'     => 'index',
        ));
    

    Then I usually use this kind of class to access the various parameters:

    <?php defined('SYSPATH') or die('No direct script access.');
    
    class UrlParam {
    
        static public function get($controller, $name) {
            $output = $controller->request->param($name);
            if ($output) return $output;
    
            $overflow = $controller->request->param("overflow");
            if (!$overflow) return null;
    
            $exploded = explode("/", $overflow);
            for ($i = 0; $i < count($exploded); $i += 2) {
                $n = $exploded[$i];
                if ($n == $name && $i < count($exploded) - 1) return $exploded[$i + 1];
            }
    
            return null;
        }
    
    }
    

    Usage:

    Then if you have a URL such as http://example.com/controller/action/param1/value1/param2/value2.... You can call from the controller UrlParam::get($this, 'param1') to get the value of “param1”, etc.

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

Sidebar

Related Questions

I have a url http://blah.com and I want to take the url and add
Lets say I have a URL as follows: http://www.testing.com/?id=1234 I want to take that
I want to be able to take a URL like: http://www.example.com/valOne/valTwo/valThree/valFour/valFive and convert it
I want to take this URL: http://www.awesomehost.com/accountants/Ceribelli-Associates-cd01qazwsxoztfnlvsim.html And redirect it to: http://www.awesomehost.com/accountants/accountant-directory.php?ID=cd01qazwsxoztfnlvsim And here's
I have a url variable http://blah.com/blah/blah/blah and I have another url http://shop.blah.com/ I want
I'm using javascript and would like to take a URL string that I have
I want to take a url that does not have any apostrophes, commas or
I have 2 Action methods in one controller, Index: public ActionResult Index(string url) {
i have a requirement, i want to take URL of image from user and
I have a action something like: def show @p = Post.find(params[:id]) respond_to do |format|

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.