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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:16:22+00:00 2026-06-14T14:16:22+00:00

I am trying to echo a request in the view file in Kohana using

  • 0

I am trying to echo a request in the view file in Kohana using Request::factory() method and i am sending a value in that request which i am unable to get in the User Controller here is my code:

The View file:

<h1> Welcome to My First View File </h1>
<?php echo Request::factory("user",array("id" => 123))->execute(); ?>

Then the User.php Controller have this code:

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_User extends Controller {

    public function action_index()
    {
        $value = $this->request->param('id');

        $content = View::factory('menu')->bind("id", $value);

        $this->response->body($content);
    }            

} // End User

and the view menu.php have this code:

<h2> This is the view called by Request and Parameters send was: 
     <?php echo $id; ?>
</h2>

when i run the code it display the text This is the view called by Request and Parameters send was: but it doesn’t display the $id anyone can tell me why?

P.S: sorry for my bad English as its not my native language

  • 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-14T14:16:25+00:00Added an answer on June 14, 2026 at 2:16 pm

    Here you can see, that Request::factory() requires URI value a the first param. So, you should call something like:

    <h1> Welcome to My First View File </h1>
    <?php echo Request::factory(Route::get("user")->uri(array("id" => 123)))->execute(); ?>
    

    or

    <h1> Welcome to My First View File </h1>
    <?php echo Request::factory("user/123")->execute(); ?>
    

    First example uses reverse routing, where “user” is a Route name. I assume that you already have Route for handling URIs like ‘/user/123’.

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

Sidebar

Related Questions

I have a form that im trying to get emailed on submit using PHPmailer.
I'm trying to echo a value in a form based on number of rows
I'm trying to make a request to a website this way : file_get_contents('http://www.yahoo.com/index.php?var=value'); in
I am trying to request (using the gapi source code) the referred from link
I am using cakephp and trying to pass an array from the view to
I was trying to implement simple ajax GET request . In the callback portion
I'm trying to get mod_rewrite working with the following URLs: /events.php?view=details&id=$var /events.php?view=edit&id=$var Obviously my
Trying to access locally http://mysite.dev/gii but I'm getting: Gii Unable to resolve the request
I'm trying to do a simple echo app using Python. I want to submit
Hi. I've been trying to create a PHP page using Savant Templating Engine that

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.