PHP Class CI_Calendar, TastyIgniter

Show file Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$day_type string How to display names of days
$month_type string How to display months
$next_prev_url boolean Url base to use for next/prev month links
$replacements array Replacements array for template
$show_next_prev boolean Whether to show next/prev month links
$show_other_days boolean Show days of other months
$start_day string Day of the week to start the calendar on
$template mixed Calendar layout template

Protected Properties

Property Type Description
$CI object CI Singleton

Public Methods

Method Description
__construct ( array $config = [] ) : void Class constructor
adjust_date ( $month, $year ) : array Adjust Date
default_template ( ) : array Set Default Template Data
generate ( $year = '', $month = '', $data = [] ) : string Generate the calendar
get_day_names ( $day_type = '' ) : array Get Day Names
get_month_name ( $month ) : string Get Month Name
get_total_days ( $month, $year ) : integer Total days in a given month
initialize ( $config = [] ) : CI_Calendar Initialize the user preferences
parse_template ( ) : CI_Calendar Parse Template

Method Details

__construct() public method

Loads the calendar language file and sets the default time reference.
public __construct ( array $config = [] ) : void
$config array Calendar options
return void

adjust_date() public method

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.
public adjust_date ( $month, $year ) : array
return array

default_template() public method

This is used in the event that the user has not created their own template
public default_template ( ) : array
return array

generate() public method

Generate the calendar
public generate ( $year = '', $month = '', $data = [] ) : string
return string

get_day_names() public method

Returns an array of day names (Sunday, Monday, etc.) based on the type. Options: long, short, abr
public get_day_names ( $day_type = '' ) : array
return array

get_month_name() public method

Generates a textual month name based on the numeric month provided.
public get_month_name ( $month ) : string
return string

get_total_days() public method

Total days in a given month
public get_total_days ( $month, $year ) : integer
return integer

initialize() public method

Accepts an associative array as input, containing display preferences
public initialize ( $config = [] ) : CI_Calendar
return CI_Calendar

parse_template() public method

Harvests the data within the template {pseudo-variables} used to display the calendar
public parse_template ( ) : CI_Calendar
return CI_Calendar

Property Details

$CI protected property

CI Singleton
protected object $CI
return object

$day_type public property

How to display names of days
public string $day_type
return string

$month_type public property

How to display months
public string $month_type
return string

$next_prev_url public property

Url base to use for next/prev month links
public bool $next_prev_url
return boolean

$replacements public property

Replacements array for template
public array $replacements
return array

$show_next_prev public property

Whether to show next/prev month links
public bool $show_next_prev
return boolean

$show_other_days public property

Show days of other months
public bool $show_other_days
return boolean

$start_day public property

Day of the week to start the calendar on
public string $start_day
return string

$template public property

Calendar layout template
public mixed $template
return mixed