summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries/calendar.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-17 21:26:57 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-17 21:26:57 +0100
commit9c7ce322232eb1e55b9caa138dffe67d9acc660f (patch)
treef05ca281ac3ca069ab7bbd0df6ef2b135b8a10a0 /user_guide_src/source/libraries/calendar.rst
parentceeafe6e2082fe365c68710024d5546d4c6fa6c4 (diff)
parent1b6f692d9715199d4dafe9b923d030978285d3a9 (diff)
Merge pull request #2864 from browner12/patch-1
simplify calendar library
Diffstat (limited to 'user_guide_src/source/libraries/calendar.rst')
-rw-r--r--user_guide_src/source/libraries/calendar.rst16
1 files changed, 14 insertions, 2 deletions
diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst
index 2263aa404..792f1d504 100644
--- a/user_guide_src/source/libraries/calendar.rst
+++ b/user_guide_src/source/libraries/calendar.rst
@@ -100,7 +100,7 @@ preferences below.
====================== ================= ============================================ ===================================================================
Preference Default Options Description
====================== ================= ============================================ ===================================================================
-**template** None None A string containing your calendar template.
+**template** None None A string or array containing your calendar template.
See the template section below.
**local_time** time() None A Unix timestamp corresponding to the current time.
**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on.
@@ -147,7 +147,7 @@ Creating a Calendar Template
============================
By creating a calendar template you have 100% control over the design of
-your calendar. Each component of your calendar will be placed within a
+your calendar. Using the string method, each component of your calendar will be placed within a
pair of pseudo-variables as shown here::
$prefs['template'] = '
@@ -193,6 +193,18 @@ pair of pseudo-variables as shown here::
echo $this->calendar->generate();
+Using the array method, you will pass `key => value` pairs. You can pass as many or as few values as you'd like. Omitted keys will use the default values inherit in the calendar class.
+
+ $prefs['template'] = array(
+ 'table_open' => '<table class="calendar">',
+ 'cal_cell_start' => '<td class="day">',
+ 'cal_cell_start_today' => '<td class="today">',
+ );
+
+ $this->load->library('calendar', $prefs);
+
+ echo $this->calendar->generate();
+
***************
Class Reference
***************