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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:38:40+00:00 2026-05-13T15:38:40+00:00

I am creatting a Code Igniter project in which I want to pass a

  • 0

I am creatting a Code Igniter project in which I want to pass a variable through the URL like a get statement, like this:
url: /site/cake/1

controller function: cake($var)

but when the variable is left blank, I receive an error, how can I get code igniter, to ignore this?

  • 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-13T15:38:40+00:00Added an answer on May 13, 2026 at 3:38 pm

    In your controller, do this:

    function cake($var = null) {
        // your other code here
    }
    

    When $var isn’t present in the URL, it will be set to null and you’ll receive no error.

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

Sidebar

Related Questions

I'm creating a small code plugin which allows you to do some things with
In my code, I am creating a collection of objects which will be accessed
I am progamatically creating a SharePoint site using SPWeb spWeb = spSite.AllWebs.Add(...); What code
I'm trying to follow code-to-interface on a project. Should I be creating an interface
If I check out a tagged version of my source code without creating a
I often refactor code first by creating an inner class inside the class I'm
I am creating a pdf document using C# code in my process. I need
I'm creating a color object using the following code. curView.backgroundColor = [[UIColor alloc] initWithHue:229
When creating a class that has internal private methods, usually to reduce code duplication,
Has there been any attempt and creating a formalized method for organizing CSS code?

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.