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 6855681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:47:20+00:00 2026-05-27T01:47:20+00:00

I have a question regarding the framework. I based my CRUD on your live

  • 0

I have a question regarding the framework. I based my CRUD on your live example. I have this URL:

http://mydomain.com/test/index.php/api/t1/module1/username@mail.com?query1=mama&query2=papa

In my api.php file, I used GET method on this request:

public function __construct(){
    $this->dp = new Control();
}

public function get($id=NULL, $id2=NULL, $id3=NULL, $id4=NULL)
{
    switch($id)
    {
        case "t1":
            return $this->dp->t1(func_get_args());
        break;
        case "t2":
            return $this->dp->t2(func_get_args());
        break;
        default:
            throw new RestException(400);
        break;
    }
}

Then on my control.php,

public function t1($numbers) {
print_r($numbers);
}

The response body of this is

Array
(
[0] => t1
[1] => module1
[2] => username@mail.com
[3] =>
)

What I want to achieve in here is get the values of query1 and query2? How can I do this?

Thanks.

  • 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-05-27T01:47:20+00:00Added an answer on May 27, 2026 at 1:47 am

    I have created the following proof of concept and tested it and made sure it works!

    <?php
    class Api {
        public function get($id = NULL, $id2 = NULL, $id3 = NULL, $id4 = NULL, $query1 = NULL, $query2 = NULL) {
            return "$query1 $query2";
        }
    }
    

    For hosting the API above I use the following index.php (gateway)

    <?php
    require_once '../../restler/restler.php';
    require_once 'api.php';
    $r = new Restler();
    $r->addAPIClass('Api');
    $r->handle();
    

    When I call

    http://restler2.dev/test/url_routing/index.php/api/t1/module1/username@mail.com?query1=mama&query2=papa
    

    or

    http://restler2.dev/test/url_routing/index.php/api/t1/module1?query1=mama&query2=papa
    

    or

    http://restler2.dev/test/url_routing/index.php/api/t1?query1=mama&query2=papa
    

    I get

    "mama papa"
    

    So I should be able to pass it to another class another method easily

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

Sidebar

Related Questions

I have a question regarding this code. I write this code in my framework,
I download a framework and code and I have a question regarding require and
I have a couple of questions regarding a modular GWT based application framework. I
I have a quick question regarding to mobile development, I'm new at this, so
I have a rather loaded question regarding a library/framework my company uses to build
I have question regarding the SQLAlchemy. How can I add into my mapped class
I have question regarding the use of function parameters. In the past I have
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION
I have a question regarding handling errors in a J2EE application. Our current application

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.