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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:45:21+00:00 2026-06-02T16:45:21+00:00

I have a CI calendar showing on a page, with an array of data

  • 0

I have a CI calendar showing on a page, with an array of data sent to populate each day, and that’s working fine, however I seem to have run into a small problem that I can’t quite wrap my head around.

I’ve only known CI for about 3 days (and OOP based PHP for 5 days!), so forgive me if this is something incredibly simple.

I need to get a variable ($pid) into my calendar’s next/prev links. The $pid will define which property to get from the DB, and to display the properties rates for the selected month.

In my “MY_Calendar.php” file, I have the following:

var $CI;
var $lang;
var $local_time;
var $template       = '';
var $start_day      = 'sunday';
var $month_type     = 'long';
var $day_type       = 'abr';
var $show_next_prev = TRUE;
var $next_prev_url  = '/ci/index.php/rates/property/1/';

Where the /1/ is in the url, I need that to change to whatever the $pid is of the page that the calendar is on.

How can I get this variable into the class file?

I’m assuming it’d be a simple PHP concatenation to get the variable in the URL.

I tried calling the preferences via “$this->load->library(‘calendar’, $prefs);”

But the preferences didn’t seem to come through (I had a array named $prefs on the same page)

Any ideas? 🙂

  • 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-02T16:45:23+00:00Added an answer on June 2, 2026 at 4:45 pm

    If you’ve already extended the CI_Calendar class, just add a new class property:

    var $pid = 1;
    

    If you pass in the config array, and you’re calling the parent constructor, it should allow you to pass in / set the $pid variable.

    Then you’d obviously remove that value from $next_prev_url.

    Finally, you will override the function that outputs the next/prev buttons to concatenate the $next_prev_url with the correct $pid. You should set $pid to the current page, so teh previous will be -1 and next +1, ofcourse checking for the min and max page number to prevent those links from being shown if you get to the end.

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

Sidebar

Related Questions

I have a calendar/table that when you hover over each day we have a
I have a calendar page that I'm trying to position events on. Unlike most
I have a calendar program that I am trying to convert to iPad (using
I have a calendar table with data from year 2000 to 2012 (2012 wasn't
I run a church website and we have an event calendar page. We've been
I have a Flex application embedded in a Flash application, which was working fine
I'm writing a vertical scrollable calendar application(listview) that is always showing 1 month at
I have a calendar extendar issue that I seems tough for myself. I am
I have an mvc3 web page that takes a url parameter representing a date,
i have an init() function that returns a list of Domaines needed to populate

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.