From a58ecae8e149fe8e1fa9ee3cc9c9ad23a67ab8b6 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 10:32:10 +0000 Subject: Name can be omiitted from ->dbforge->modify_column()'s 2nd param if you aren't changing the name. --- user_guide/database/forge.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide') diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index 28b32d96a..b9e04428c 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -205,7 +205,7 @@ $this->dbforge->add_column('table_name', $fields);

Used to remove a column from a table.

$this->dbforge->drop_column('table_name', 'column_to_drop');

$this->dbforge->modify_column()

-

The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

+

The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to change the name you can add a "name" key into the field defining array.

$fields = array(
                        'old_name' => array(
                                                         'name' => 'new_name',
-- cgit v1.2.3-24-g4f1b From 4df8b2276bbcc7f025a41b0d09f2f8cd7927b51a Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 15 Dec 2010 14:23:14 +0000 Subject: ['base_url'] is now empty by default and will guess what it should be. --- user_guide/changelog.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c3693e5f9..30734a835 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -76,6 +76,10 @@ Hg Tag:

  • In-development code is now hosted at BitBucket.
  • Removed the deprecated Validation Class.
  • Added CI_ Prefix to all core classes.
  • +
  • Package paths can now be set in application/config/autoload.php.
  • +
  • Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.
  • +
  • Name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.
  • +
  • $config['base_url'] is now empty by default and will guess what it should be.
  • Libraries
  • Libraries
  • Database @@ -176,7 +178,7 @@ Hg Tag:

    Bug fixes for 2.0.0

  • Libraries -- cgit v1.2.3-24-g4f1b From 3b0dea81d3219648ba7cfc154ad107be70ea3649 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 12:22:20 -0600 Subject: filled in some missing change log items --- user_guide/changelog.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6fa133276..50a8caec5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -70,6 +70,7 @@ Hg Tag:

  • Scaffolding, having been deprecated for a number of versions, has been removed.
  • Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
  • Added new special Library type: Drivers.
  • +
  • Added full query-string support. See the config file for details.
  • Moved the application folder outside of the system folder.
  • Moved system/cache and system/logs directories to the application directory.
  • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.
  • @@ -83,9 +84,11 @@ Hg Tag:

  • Upload library file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name.
  • In Database Forge the name can be omitted from $this->dbforge->modify_column()'s 2nd param if you aren't changing the name.
  • $config['base_url'] is now empty by default and will guess what it should be.
  • +
  • Enabled full Command Line Interface compatibility with config['uri_protocol'] = 'CLI';.
  • Libraries ' + + '

    Additional Resources

    ' + + '' + + '' + '

    Class Reference

    ' + @@ -73,7 +79,6 @@ function create_menu(basepath) '
  • Calendar Class
  • ' + '
  • Cart Class
  • ' + '
  • Config Class
  • ' + - '
  • Database Class
  • ' + '
  • Email Class
  • ' + '
  • Encryption Class
  • ' + '
  • File Uploading Class
  • ' + @@ -100,6 +105,13 @@ function create_menu(basepath) '' + + '

    Driver Reference

    ' + + '' + + '

    Helper Reference

    ' + '' + - '

    Additional Resources

    ' + - '' + - ''); } \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 9d3ad267e8e8f2972ceea05c4281b0234ed3efb4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 14:06:58 -0600 Subject: some cleanup for the javascript class docs --- user_guide/libraries/javascript.html | 153 ++++++++++++++++++++++- user_guide/libraries/jquery.html | 236 ----------------------------------- user_guide/nav/nav.js | 1 + user_guide/toc.html | 1 + 4 files changed, 149 insertions(+), 242 deletions(-) delete mode 100644 user_guide/libraries/jquery.html (limited to 'user_guide') diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 864efc82d..55ad18907 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -58,9 +58,9 @@ Input Class

    Note: This driver is experimental. Its feature set and implementation may change in future releases.


    Javascript Class

    -

    Rewrite this paragraph: jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

    +

    CodeIgniter provides a library to help you with certain common functions that you may want to use with Javascript. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

    Initializing the Class

    -

    To initialize the jQuery class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

    +

    To initialize the Javascript class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

    $this->load->library('javascript'); @@ -73,20 +73,161 @@ Input Class

    Once loaded, the jQuery library object will be available using: $this->javascript

    Setup and Configuration

    Set these variables in your view

    -

    As a javascript library, your files must be available to your application. For your convenience, the needed files to run this library are available for download from our site.

    -

    As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

    +

    As a Javascript library, your files must be available to your application.

    +

    As Javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

    <?php echo $library_src;?>
    <?php echo $script_head;?>

    $library_src, is where the actual library file will be loaded, as well as any subsequent plugin script calls; $script_head is where specific events, functions and other commands will be rendered.

    Set the path to the librarys with config items

    -

    There are some configuration items in javascript library. These can either be set in application/config.php, within its own confg/javascript.php file, or within any controller usings the set_item() function.

    +

    There are some configuration items in Javascript library. These can either be set in application/config.php, within its own config/javascript.php file, or within any controller usings the set_item() function.

    An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

    $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');
    $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

    If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.

    -

    For information on outputting events, effects, etc., refer to the jQuery Class documentation.

    +

    The jQuery Class

    + +

    To initialize the jQuery class manually in your controller constructor, use the $this->load->library function:

    + +$this->load->library('jquery'); + +

    You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

    + +$this->load->library('jquery', FALSE); + +

    Once loaded, the jQuery library object will be available using: $this->jquery

    + +

    jQuery Events

    + +

    Events are set using the following syntax.

    + +

    $this->jquery->event('element_path', code_to_run());

    + +

    In the above example:

    + + + +

    Effects

    + +

    The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

    + +

    $this->jquery->effect([optional path] plugin name); +// for example +$this->jquery->effect('bounce'); +

    + +

    hide() / show()

    + +

    Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

    +

    $this->jquery->hide(target, optional speed, optional extra information);
    + $this->jquery->show(target, optional speed, optional extra information);

    + + + +

    toggle()

    + +

    toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.

    +

    $this->jquery->toggle(target);

    + + +

    animate()

    + +

    $this->jquery->animate(target, parameters, optional speed, optional extra information);

    + +

    For a full summary, see http://docs.jquery.com/Effects/animate

    +

    Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.

    +

    $params = array(
    + 'height' => 80,
    + 'width' => '50%',
    + 'marginLeft' => 125
    +);
    +$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));

    + +

    fadeIn() / fadeOut()

    + +

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    + $this->jquery->fadeOut(target, optional speed, optional extra information);

    + + +

    toggleClass()

    + +

    This function will add or remove a CSS class to its target.

    +

    $this->jquery->toggleClass(target, class)

    + + +

    fadeIn() / fadeOut()

    + +

    These effects cause an element(s) to disappear or reappear over time.

    +

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    + $this->jquery->fadeOut(target, optional speed, optional extra information);

    + + +

    slideUp() / slideDown() / slideToggle()

    + +

    These effects cause an element(s) to slide.

    +

    $this->jquery->slideUp(target, optional speed, optional extra information);
    + $this->jquery->slideDown(target, optional speed, optional extra information);
    +$this->jquery->slideToggle(target, optional speed, optional extra information);

    + + +

    Plugins

    + +

    + +

    Some select jQuery plugins are made available using this library.

    + +

    corner()

    +

    Used to add distinct corners to page elements. For full details see http://www.malsup.com/jquery/corner/

    +

    $this->jquery->corner(target, corner_style);

    + +

    $this->jquery->corner("#note", "cool tl br");

    + +

    tablesorter()

    + +

    description to come

    + +

    modal()

    + +

    description to come

    + +

    calendar()

    + +

    description to come

    + diff --git a/user_guide/libraries/jquery.html b/user_guide/libraries/jquery.html deleted file mode 100644 index 732999c57..000000000 --- a/user_guide/libraries/jquery.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - -CodeIgniter User Guide : Input Class - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -

    CodeIgniter User Guide Version 2.0.0

    -
    - - - - - - - - - -
    - - -
    - - - -
    - - -

    jQuery Class

    - -

    jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. CodeIgniter provides a library to help you with certain common functions that you may want to use within jQuery. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

    - -

    Initializing the Class

    - -

    To initialize the jQuery class manually in your controller constructor, use the $this->load->library function:

    - -$this->load->library('jquery'); - -

    You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

    - -$this->load->library('jquery', FALSE); - -

    Once loaded, the jQuery library object will be available using: $this->jquery

    - -

    Setup and Configuration

    - -

    As a javascript library, jquery.js must be available to your application. For your convenience, the needed files to run this library are available for download from our site.

    - -

    As javascript is a client side language, the library must be able to write content into your final output. This generally means a view. You'll need to include the following variables in the <head> sections of your output.

    - -

    <?php echo $jquery_script;?>
    -<?php echo $script_head;?>

    - -

    There are 2 configuration items in jQuery library. These can either be set in application/config.php, or within any controller. The first is the path from the root of your site to the jquery library ('js' is the default) and the second is an image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

    - -

    $config['javascript_folder'] = 'js';
    - $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

    - -

    If you keep your files in the same directories they were downloaded from, then you needed set this configuration items.

    - -

    Events

    - -

    Events are set using the following syntax.

    - -

    $this->jquery->event('element_path', code_to_run());

    - -

    In the above example:

    - -
      -
    • "event" is any of blur, change, click, dblclick, error, focus, hover, keydown, keyup, load, mousedown, mouseup, mouseover, mouseup, resize, scroll, or unload.
    • -
    • "element_path" is any valid jQuery selector. Due to jQuery's unique selector syntax, this is usually an element id, or CSS selector. For example "#notice_area" would effect <div id="notice_area">, and "#content a.notice" would effect all anchors with a class of "notice" in the div with id "content".
    • -
    • "code_to_run()" is script your write yourself, or an action such as an effect from the jQuery library below.
    • -
    - -

    Effects

    - -

    The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

    - -

    $this->jquery->effect([optional path] plugin name); -// for example -$this->jquery->effect('bounce'); -

    - -

    hide() / show()

    - -

    Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

    -

    $this->jquery->hide(target, optional speed, optional extra information);
    - $this->jquery->show(target, optional speed, optional extra information);

    - -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    toggle()

    - -

    toggle() will change the visibility of an item to the opposite of its current state, hiding visible elements, and revealing hidden ones.

    -

    $this->jquery->toggle(target);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    - -

    animate()

    - -

    $this->jquery->animate(target, parameters, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "paramters" in jQuery would generally include a series of CSS properties that you wish to change.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    -

    For a full summary, see http://docs.jquery.com/Effects/animate

    -

    Here is an example of an animate() called on a div with an id of "note", and triggered by a click using the jQuery library's click() event.

    -

    $params = array(
    - 'height' => 80,
    - 'width' => '50%',
    - 'marginLeft' => 125
    -);
    -$this->jquery->click('#trigger', $this->jquery->animate('#note', $params, normal));

    - -

    fadeIn() / fadeOut()

    - -

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    - $this->jquery->fadeOut(target, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    toggleClass()

    - -

    This function will add or remove a CSS class to its target.

    -

    $this->jquery->toggleClass(target, class)

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "class" is any CSS classname. Note that this class must be defined and available in a CSS that is already loaded.
    • -
    - -

    fadeIn() / fadeOut()

    - -

    These effects cause an element(s) to disappear or reappear over time.

    -

    $this->jquery->fadeIn(target, optional speed, optional extra information);
    - $this->jquery->fadeOut(target, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    slideUp() / slideDown() / slideToggle()

    - -

    These effects cause an element(s) to slide.

    -

    $this->jquery->slideUp(target, optional speed, optional extra information);
    - $this->jquery->slideDown(target, optional speed, optional extra information);
    -$this->jquery->slideToggle(target, optional speed, optional extra information);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
    • -
    • "extra information" is optional, and could include a callback, or other additional information.
    • -
    - -

    Plugins

    - -

    - -

    Some select jQuery plugins are made available using this library.

    - -

    corner()

    -

    Used to add distinct corners to page elements. For full details see http://www.malsup.com/jquery/corner/

    -

    $this->jquery->corner(target, corner_style);

    -
      -
    • "target" will be any valid jQuery selector or selectors.
    • -
    • "corner_style" is optional, and can be set to any valid style such as round, sharp, bevel, bite, dog, etc. Individual corners can be set by following the style with a space and using "tl" (top left), "tr" (top right), "bl" (bottom left), or "br" (bottom right).
    • -
    -

    $this->jquery->corner("#note", "cool tl br");

    - -

    tablesorter()

    - -

    description to come

    - -

    modal()

    - -

    description to come

    - -

    calendar()

    - -

    description to come

    - -
    - - - - - - - \ No newline at end of file diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index f1c215c4d..8f16e275f 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -87,6 +87,7 @@ function create_menu(basepath) '
  • HTML Table Class
  • ' + '
  • Image Manipulation Class
  • ' + '
  • Input Class
  • ' + + '
  • Javascript Class
  • ' + '
  • Loader Class
  • ' + '
  • Language Class
  • ' + '
  • Output Class
  • ' + diff --git a/user_guide/toc.html b/user_guide/toc.html index 68a7569f8..5eb9c2acc 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -136,6 +136,7 @@ Table of Contents
  • HTML Table Class
  • Image Manipulation Class
  • Input Class
  • +
  • Javascript Class
  • Loader Class
  • Language Class
  • Output Class
  • -- cgit v1.2.3-24-g4f1b From 8efefd1f2cc09caccedccbc6c6b2f18b3c58265d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 28 Jan 2011 14:30:42 -0600 Subject: adding release notes to change log --- user_guide/changelog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 50a8caec5..35187efda 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -60,8 +60,8 @@ Change Log

    The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

    Version 2.0.0

    -

    Release Date: not yet released
    -Hg Tag:

    +

    Release Date: January 28, 2011
    +Hg Tag: v2.0.0

    • General changes -- cgit v1.2.3-24-g4f1b From d91d0f7544967869248743c7ca663159d93628f5 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 30 Jan 2011 20:47:42 -0500 Subject: Fixed breadcrumb and removed errand parentheses. --- user_guide/libraries/javascript.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'user_guide') diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 55ad18907..18b7181b0 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -2,7 +2,7 @@ -CodeIgniter User Guide : JavaScript Class +JavaScript Driver : CodeIgniter User Guide @@ -42,7 +42,8 @@ CodeIgniter Home  ›  User Guide Home  ›  -Input Class +Drivers  ›  +JavaScript Driver
      Search User Guide   
      @@ -57,7 +58,7 @@ Input Class

      Note: This driver is experimental. Its feature set and implementation may change in future releases.


      -

      Javascript Class

      +

      Javascript Driver

      CodeIgniter provides a library to help you with certain common functions that you may want to use with Javascript. Please note that CodeIgniter does not require the jQuery library to run, and that any scripting library will work equally well. The jQuery library is simply presented as a convenience if you choose to use it.

      Initializing the Class

      To initialize the Javascript class manually in your controller constructor, use the $this->load->library function. Currently, the only available library is jQuery, which will automatically be loaded like this:

      @@ -82,7 +83,7 @@ Input Class

      Set the path to the librarys with config items

      There are some configuration items in Javascript library. These can either be set in application/config.php, within its own config/javascript.php file, or within any controller usings the set_item() function.

      An image to be used as an "ajax loader", or progress indicator. Without one, the simple text message of "loading" will appear when Ajax calls need to be made.

      -

      $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/');
      +

      $config['javascript_location'] = 'http://localhost/codeigniter/themes/js/jquery/';
      $config['javascript_ajax_img'] = 'images/ajax-loader.gif';

      If you keep your files in the same directories they were downloaded from, then you need not set this configuration items.

      -- cgit v1.2.3-24-g4f1b From c7f2bd28a8b26a6ed61f83f1d75fdd78aa37ebfe Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 30 Jan 2011 20:50:08 -0500 Subject: The db utility had the wrong code example for database_exists(). Fixes #26 --- user_guide/database/utilities.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide') diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index d4296fe2e..ac3841641 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -102,13 +102,13 @@ foreach($dbs as $db)
      }
      -

      $this->db->database_exists();

      +

      $this->dbutil->database_exists();

      Sometimes it's helpful to know whether a particular database exists. Returns a boolean TRUE/FALSE. Usage example:

      -if ($this->db->database_exists('database_name'))
      +if ($this->dbutil->database_exists('database_name'))
      {
         // some code...
      } -- cgit v1.2.3-24-g4f1b From 5fd02675ed3d079c2719374b890fac599a2ef991 Mon Sep 17 00:00:00 2001 From: katzgrau Date: Wed, 2 Feb 2011 16:33:05 -0500 Subject: Added a better explanation for the 'autoinit' db option. Side note: should that really be true by default? --- user_guide/database/configuration.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide') diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index e9db5fc87..d71cd34db 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -134,7 +134,7 @@ for the primary connection, but it too can be renamed to something more relevant
    • char_set - The character set used in communicating with the database.
    • dbcollat - The character collation used in communicating with the database.
    • swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
    • -
    • autoinit - Whether or not to automatically initialize the database.
    • +
    • autoinit - Whether or not to automatically connect to the database when the library loads. If set to false, the connection will take place prior to executing the first query.
    • stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
    • port - The database port number. To use this value you have to add a line to the database config array.$db['default']['port'] = 5432;
    -- cgit v1.2.3-24-g4f1b From 58e8caf2afb3ea054f83999fb0698720a1a58738 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Sat, 5 Feb 2011 22:19:57 -0500 Subject: Added documentation for changes to DB_result --- user_guide/database/results.html | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'user_guide') diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 75cb190f9..e9a5cb4cf 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -98,6 +98,18 @@ Query Results } +

    You can also pass a string to result() which represents a class to instantiate for each result object (note: this class must be loaded)

    + + + $query = $this->db->query("SELECT * FROM users;");
    +
    + foreach ($query->result('User') as $user)
    + {
    +    echo $row->name; // call attributes
    +    echo $row->reverse_name(); // or methods defined on the 'User' class
    + } +
    +

    result_array()

    This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

    @@ -133,6 +145,15 @@ Query Results $row = $query->row(5); +

    You can also add a second String parameter, which is the name of a class to instantiate the row with:

    + + + $query = $this->db->query("SELECT * FROM users LIMIT 1;");
    +
    + $query->row(0, 'User')
    + echo $row->name; // call attributes
    + echo $row->reverse_name(); // or methods defined on the 'User' class
    +

    row_array()

    @@ -235,4 +256,4 @@ Next Topic:  Query Helper Functions - \ No newline at end of file + -- cgit v1.2.3-24-g4f1b From 01d1a5b936556f3b19786b7407cce11cf3bdb616 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 7 Feb 2011 10:54:06 +0000 Subject: CLI requests can now be run from any folder, not just when CD'ed next to index.php. --- user_guide/changelog.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 35187efda..09a2cefce 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -59,6 +59,15 @@ Change Log

    The Reactor Marker indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.

    +

    Version 2.0.1

    +

    Release Date: n/a
    +Hg Tag: n/a

    + +

    Bug fixes for 2.0.1

    +
      +
    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • +
    +

    Version 2.0.0

    Release Date: January 28, 2011
    Hg Tag: v2.0.0

    -- cgit v1.2.3-24-g4f1b From ef112c0830df4a31563351125888b0d522a1c965 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 7 Feb 2011 13:01:47 +0000 Subject: Added decimal, less_than and greater_than rules to the Form validation Class. --- user_guide/changelog.html | 8 + user_guide/libraries/form_validation.html | 310 ++++++++++++++++-------------- 2 files changed, 177 insertions(+), 141 deletions(-) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 09a2cefce..cd728226b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -63,6 +63,14 @@ Change Log

    Release Date: n/a
    Hg Tag: n/a

    + +

    Bug fixes for 2.0.1

    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 935dca61f..d6120054b 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -924,118 +924,146 @@ POST array:

      The following is a list of all the native rules that are available to use:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      RuleParameterDescriptionExample
      requiredNoReturns FALSE if the form element is empty. 
      matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
      min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
      max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
      exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
      alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
      alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
      alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
      numericNoReturns FALSE if the form element contains anything other than numeric characters. 
      integerNoReturns FALSE if the form element contains anything other than an integer. 
      is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
      is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
      valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
      valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
      valid_ipNoReturns FALSE if the supplied IP is not valid. 
      valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
      RuleParameterDescriptionExample
      requiredNoReturns FALSE if the form element is empty. 
      matchesYesReturns FALSE if the form element does not match the one in the parameter.matches[form_item]
      min_lengthYesReturns FALSE if the form element is shorter then the parameter value.min_length[6]
      max_lengthYesReturns FALSE if the form element is longer then the parameter value.max_length[12]
      exact_lengthYesReturns FALSE if the form element is not exactly the parameter value.exact_length[8]
      greater_thanYesReturns FALSE if the form element is less than the parameter value or not numeric.greater_than[8]
      less_thanYesReturns FALSE if the form element is greater than the parameter value or not numeric.less_than[8]
      alphaNoReturns FALSE if the form element contains anything other than alphabetical characters. 
      alpha_numericNoReturns FALSE if the form element contains anything other than alpha-numeric characters. 
      alpha_dashNoReturns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. 
      numericNoReturns FALSE if the form element contains anything other than numeric characters. 
      integerNoReturns FALSE if the form element contains anything other than an integer. 
      decimalYesReturns FALSE if the form element is not exactly the parameter value. 
      is_naturalNoReturns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc. 
      is_natural_no_zeroNoReturns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. 
      valid_emailNoReturns FALSE if the form element does not contain a valid email address. 
      valid_emailsNoReturns FALSE if any value provided in a comma separated list is not a valid email. 
      valid_ipNoReturns FALSE if the supplied IP is not valid. 
      valid_base64NoReturns FALSE if the supplied string contains anything other than valid Base64 characters. 
      @@ -1058,36 +1086,36 @@ POST array:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      NameParameterDescription
      xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
      prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
      prep_urlNoAdds "http://" to URLs if missing.
      strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
      encode_php_tagsNoConverts PHP tags to entities.
      NameParameterDescription
      xss_cleanNoRuns the data through the XSS filtering function, described in the Input Class page.
      prep_for_formNoConverts special characters so that HTML data can be shown in a form field without breaking it.
      prep_urlNoAdds "http://" to URLs if missing.
      strip_image_tagsNoStrips the HTML from image tags leaving the raw URL.
      encode_php_tagsNoConverts PHP tags to entities.
      -- cgit v1.2.3-24-g4f1b From 3167eebb81d740e0a74b28ff0353dd4fcf110d0e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 8 Feb 2011 21:19:28 +0000 Subject: MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cd728226b..0aac5aec5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@ Hg Tag: n/a

      Bug fixes for 2.0.1

      • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
      • +
      • MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.

      Version 2.0.0

      -- cgit v1.2.3-24-g4f1b From a12216baff3aef18413a84e3d37aba2096b5ebe8 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 9 Feb 2011 16:09:31 +0000 Subject: Reverted recent MySQL backtick escaping as some queries were double-escaping. --- user_guide/changelog.html | 1 - 1 file changed, 1 deletion(-) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 0aac5aec5..cd728226b 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,7 +74,6 @@ Hg Tag: n/a

      Bug fixes for 2.0.1

      • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
      • -
      • MySQL Driver will now wrap field names for insert(), update() and replace() with backticks (`) so fields like "default" and "order" will not cause SQL errors.

      Version 2.0.0

      -- cgit v1.2.3-24-g4f1b From ff5c948222d5985312be71b917594e5e438addc3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 9 Feb 2011 16:10:58 +0000 Subject: Fixed issue #41: Added audio/mp3 mime type to mp3. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index cd728226b..388f25d2a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -74,6 +74,7 @@ Hg Tag: n/a

      Bug fixes for 2.0.1

      • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
      • +
      • Fixed issue #41: Added audio/mp3 mime type to mp3.

      Version 2.0.0

      -- cgit v1.2.3-24-g4f1b From 5d990f97ec60cb46a1bd2cd84eef110a3dd837e3 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 13 Feb 2011 15:11:32 -0500 Subject: Changed the downloads to be 2.0.0 - Fixes #47 --- user_guide/installation/downloads.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'user_guide') diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index d580fde7b..ad653307a 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -58,7 +58,9 @@ Downloading CodeIgniter

      Downloading CodeIgniter

      +

      Additional Resources

      + + + @@ -127,7 +134,6 @@ Table of Contents
    • Calendar Class
    • Cart Class
    • Config Class
    • -
    • Database Class
    • Email Class
    • Encryption Class
    • File Uploading Class
    • @@ -157,6 +163,13 @@ Table of Contents +

      Driver Reference

      + +

      Helper Reference

      -

      Additional Resources

      - -- cgit v1.2.3-24-g4f1b From ff1cfa1ae5c5440bfde35c36ecb4cdcd73cd3966 Mon Sep 17 00:00:00 2001 From: vascopj Date: Sun, 13 Feb 2011 21:30:19 +0000 Subject: Updated the post method and added the new functionality to the get method also Updated the documentation --- user_guide/changelog.html | 1 + user_guide/libraries/input.html | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 35187efda..92513e6d6 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -120,6 +120,7 @@ Hg Tag: v2.0.0

    • Altered Email Library to allow for method chaining.
    • Added request_headers(), get_request_header() and is_ajax_request() to the input class.
    • Altered User agent library so that is_browser(), is_mobile() and is_robot() can optionally check for a specific browser or mobile device.
    • +
    • Altered Input library so that post() and get() will return all POST and GET items (respectively) if there are no parameters passed in.
  • Database diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 552c49afd..4faecd768 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -132,12 +132,32 @@ else
    $this->input->post('some_data', TRUE); +

    To return an array of all POST items call without any parameters.

    +

    To return all POST items and pass them through the XSS filter leave the first parameter blank while setting the second parameter to boolean;

    +

    The function returns FALSE (boolean) if there are no items in the POST.

    + + + $this->input->post(); // returns all POST items with XSS filter +
    + $this->input->post('', FALSE); // returns all POST items without XSS +
    +

    $this->input->get()

    This function is identical to the post function, only it fetches get data:

    $this->input->get('some_data', TRUE); +

    To return an array of all GET items call without any parameters.

    +

    To return all GET items and pass them through the XSS filter leave the first parameter blank while setting the second parameter to boolean;

    +

    The function returns FALSE (boolean) if there are no items in the GET.

    + + + $this->input->get(); // returns all GET items with XSS filter +
    + $this->input->get('', FALSE); // returns all GET items without XSS filtering +
    +

    $this->input->get_post()

    This function will search through both the post and get streams for data, looking first in post, and then in get:

    -- cgit v1.2.3-24-g4f1b From 23351dc30a1787d30a97dd0a8ba83d6e312a5a2f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 14 Feb 2011 00:14:21 -0600 Subject: Fix #329 where the file caching driver referenced the incorrect cache directory. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 388f25d2a..c37bd4f26 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@ Hg Tag: n/a

    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • Fixed issue #41: Added audio/mp3 mime type to mp3.
    • +
    • Fixed a bug (#329) where the file caching driver referenced the incorrect cache directory.

    Version 2.0.0

    -- cgit v1.2.3-24-g4f1b From feba2de9287ed2c5d43e555fc52ce2bdedfed0d9 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:25:30 -0500 Subject: Whitespace tweaks to put code examples in line with our guidelines --- user_guide/database/utilities.html | 2 +- user_guide/general/alternative_php.html | 2 +- user_guide/general/views.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'user_guide') diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index ac3841641..4a8b6739e 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -96,7 +96,7 @@ already be running, since the utilities class relies on it.

    $dbs = $this->dbutil->list_databases();

    -foreach($dbs as $db)
    +foreach ($dbs as $db)
    {
        echo $db;
    }
    diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html index 652cdad29..c843f2f6e 100644 --- a/user_guide/general/alternative_php.html +++ b/user_guide/general/alternative_php.html @@ -94,7 +94,7 @@ written in a simplified format as well. Here is an example using foreach:

    <ul>

    -<?php foreach($todo as $item): ?>
    +<?php foreach ($todo as $item): ?>

    <li><?=$item?></li>

    diff --git a/user_guide/general/views.html b/user_guide/general/views.html index fd5bde6af..746f7b846 100644 --- a/user_guide/general/views.html +++ b/user_guide/general/views.html @@ -233,7 +233,7 @@ class Blog extends CI_Controller { <h3>My Todo List</h3> <ul> -<?php foreach($todo_list as $item):?> +<?php foreach ($todo_list as $item):?> <li><?php echo $item;?></li> diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index bc0721bb4..fe87a23f2 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -178,7 +178,7 @@ $this->cart->insert($data); <?php $i = 1; ?> -<?php foreach($this->cart->contents() as $items): ?> +<?php foreach ($this->cart->contents() as $items): ?> <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?> diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index c5eab4695..5c3162819 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -125,7 +125,7 @@ In it, place this code and save it to your applications/views/ fold <h3>Your file was successfully uploaded!</h3> <ul> -<?php foreach($upload_data as $item => $value):?> +<?php foreach ($upload_data as $item => $value):?> <li><?php echo $item;?>: <?php echo $value;?></li> <?php endforeach; ?> </ul> -- cgit v1.2.3-24-g4f1b From 44f210543cf6adcac99264d973dd73ea1b0ab37e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 15 Feb 2011 21:39:25 +0000 Subject: Input post() and get() will now return a full array if the first argument is not provided. --- user_guide/changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d58d43552..ccfbd0528 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,7 +66,8 @@ Hg Tag: n/a

    • Libraries
        -
      • Added decimal, less_than and greater_than rules to the Form validation Class.
      • +
      • Added decimal, less_than and greater_than rules to the Form validation Class.
      • +
      • Input Class methods post() and get() will now return a full array if the first argument is not provided.
    -- cgit v1.2.3-24-g4f1b From f2b9c911bcee47166f3fdc8f2f57d1cafeade006 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 16:56:37 +0000 Subject: Applied Dan's fix for the incorrectly named Sha1 class. --- user_guide/changelog.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ccfbd0528..4d3b502a8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -76,7 +76,8 @@ Hg Tag: n/a

    • CLI requests can now be run from any folder, not just when CD'ed next to index.php.
    • Fixed issue #41: Added audio/mp3 mime type to mp3.
    • -
    • Fixed a bug (#329) where the file caching driver referenced the incorrect cache directory.
    • +
    • Fixed a bug (Core #329) where the file caching driver referenced the incorrect cache directory.
    • +
    • Fixed a bug (Reactor #69) where the SHA1 library was named incorrectly.

    Version 2.0.0

    -- cgit v1.2.3-24-g4f1b From d8d1e24eee56d2466c91ecd72b3c8932eb3d0639 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 17:23:16 +0000 Subject: Secure cookies can now be made with the set_cookie() helper and Input Class method. --- user_guide/changelog.html | 1 + user_guide/libraries/input.html | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'user_guide') diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4d3b502a8..ab825c8d8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -68,6 +68,7 @@ Hg Tag: n/a

    • Added decimal, less_than and greater_than rules to the Form validation Class.
    • Input Class methods post() and get() will now return a full array if the first argument is not provided.
    • +
    • Secure cookies can now be made with the set_cookie() helper and Input Class method.
  • diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 4faecd768..844e99ab8 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -187,13 +187,14 @@ Array Method, and Discrete Parameters:

    Using this method, an associative array is passed to the first parameter:

    $cookie = array(
    -                   'name'   => 'The Cookie Name',
    -                   'value'  => 'The Value',
    -                   'expire' => '86500',
    -                   'domain' => '.some-domain.com',
    -                   'path'   => '/',
    -                   'prefix' => 'myprefix_',
    -               );
    +    'name'   => 'The Cookie Name',
    +    'value'  => 'The Value',
    +    'expire' => '86500',
    +    'domain' => '.some-domain.com',
    +    'path'   => '/',
    +    'prefix' => 'myprefix_',
    +    'secure' => TRUE
    +);

    $this->input->set_cookie($cookie);
    @@ -208,12 +209,13 @@ zero the cookie will only last as long as the browser is open.

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    The path is usually not needed since the function sets a root path.

    The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

    +

    The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.

    Discrete Parameters

    If you prefer, you can set the cookie by passing data using individual parameters:

    -$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); +$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);

    $this->input->get_cookie()

    -- cgit v1.2.3-24-g4f1b