PHP Класс CI_Calendar, TastyIgniter

Автор: EllisLab Dev Team
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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)

Свойство Тип Описание
$CI object CI Singleton

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

Loads the calendar language file and sets the default time reference.
public __construct ( array $config = [] ) : void
$config array Calendar options
Результат void

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.
public adjust_date ( $month, $year ) : array
Результат array

default_template() публичный Метод

This is used in the event that the user has not created their own template
public default_template ( ) : array
Результат array

generate() публичный Метод

Generate the calendar
public generate ( $year = '', $month = '', $data = [] ) : string
Результат string

get_day_names() публичный Метод

Returns an array of day names (Sunday, Monday, etc.) based on the type. Options: long, short, abr
public get_day_names ( $day_type = '' ) : array
Результат array

get_month_name() публичный Метод

Generates a textual month name based on the numeric month provided.
public get_month_name ( $month ) : string
Результат string

get_total_days() публичный Метод

Total days in a given month
public get_total_days ( $month, $year ) : integer
Результат integer

initialize() публичный Метод

Accepts an associative array as input, containing display preferences
public initialize ( $config = [] ) : CI_Calendar
Результат CI_Calendar

parse_template() публичный Метод

Harvests the data within the template {pseudo-variables} used to display the calendar
public parse_template ( ) : CI_Calendar
Результат CI_Calendar

Описание свойств

$CI защищенное свойство

CI Singleton
protected object $CI
Результат object

$day_type публичное свойство

How to display names of days
public string $day_type
Результат string

$month_type публичное свойство

How to display months
public string $month_type
Результат string

$next_prev_url публичное свойство

Url base to use for next/prev month links
public bool $next_prev_url
Результат boolean

$replacements публичное свойство

Replacements array for template
public array $replacements
Результат array

$show_next_prev публичное свойство

Whether to show next/prev month links
public bool $show_next_prev
Результат boolean

$show_other_days публичное свойство

Show days of other months
public bool $show_other_days
Результат boolean

$start_day публичное свойство

Day of the week to start the calendar on
public string $start_day
Результат string

$template публичное свойство

Calendar layout template
public mixed $template
Результат mixed