From b93464db656fe017fe434b0fc917921ded88a12c Mon Sep 17 00:00:00 2001
From: admin If you do not utilize Code Igniter's template engine, you'll be using pure PHP
-in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use PHPs alternative
-syntax for control structures and echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code,
+in your View files. To minimize the PHP code in these files, and to make it easier to identify the code blocks it is recommended that you use
+PHPs alternative syntax for control structures and short tag echo statements. If you are not familiar with this syntax, it allows you to eliminate the braces from your code,
and eliminate "echo" statements. Note: If you find that the syntax described in this page does not work on your server it might
+ Note: If you find that the syntax described in this page does not work on your server it might
be that "short tags" are disabled in your PHP ini file. Code Igniter will optionally rewrite short tags on-the-fly,
allowing you to use that syntax even if your server doesn't support it. This feature can be enabled in your
config/config.php file. Please note that if you do use this feature, if PHP errors are encountered
+in your view files, the error message and line number will not be accurately shown. Instead, all errors
+will be shown as eval() errors. There are seven preferences you can set to control various aspects of the calendar. Preferences are set using an initialization
-function similar to other classes. Here is an example:
+ There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an
+array of preferences in the second parameter of the loading function. Here is an example:Alternate PHP Syntax for View Files
Automatic Short Tag Support
+
+Alternative Echos
diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html
index 03035170d..ff61701aa 100644
--- a/user_guide/libraries/calendar.html
+++ b/user_guide/libraries/calendar.html
@@ -119,19 +119,18 @@ how data passed to your cells is handled so you can pass different types of info
Setting Display Preferences
-$this->load->library('calendar');
-
+
$prefs = array (
@@ -166,6 +165,30 @@ regarding preferences below.
'start_day' => 'saturday',
'month_type' => 'long',
'day_type' => 'short'
);
-$this->calendar->initialize($prefs);
+$this->load->library('calendar', $prefs);
echo $this->calendar->generate();
To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar +code similar to this example:
+ + +$this->load->library('calendar');
+
+$prefs = array (
+ 'show_next_prev' => TRUE,
+ 'next_prev_url' => 'http://www.your-site.com/index.php/calendar/show/'
+ );
+
+echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4), $prefs);
+
+You'll notice a few things about the above example:
+ +$this->load->library('calendar');
+
$prefs['template'] = '
{table_open}<table border="0" cellpadding="0" cellspacing="0">{/table_open}
@@ -206,39 +229,12 @@ $prefs['template'] = '
{table_close}</table>{/table_close}
';
-$this->calendar->initialize($prefs);
+$this->load->library('calendar', $prefs);
echo $this->calendar->generate();
-Showing Next/Previous Month Links
-
-To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar
-code similar to this example:
-
-
-$this->load->library('calendar');
-
-$prefs = array (
- 'show_next_prev' => TRUE,
- 'next_prev_url' => 'http://www.your-site.com/index.php/calendar/show/'
- );
-
-$this->calendar->initialize($prefs);
-
-echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
-
-You'll notice a few things about the above example:
-
-
-- You must set the "show_next_prev" to TRUE.
-- You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
-- You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
-
-
-
-
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html
index 6a2317da1..1fa93bf17 100644
--- a/user_guide/libraries/file_uploading.html
+++ b/user_guide/libraries/file_uploading.html
@@ -171,7 +171,7 @@ class Upload extends Controller {
$config['max_width'] = '1024';
$config['max_height'] = '768';
- $this->upload->initialize($config);
+ $this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
@@ -230,6 +230,9 @@ $config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
+$this->load->library('ftp', $config);
+
+// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
$this->upload->initialize($config);
The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.
-- cgit v1.2.3-24-g4f1b