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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:22:04+00:00 2026-05-15T21:22:04+00:00

Real basic CI question here, which I cant find anything on in the documentation.

  • 0

Real basic CI question here, which I cant find anything on in the documentation. I think I may need some further configuration?? I have a function which loads a view and it works correctly, but when I send it parameters its doesn’t load the view, any ideas??

Heres code with params (view does not load)

function grid($height,$width)
{
    echo $height."x".$width;

 $this->load->view("grid");

}

and here’s without (view does load)

function grid()
{
    //echo $height."x".$width;

 $this->load->view("grid");

}

So Height and width is the only thing that echos in the first example, in the second the view is loaded.
Thanks ahead of time!

  • 1 1 Answer
  • 3 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-15T21:22:05+00:00Added an answer on May 15, 2026 at 9:22 pm

    You are supposed to have your controller pass parameters to the view as an array:

    function grid($height,$width)
    {
      $data = array();
      $data['height'] = $height;
      $data['width'] = $width;
    
      $this->load->view("grid", $data);
    }
    

    Then your view can render them:

    echo $height."x".$width;
    

    This allows for a clean separation of concerns between the Controller and View objects.

    For more information see the section Adding Dynamic Data to the View in the CI User Guide.

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

Sidebar

Related Questions

My real Question is which of these is more efficient in terms of loading
This is a very basic MySQL question but I could not find an answer.
Quick question, which I think has a very easy solution for someone who has
this is a real basic question, but I am having a frustrating time learning
I'm a Java newbie, and this is a real basic, basic question, so please
I have a real basic form (code below) with a bunch of back-panel PhP.
Real noob question no doubt, but I can't get my head around this behaviour.
Real problem with an existing webapp which has been working for the last couple
The real question: Is there a way to clear certain attributes for all components
A real F# noob question, but what is |> called and what does it

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.