Add method chaining support to Calendar & Pagination libs
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index fc65999..610b427 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -139,7 +139,7 @@
* Accepts an associative array as input, containing display preferences
*
* @param array config preferences
- * @return void
+ * @return CI_Calendar
*/
public function initialize($config = array())
{
@@ -156,6 +156,8 @@
{
$this->next_prev_url = $this->CI->config->site_url($this->CI->router->class.'/'.$this->CI->router->method);
}
+
+ return $this;
}
// --------------------------------------------------------------------
@@ -513,7 +515,7 @@
* Harvests the data within the template {pseudo-variables}
* used to display the calendar
*
- * @return void
+ * @return CI_Calendar
*/
public function parse_template()
{
@@ -521,7 +523,7 @@
if ($this->template === '')
{
- return;
+ return $this;
}
$today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today');
@@ -537,6 +539,8 @@
$this->temp[$val] = $this->temp[substr($val, 0, -6)];
}
}
+
+ return $this;
}
}
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index c6ffd03..f67cb47 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -314,7 +314,7 @@
* Initialize Preferences
*
* @param array $params Initialization parameters
- * @return void
+ * @return CI_Pagination
*/
public function initialize($params = array())
{
@@ -342,6 +342,8 @@
}
}
}
+
+ return $this;
}
// --------------------------------------------------------------------