\CI_Calendar

CodeIgniter Calendar Class

This class enables the creation of calendars

Summary

Methods
Properties
Constants
__construct()
initialize()
generate()
get_month_name()
get_day_names()
adjust_date()
get_total_days()
default_template()
parse_template()
$CI
$lang
$local_time
$template
$start_day
$month_type
$day_type
$show_next_prev
$next_prev_url
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$CI

$CI : 

Type

$lang

$lang : 

Type

$local_time

$local_time : 

Type

$template

$template : 

Type

$start_day

$start_day : 

Type

$month_type

$month_type : 

Type

$day_type

$day_type : 

Type

$show_next_prev

$show_next_prev : 

Type

$next_prev_url

$next_prev_url : 

Type

Methods

__construct()

__construct(  $config = array()) 

Constructor

Loads the calendar language file and sets the default time reference

Parameters

$config

initialize()

initialize(  $config = array()) : void

Initialize the user preferences

Accepts an associative array as input, containing display preferences

Parameters

$config

generate()

generate(  $year = '',   $month = '',   $data = array()) : string

Generate the calendar

Parameters

$year
$month
$data

Returns

string

get_month_name()

get_month_name(  $month) : string

Get Month Name

Generates a textual month name based on the numeric month provided.

Parameters

$month

Returns

string

get_day_names()

get_day_names(  $day_type = '') : array

Get Day Names

Returns an array of day names (Sunday, Monday, etc.) based on the type. Options: long, short, abrev

Parameters

$day_type

Returns

array

adjust_date()

adjust_date(  $month,   $year) : array

Adjust Date

This function makes sure that we have a valid month/year. For example, if you submit 13 as the month, the year will increment and the month will become January.

Parameters

$month
$year

Returns

array

get_total_days()

get_total_days(  $month,   $year) : integer

Total days in a given month

Parameters

$month
$year

Returns

integer

default_template()

default_template() : array

Set Default Template Data

This is used in the event that the user has not created their own template

Returns

array

parse_template()

parse_template() : void

Parse Template

Harvests the data within the template {pseudo-variables} used to display the calendar