diff options
author | Andrey Andreev <narf@devilix.net> | 2018-06-12 15:45:46 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2018-06-12 15:45:46 +0200 |
commit | 30e2eafa86c4c7b6b39cea3e7089a90df9f603fb (patch) | |
tree | 391bc1e62d8d0ad045e18a6da72e3e2a59e91503 /user_guide/general | |
parent | a9da3dd2f16a8f97d7bc4ff5572b28e4bb84c813 (diff) |
[ci skip] 3.1.9 release
Diffstat (limited to 'user_guide/general')
30 files changed, 18974 insertions, 0 deletions
diff --git a/user_guide/general/alternative_php.html b/user_guide/general/alternative_php.html new file mode 100644 index 000000000..1c5a1913c --- /dev/null +++ b/user_guide/general/alternative_php.html @@ -0,0 +1,566 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Alternate PHP Syntax for View Files — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Security" href="security.html"/> + <link rel="prev" title="Handling Multiple Environments" href="environments.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Alternate PHP Syntax for View Files</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="alternate-php-syntax-for-view-files"> +<h1>Alternate PHP Syntax for View Files<a class="headerlink" href="#alternate-php-syntax-for-view-files" title="Permalink to this headline">¶</a></h1> +<p>If you do not utilize CodeIgniter’s <a class="reference internal" href="../libraries/parser.html"><span class="doc">template +engine</span></a>, 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 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.</p> +<div class="section" id="automatic-short-tag-support"> +<h2>Automatic Short Tag Support<a class="headerlink" href="#automatic-short-tag-support" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">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. CodeIgniter 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 <em>config/config.php</em> file.</p> +</div> +<p>Please note that if you do use this feature, if PHP errors are +encountered in your <strong>view files</strong>, the error message and line number +will not be accurately shown. Instead, all errors will be shown as +<code class="docutils literal"><span class="pre">eval()</span></code> errors.</p> +</div> +<div class="section" id="alternative-echos"> +<h2>Alternative Echos<a class="headerlink" href="#alternative-echos" title="Permalink to this headline">¶</a></h2> +<p>Normally to echo, or print out a variable you would do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nv">$variable</span><span class="p">;</span> <span class="cp">?></span> +</pre></div> +</div> +<p>With the alternative syntax you can instead do it this way:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?=</span><span class="nv">$variable</span><span class="cp">?></span> +</pre></div> +</div> +</div> +<div class="section" id="alternative-control-structures"> +<h2>Alternative Control Structures<a class="headerlink" href="#alternative-control-structures" title="Permalink to this headline">¶</a></h2> +<p>Controls structures, like if, for, foreach, and while can be written in +a simplified format as well. Here is an example using <code class="docutils literal"><span class="pre">foreach</span></code>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">ul</span><span class="o">></span> + +<span class="o"><?</span><span class="nx">php</span> <span class="k">foreach</span> <span class="p">(</span><span class="nv">$todo</span> <span class="k">as</span> <span class="nv">$item</span><span class="p">)</span><span class="o">:</span> <span class="cp">?></span> + + <span class="p"><</span><span class="nt">li</span><span class="p">></span><span class="cp"><?</span><span class="o">=</span><span class="nv">$item</span><span class="cp">?></span><span class="p"></</span><span class="nt">li</span><span class="p">></span> + +<span class="cp"><?php</span> <span class="k">endforeach</span><span class="p">;</span> <span class="cp">?></span> + +<span class="p"></</span><span class="nt">ul</span><span class="p">></span> +</pre></div> +</div> +<p>Notice that there are no braces. Instead, the end brace is replaced with +<code class="docutils literal"><span class="pre">endforeach</span></code>. Each of the control structures listed above has a similar +closing syntax: <code class="docutils literal"><span class="pre">endif</span></code>, <code class="docutils literal"><span class="pre">endfor</span></code>, <code class="docutils literal"><span class="pre">endforeach</span></code>, and <code class="docutils literal"><span class="pre">endwhile</span></code></p> +<p>Also notice that instead of using a semicolon after each structure +(except the last one), there is a colon. This is important!</p> +<p>Here is another example, using <code class="docutils literal"><span class="pre">if</span></code>/<code class="docutils literal"><span class="pre">elseif</span></code>/<code class="docutils literal"><span class="pre">else</span></code>. Notice the colons:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> <span class="k">if</span> <span class="p">(</span><span class="nv">$username</span> <span class="o">===</span> <span class="s1">'sally'</span><span class="p">)</span><span class="o">:</span> <span class="cp">?></span> + + <span class="p"><</span><span class="nt">h3</span><span class="p">></span>Hi Sally<span class="p"></</span><span class="nt">h3</span><span class="p">></span> + +<span class="cp"><?php</span> <span class="k">elseif</span> <span class="p">(</span><span class="nv">$username</span> <span class="o">===</span> <span class="s1">'joe'</span><span class="p">)</span><span class="o">:</span> <span class="cp">?></span> + + <span class="p"><</span><span class="nt">h3</span><span class="p">></span>Hi Joe<span class="p"></</span><span class="nt">h3</span><span class="p">></span> + +<span class="cp"><?php</span> <span class="k">else</span><span class="o">:</span> <span class="cp">?></span> + + <span class="p"><</span><span class="nt">h3</span><span class="p">></span>Hi unknown user<span class="p"></</span><span class="nt">h3</span><span class="p">></span> + +<span class="cp"><?php</span> <span class="k">endif</span><span class="p">;</span> <span class="cp">?></span> +</pre></div> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="security.html" class="btn btn-neutral float-right" title="Security">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="environments.html" class="btn btn-neutral" title="Handling Multiple Environments"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/ancillary_classes.html b/user_guide/general/ancillary_classes.html new file mode 100644 index 000000000..6c24e8700 --- /dev/null +++ b/user_guide/general/ancillary_classes.html @@ -0,0 +1,578 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Creating Ancillary Classes — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Hooks - Extending the Framework Core" href="hooks.html"/> + <link rel="prev" title="Creating Core System Classes" href="core_classes.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Creating Ancillary Classes</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="creating-ancillary-classes"> +<h1>Creating Ancillary Classes<a class="headerlink" href="#creating-ancillary-classes" title="Permalink to this headline">¶</a></h1> +<p>In some cases you may want to develop classes that exist apart from your +controllers but have the ability to utilize all of CodeIgniter’s +resources. This is easily possible as you’ll see.</p> +<div class="section" id="get-instance"> +<h2>get_instance()<a class="headerlink" href="#get-instance" title="Permalink to this headline">¶</a></h2> +<dl class="function"> +<dt id="get_instance"> +<code class="descname">get_instance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#get_instance" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Reference to your controller’s instance</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">CI_Controller</td> +</tr> +</tbody> +</table> +</dd></dl> + +<p><strong>Any class that you instantiate within your controller methods can +access CodeIgniter’s native resources</strong> simply by using the +<code class="docutils literal"><span class="pre">get_instance()</span></code> function. This function returns the main +CodeIgniter object.</p> +<p>Normally, to call any of the available methods, CodeIgniter requires +you to use the <code class="docutils literal"><span class="pre">$this</span></code> construct:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'session'</span><span class="p">);</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">config</span><span class="o">-></span><span class="na">item</span><span class="p">(</span><span class="s1">'base_url'</span><span class="p">);</span> +<span class="c1">// etc.</span> +</pre></div> +</div> +<p><code class="docutils literal"><span class="pre">$this</span></code>, however, only works within your controllers, your models, +or your views. If you would like to use CodeIgniter’s classes from +within your own custom classes you can do so as follows:</p> +<p>First, assign the CodeIgniter object to a variable:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> +</pre></div> +</div> +<p>Once you’ve assigned the object to a variable, you’ll use that variable +<em>instead</em> of <code class="docutils literal"><span class="pre">$this</span></code>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> + +<span class="nv">$CI</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> +<span class="nv">$CI</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'session'</span><span class="p">);</span> +<span class="nv">$CI</span><span class="o">-></span><span class="na">config</span><span class="o">-></span><span class="na">item</span><span class="p">(</span><span class="s1">'base_url'</span><span class="p">);</span> +<span class="c1">// etc.</span> +</pre></div> +</div> +<p>If you’ll be using <code class="docutils literal"><span class="pre">get_instance()</span></code> inside another class, then it would +be better if you assign it to a property. This way, you won’t need to call +<code class="docutils literal"><span class="pre">get_instance()</span></code> in every single method.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Example</span> <span class="p">{</span> + + <span class="k">protected</span> <span class="nv">$CI</span><span class="p">;</span> + + <span class="c1">// We'll use a constructor, as you can't directly call a function</span> + <span class="c1">// from a property definition.</span> + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">()</span> + <span class="p">{</span> + <span class="c1">// Assign the CodeIgniter super-object</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">foo</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">CI</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> + <span class="nx">redirect</span><span class="p">();</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">bar</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">CI</span><span class="o">-></span><span class="na">config</span><span class="o">-></span><span class="na">item</span><span class="p">(</span><span class="s1">'base_url'</span><span class="p">);</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>In the above example, both methods <code class="docutils literal"><span class="pre">foo()</span></code> and <code class="docutils literal"><span class="pre">bar()</span></code> will work +after you instantiate the Example class, without the need to call +<code class="docutils literal"><span class="pre">get_instance()</span></code> in each of them.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="hooks.html" class="btn btn-neutral float-right" title="Hooks - Extending the Framework Core">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="core_classes.html" class="btn btn-neutral" title="Creating Core System Classes"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/autoloader.html b/user_guide/general/autoloader.html new file mode 100644 index 000000000..9a92a1ddc --- /dev/null +++ b/user_guide/general/autoloader.html @@ -0,0 +1,519 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Auto-loading Resources — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Common Functions" href="common_functions.html"/> + <link rel="prev" title="Hooks - Extending the Framework Core" href="hooks.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Auto-loading Resources</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="auto-loading-resources"> +<h1>Auto-loading Resources<a class="headerlink" href="#auto-loading-resources" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter comes with an “Auto-load” feature that permits libraries, +helpers, and models to be initialized automatically every time the +system runs. If you need certain resources globally throughout your +application you should consider auto-loading them for convenience.</p> +<p>The following items can be loaded automatically:</p> +<ul class="simple"> +<li>Classes found in the <em>libraries/</em> directory</li> +<li>Helper files found in the <em>helpers/</em> directory</li> +<li>Custom config files found in the <em>config/</em> directory</li> +<li>Language files found in the <em>system/language/</em> directory</li> +<li>Models found in the <em>models/</em> folder</li> +</ul> +<p>To autoload resources, open the <strong>application/config/autoload.php</strong> +file and add the item you want loaded to the autoload array. You’ll +find instructions in that file corresponding to each type of item.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Do not include the file extension (.php) when adding items to +the autoload array.</p> +</div> +<p>Additionally, if you want CodeIgniter to use a <a class="reference external" href="https://getcomposer.org/">Composer</a> +auto-loader, just set <code class="docutils literal"><span class="pre">$config['composer_autoload']</span></code> to <code class="docutils literal"><span class="pre">TRUE</span></code> or +a custom path in <strong>application/config/config.php</strong>.</p> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="common_functions.html" class="btn btn-neutral float-right" title="Common Functions">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="hooks.html" class="btn btn-neutral" title="Hooks - Extending the Framework Core"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/caching.html b/user_guide/general/caching.html new file mode 100644 index 000000000..6a6cb845d --- /dev/null +++ b/user_guide/general/caching.html @@ -0,0 +1,563 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Web Page Caching — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Profiling Your Application" href="profiling.html"/> + <link rel="prev" title="Error Handling" href="errors.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Web Page Caching</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="web-page-caching"> +<h1>Web Page Caching<a class="headerlink" href="#web-page-caching" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter lets you cache your pages in order to achieve maximum +performance.</p> +<p>Although CodeIgniter is quite fast, the amount of dynamic information +you display in your pages will correlate directly to the server +resources, memory, and processing cycles utilized, which affect your +page load speeds. By caching your pages, since they are saved in their +fully rendered state, you can achieve performance that nears that of +static web pages.</p> +<div class="section" id="how-does-caching-work"> +<h2>How Does Caching Work?<a class="headerlink" href="#how-does-caching-work" title="Permalink to this headline">¶</a></h2> +<p>Caching can be enabled on a per-page basis, and you can set the length +of time that a page should remain cached before being refreshed. When a +page is loaded for the first time, the cache file will be written to +your application/cache folder. On subsequent page loads the cache file +will be retrieved and sent to the requesting user’s browser. If it has +expired, it will be deleted and refreshed before being sent to the +browser.</p> +</div> +<div class="section" id="enabling-caching"> +<h2>Enabling Caching<a class="headerlink" href="#enabling-caching" title="Permalink to this headline">¶</a></h2> +<p>To enable caching, put the following tag in any of your controller +methods:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">cache</span><span class="p">(</span><span class="nv">$n</span><span class="p">);</span> +</pre></div> +</div> +<p>Where <code class="docutils literal"><span class="pre">$n</span></code> is the number of <strong>minutes</strong> you wish the page to remain +cached between refreshes.</p> +<p>The above tag can go anywhere within a method. It is not affected by +the order that it appears, so place it wherever it seems most logical to +you. Once the tag is in place, your pages will begin being cached.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Because of the way CodeIgniter stores content for output, +caching will only work if you are generating display for your +controller with a <a class="reference internal" href="views.html"><span class="doc">view</span></a>.</p> +</div> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">If you change configuration options that might affect +your output, you have to manually delete your cache files.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Before the cache files can be written you must set the file +permissions on your <em>application/cache/</em> directory such that +it is writable.</p> +</div> +</div> +<div class="section" id="deleting-caches"> +<h2>Deleting Caches<a class="headerlink" href="#deleting-caches" title="Permalink to this headline">¶</a></h2> +<p>If you no longer wish to cache a file you can remove the caching tag and +it will no longer be refreshed when it expires.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Removing the tag will not delete the cache immediately. It will +have to expire normally.</p> +</div> +<p>If you need to manually delete the cache, you can use the <code class="docutils literal"><span class="pre">delete_cache()</span></code> +method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Deletes cache for the currently requested URI</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">delete_cache</span><span class="p">();</span> + +<span class="c1">// Deletes cache for /foo/bar</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">delete_cache</span><span class="p">(</span><span class="s1">'/foo/bar'</span><span class="p">);</span> +</pre></div> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="profiling.html" class="btn btn-neutral float-right" title="Profiling Your Application">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="errors.html" class="btn btn-neutral" title="Error Handling"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html new file mode 100644 index 000000000..ea2b31060 --- /dev/null +++ b/user_guide/general/cli.html @@ -0,0 +1,573 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Running via the CLI — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Managing your Applications" href="managing_apps.html"/> + <link rel="prev" title="Profiling Your Application" href="profiling.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Running via the CLI</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="running-via-the-cli"> +<h1><a class="toc-backref" href="#id1">Running via the CLI</a><a class="headerlink" href="#running-via-the-cli" title="Permalink to this headline">¶</a></h1> +<p>As well as calling an applications <a class="reference internal" href="controllers.html"><span class="doc">Controllers</span></a> +via the URL in a browser they can also be loaded via the command-line +interface (CLI).</p> +<div class="contents topic" id="page-contents"> +<p class="topic-title first">Page Contents</p> +<ul class="simple"> +<li><a class="reference internal" href="#running-via-the-cli" id="id1">Running via the CLI</a><ul> +<li><a class="reference internal" href="#what-is-the-cli" id="id2">What is the CLI?</a></li> +<li><a class="reference internal" href="#why-run-via-the-command-line" id="id3">Why run via the command-line?</a></li> +<li><a class="reference internal" href="#let-s-try-it-hello-world" id="id4">Let’s try it: Hello World!</a></li> +<li><a class="reference internal" href="#that-s-it" id="id5">That’s it!</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="what-is-the-cli"> +<h2><a class="toc-backref" href="#id2">What is the CLI?</a><a class="headerlink" href="#what-is-the-cli" title="Permalink to this headline">¶</a></h2> +<p>The command-line interface is a text-based method of interacting with +computers. For more information, check the <a class="reference external" href="http://en.wikipedia.org/wiki/Command-line_interface">Wikipedia +article</a>.</p> +</div> +<div class="section" id="why-run-via-the-command-line"> +<h2><a class="toc-backref" href="#id3">Why run via the command-line?</a><a class="headerlink" href="#why-run-via-the-command-line" title="Permalink to this headline">¶</a></h2> +<p>There are many reasons for running CodeIgniter from the command-line, +but they are not always obvious.</p> +<ul class="simple"> +<li>Run your cron-jobs without needing to use <em>wget</em> or <em>curl</em></li> +<li>Make your cron-jobs inaccessible from being loaded in the URL by +checking the return value of <a class="reference internal" href="common_functions.html#is_cli" title="is_cli"><code class="xref php php-func docutils literal"><span class="pre">is_cli()</span></code></a>.</li> +<li>Make interactive “tasks” that can do things like set permissions, +prune cache folders, run backups, etc.</li> +<li>Integrate with other applications in other languages. For example, a +random C++ script could call one command and run code in your models!</li> +</ul> +</div> +<div class="section" id="let-s-try-it-hello-world"> +<h2><a class="toc-backref" href="#id4">Let’s try it: Hello World!</a><a class="headerlink" href="#let-s-try-it-hello-world" title="Permalink to this headline">¶</a></h2> +<p>Let’s create a simple controller so you can see it in action. Using your +text editor, create a file called Tools.php, and put the following code +in it:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Tools</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">message</span><span class="p">(</span><span class="nv">$to</span> <span class="o">=</span> <span class="s1">'World'</span><span class="p">)</span> + <span class="p">{</span> + <span class="k">echo</span> <span class="s2">"Hello </span><span class="si">{</span><span class="nv">$to</span><span class="si">}</span><span class="s2">!"</span><span class="o">.</span><span class="nx">PHP_EOL</span><span class="p">;</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Then save the file to your <em>application/controllers/</em> folder.</p> +<p>Now normally you would visit the site using a URL similar to this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">tools</span><span class="o">/</span><span class="nx">message</span><span class="o">/</span><span class="nx">to</span> +</pre></div> +</div> +<p>Instead, we are going to open the terminal in Mac/Linux or go to Run > “cmd” +in Windows and navigate to our CodeIgniter project.</p> +<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /path/to/project<span class="p">;</span> +$ php index.php tools message +</pre></div> +</div> +<p>If you did it right, you should see <em>Hello World!</em> printed.</p> +<div class="highlight-bash"><div class="highlight"><pre><span></span>$ php index.php tools message <span class="s2">"John Smith"</span> +</pre></div> +</div> +<p>Here we are passing it a argument in the same way that URL parameters +work. “John Smith” is passed as a argument and output is:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">Hello</span> <span class="nx">John</span> <span class="nx">Smith</span><span class="o">!</span> +</pre></div> +</div> +</div> +<div class="section" id="that-s-it"> +<h2><a class="toc-backref" href="#id5">That’s it!</a><a class="headerlink" href="#that-s-it" title="Permalink to this headline">¶</a></h2> +<p>That, in a nutshell, is all there is to know about controllers on the +command line. Remember that this is just a normal controller, so routing +and <code class="docutils literal"><span class="pre">_remap()</span></code> works fine.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="managing_apps.html" class="btn btn-neutral float-right" title="Managing your Applications">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="profiling.html" class="btn btn-neutral" title="Profiling Your Application"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/common_functions.html b/user_guide/general/common_functions.html new file mode 100644 index 000000000..4c530c63c --- /dev/null +++ b/user_guide/general/common_functions.html @@ -0,0 +1,776 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Common Functions — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Compatibility Functions" href="compatibility_functions.html"/> + <link rel="prev" title="Auto-loading Resources" href="autoloader.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Common Functions</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="common-functions"> +<h1>Common Functions<a class="headerlink" href="#common-functions" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter uses a few functions for its operation that are globally +defined, and are available to you at any point. These do not require +loading any libraries or helpers.</p> +<div class="custom-index container"></div><dl class="function"> +<dt id="is_php"> +<code class="descname">is_php</code><span class="sig-paren">(</span><em>$version</em><span class="sig-paren">)</span><a class="headerlink" href="#is_php" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$version</strong> (<em>string</em>) – Version number</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the running PHP version is at least the one specified or FALSE if not</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p> +</td> +</tr> +</tbody> +</table> +<p>Determines if the PHP version being used is greater than the +supplied version number.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nx">is_php</span><span class="p">(</span><span class="s1">'5.3'</span><span class="p">))</span> +<span class="p">{</span> + <span class="nv">$str</span> <span class="o">=</span> <span class="nb">quoted_printable_encode</span><span class="p">(</span><span class="nv">$str</span><span class="p">);</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Returns boolean TRUE if the installed version of PHP is equal to or +greater than the supplied version number. Returns FALSE if the installed +version of PHP is lower than the supplied version number.</p> +</dd></dl> + +<dl class="function"> +<dt id="is_really_writable"> +<code class="descname">is_really_writable</code><span class="sig-paren">(</span><em>$file</em><span class="sig-paren">)</span><a class="headerlink" href="#is_really_writable" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$file</strong> (<em>string</em>) – File path</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the path is writable, FALSE if not</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p> +</td> +</tr> +</tbody> +</table> +<p><code class="docutils literal"><span class="pre">is_writable()</span></code> returns TRUE on Windows servers when you really can’t +write to the file as the OS reports to PHP as FALSE only if the +read-only attribute is marked.</p> +<p>This function determines if a file is actually writable by attempting +to write to it first. Generally only recommended on platforms where +this information may be unreliable.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nx">is_really_writable</span><span class="p">(</span><span class="s1">'file.txt'</span><span class="p">))</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="s2">"I could write to this if I wanted to"</span><span class="p">;</span> +<span class="p">}</span> +<span class="k">else</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="s2">"File is not writable"</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">See also <a class="reference external" href="https://bugs.php.net/bug.php?id=54709">PHP bug #54709</a> for more info.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="config_item"> +<code class="descname">config_item</code><span class="sig-paren">(</span><em>$key</em><span class="sig-paren">)</span><a class="headerlink" href="#config_item" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$key</strong> (<em>string</em>) – Config item key</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Configuration key value or NULL if not found</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p> +</td> +</tr> +</tbody> +</table> +<p>The <a class="reference internal" href="../libraries/config.html"><span class="doc">Config Library</span></a> is the preferred way of +accessing configuration information, however <code class="docutils literal"><span class="pre">config_item()</span></code> can be used +to retrieve single keys. See <a class="reference internal" href="../libraries/config.html"><span class="doc">Config Library</span></a> +documentation for more information.</p> +</dd></dl> + +<dl class="function"> +<dt id="set_status_header"> +<code class="descname">set_status_header</code><span class="sig-paren">(</span><em>$code</em><span class="optional">[</span>, <em>$text = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_status_header" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$code</strong> (<em>int</em>) – HTTP Response status code</li> +<li><strong>$text</strong> (<em>string</em>) – A custom message to set with the status code</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">void</p> +</td> +</tr> +</tbody> +</table> +<p>Permits you to manually set a server status header. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">set_status_header</span><span class="p">(</span><span class="mi">401</span><span class="p">);</span> +<span class="c1">// Sets the header as: Unauthorized</span> +</pre></div> +</div> +<p><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">See here</a> for +a full list of headers.</p> +</dd></dl> + +<dl class="function"> +<dt id="remove_invisible_characters"> +<code class="descname">remove_invisible_characters</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$url_encoded = TRUE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#remove_invisible_characters" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$str</strong> (<em>string</em>) – Input string</li> +<li><strong>$url_encoded</strong> (<em>bool</em>) – Whether to remove URL-encoded characters as well</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Sanitized string</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>This function prevents inserting NULL characters between ASCII +characters, like Java\0script.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">remove_invisible_characters</span><span class="p">(</span><span class="s1">'Java\\0script'</span><span class="p">);</span> +<span class="c1">// Returns: 'Javascript'</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="html_escape"> +<code class="descname">html_escape</code><span class="sig-paren">(</span><em>$var</em><span class="sig-paren">)</span><a class="headerlink" href="#html_escape" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$var</strong> (<em>mixed</em>) – Variable to escape (string or array)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML escaped string(s)</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p> +</td> +</tr> +</tbody> +</table> +<p>This function acts as an alias for PHP’s native <code class="docutils literal"><span class="pre">htmlspecialchars()</span></code> +function, with the advantage of being able to accept an array of strings.</p> +<p>It is useful in preventing Cross Site Scripting (XSS).</p> +</dd></dl> + +<dl class="function"> +<dt id="get_mimes"> +<code class="descname">get_mimes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#get_mimes" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">An associative array of file types</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">array</td> +</tr> +</tbody> +</table> +<p>This function returns a <em>reference</em> to the MIMEs array from +<em>application/config/mimes.php</em>.</p> +</dd></dl> + +<dl class="function"> +<dt id="is_https"> +<code class="descname">is_https</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#is_https" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE if currently using HTTP-over-SSL, FALSE if not</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td> +</tr> +</tbody> +</table> +<p>Returns TRUE if a secure (HTTPS) connection is used and FALSE +in any other case (including non-HTTP requests).</p> +</dd></dl> + +<dl class="function"> +<dt id="is_cli"> +<code class="descname">is_cli</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#is_cli" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">TRUE if currently running under CLI, FALSE otherwise</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td> +</tr> +</tbody> +</table> +<p>Returns TRUE if the application is run through the command line +and FALSE if not.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function checks both if the <code class="docutils literal"><span class="pre">PHP_SAPI</span></code> value is ‘cli’ +or if the <code class="docutils literal"><span class="pre">STDIN</span></code> constant is defined.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="function_usable"> +<code class="descname">function_usable</code><span class="sig-paren">(</span><em>$function_name</em><span class="sig-paren">)</span><a class="headerlink" href="#function_usable" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$function_name</strong> (<em>string</em>) – Function name</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the function can be used, FALSE if not</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p> +</td> +</tr> +</tbody> +</table> +<p>Returns TRUE if a function exists and is usable, FALSE otherwise.</p> +<p>This function runs a <code class="docutils literal"><span class="pre">function_exists()</span></code> check and if the +<cite>Suhosin extension <http://www.hardened-php.net/suhosin/></cite> is loaded, +checks if it doesn’t disable the function being checked.</p> +<p>It is useful if you want to check for the availability of functions +such as <code class="docutils literal"><span class="pre">eval()</span></code> and <code class="docutils literal"><span class="pre">exec()</span></code>, which are dangerous and might be +disabled on servers with highly restrictive security policies.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function was introduced because Suhosin terminated +script execution, but this turned out to be a bug. A fix +has been available for some time (version 0.9.34), but is +unfortunately not released yet.</p> +</div> +</dd></dl> + +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="compatibility_functions.html" class="btn btn-neutral float-right" title="Compatibility Functions">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="autoloader.html" class="btn btn-neutral" title="Auto-loading Resources"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/compatibility_functions.html b/user_guide/general/compatibility_functions.html new file mode 100644 index 000000000..5966286a2 --- /dev/null +++ b/user_guide/general/compatibility_functions.html @@ -0,0 +1,914 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Compatibility Functions — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="URI Routing" href="routing.html"/> + <link rel="prev" title="Common Functions" href="common_functions.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Compatibility Functions</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="compatibility-functions"> +<h1>Compatibility Functions<a class="headerlink" href="#compatibility-functions" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter provides a set of compatibility functions that enable +you to use functions what are otherwise natively available in PHP, +but only in higher versions or depending on a certain extension.</p> +<p>Being custom implementations, these functions will also have some +set of dependencies on their own, but are still useful if your +PHP setup doesn’t offer them natively.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Much like the <a class="reference internal" href="common_functions.html"><span class="doc">common functions</span></a>, the +compatibility functions are always available, as long as +their dependencies are met.</p> +</div> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#password-hashing" id="id7">Password Hashing</a><ul> +<li><a class="reference internal" href="#dependencies" id="id8">Dependencies</a></li> +<li><a class="reference internal" href="#constants" id="id9">Constants</a></li> +<li><a class="reference internal" href="#function-reference" id="id10">Function reference</a></li> +</ul> +</li> +<li><a class="reference internal" href="#hash-message-digest" id="id11">Hash (Message Digest)</a><ul> +<li><a class="reference internal" href="#id1" id="id12">Dependencies</a></li> +<li><a class="reference internal" href="#id2" id="id13">Function reference</a></li> +</ul> +</li> +<li><a class="reference internal" href="#multibyte-string" id="id14">Multibyte String</a><ul> +<li><a class="reference internal" href="#id3" id="id15">Dependencies</a></li> +<li><a class="reference internal" href="#id4" id="id16">Function reference</a></li> +</ul> +</li> +<li><a class="reference internal" href="#standard-functions" id="id17">Standard Functions</a><ul> +<li><a class="reference internal" href="#id5" id="id18">Dependencies</a></li> +<li><a class="reference internal" href="#id6" id="id19">Function reference</a></li> +</ul> +</li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="password-hashing"> +<h2><a class="toc-backref" href="#id7">Password Hashing</a><a class="headerlink" href="#password-hashing" title="Permalink to this headline">¶</a></h2> +<p>This set of compatibility functions offers a “backport” of PHP’s +standard <a class="reference external" href="http://php.net/password">Password Hashing extension</a> +that is otherwise available only since PHP 5.5.</p> +<div class="section" id="dependencies"> +<h3><a class="toc-backref" href="#id8">Dependencies</a><a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h3> +<ul class="simple"> +<li>PHP 5.3.7</li> +<li><code class="docutils literal"><span class="pre">CRYPT_BLOWFISH</span></code> support for <code class="docutils literal"><span class="pre">crypt()</span></code></li> +</ul> +</div> +<div class="section" id="constants"> +<h3><a class="toc-backref" href="#id9">Constants</a><a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h3> +<ul class="simple"> +<li><code class="docutils literal"><span class="pre">PASSWORD_BCRYPT</span></code></li> +<li><code class="docutils literal"><span class="pre">PASSWORD_DEFAULT</span></code></li> +</ul> +</div> +<div class="section" id="function-reference"> +<h3><a class="toc-backref" href="#id10">Function reference</a><a class="headerlink" href="#function-reference" title="Permalink to this headline">¶</a></h3> +<dl class="function"> +<dt id="password_get_info"> +<code class="descname">password_get_info</code><span class="sig-paren">(</span><em>$hash</em><span class="sig-paren">)</span><a class="headerlink" href="#password_get_info" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$hash</strong> (<em>string</em>) – Password hash</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Information about the hashed password</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">array</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/password_get_info">PHP manual for +password_get_info()</a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="password_hash"> +<code class="descname">password_hash</code><span class="sig-paren">(</span><em>$password</em>, <em>$algo</em><span class="optional">[</span>, <em>$options = array()</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#password_hash" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$password</strong> (<em>string</em>) – Plain-text password</li> +<li><strong>$algo</strong> (<em>int</em>) – Hashing algorithm</li> +<li><strong>$options</strong> (<em>array</em>) – Hashing options</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Hashed password or FALSE on failure</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/password_hash">PHP manual for +password_hash()</a>.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Unless you provide your own (and valid) salt, this function +has a further dependency on an available CSPRNG source. Each +of the following would satisfy that: +- <code class="docutils literal"><span class="pre">mcrypt_create_iv()</span></code> with <code class="docutils literal"><span class="pre">MCRYPT_DEV_URANDOM</span></code> +- <code class="docutils literal"><span class="pre">openssl_random_pseudo_bytes()</span></code> +- /dev/arandom +- /dev/urandom</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="password_needs_rehash"> +<code class="descname">password_needs_rehash</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#password_needs_rehash" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$hash</strong> (<em>string</em>) – Password hash</li> +<li><strong>$algo</strong> (<em>int</em>) – Hashing algorithm</li> +<li><strong>$options</strong> (<em>array</em>) – Hashing options</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the hash should be rehashed to match the given algorithm and options, FALSE otherwise</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/password_needs_rehash">PHP manual for +password_needs_rehash()</a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="password_verify"> +<code class="descname">password_verify</code><span class="sig-paren">(</span><em>$password</em>, <em>$hash</em><span class="sig-paren">)</span><a class="headerlink" href="#password_verify" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$password</strong> (<em>string</em>) – Plain-text password</li> +<li><strong>$hash</strong> (<em>string</em>) – Password hash</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the password matches the hash, FALSE if not</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/password_verify">PHP manual for +password_verify()</a>.</p> +</dd></dl> + +</div> +</div> +<div class="section" id="hash-message-digest"> +<h2><a class="toc-backref" href="#id11">Hash (Message Digest)</a><a class="headerlink" href="#hash-message-digest" title="Permalink to this headline">¶</a></h2> +<p>This compatibility layer contains backports for the <code class="docutils literal"><span class="pre">hash_equals()</span></code> +and <code class="docutils literal"><span class="pre">hash_pbkdf2()</span></code> functions, which otherwise require PHP 5.6 and/or +PHP 5.5 respectively.</p> +<div class="section" id="id1"> +<h3><a class="toc-backref" href="#id12">Dependencies</a><a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<ul class="simple"> +<li>None</li> +</ul> +</div> +<div class="section" id="id2"> +<h3><a class="toc-backref" href="#id13">Function reference</a><a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<dl class="function"> +<dt id="hash_equals"> +<code class="descname">hash_equals</code><span class="sig-paren">(</span><em>$known_string</em>, <em>$user_string</em><span class="sig-paren">)</span><a class="headerlink" href="#hash_equals" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$known_string</strong> (<em>string</em>) – Known string</li> +<li><strong>$user_string</strong> (<em>string</em>) – User-supplied string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if the strings match, FALSE otherwise</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/hash_equals">PHP manual for +hash_equals()</a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="hash_pbkdf2"> +<code class="descname">hash_pbkdf2</code><span class="sig-paren">(</span><em>$algo</em>, <em>$password</em>, <em>$salt</em>, <em>$iterations</em><span class="optional">[</span>, <em>$length = 0</em><span class="optional">[</span>, <em>$raw_output = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#hash_pbkdf2" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$algo</strong> (<em>string</em>) – Hashing algorithm</li> +<li><strong>$password</strong> (<em>string</em>) – Password</li> +<li><strong>$salt</strong> (<em>string</em>) – Hash salt</li> +<li><strong>$iterations</strong> (<em>int</em>) – Number of iterations to perform during derivation</li> +<li><strong>$length</strong> (<em>int</em>) – Output string length</li> +<li><strong>$raw_output</strong> (<em>bool</em>) – Whether to return raw binary data</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Password-derived key or FALSE on failure</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/hash_pbkdf2">PHP manual for +hash_pbkdf2()</a>.</p> +</dd></dl> + +</div> +</div> +<div class="section" id="multibyte-string"> +<h2><a class="toc-backref" href="#id14">Multibyte String</a><a class="headerlink" href="#multibyte-string" title="Permalink to this headline">¶</a></h2> +<p>This set of compatibility functions offers limited support for PHP’s +<a class="reference external" href="http://php.net/mbstring">Multibyte String extension</a>. Because of +the limited alternative solutions, only a few functions are available.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">When a character set parameter is ommited, +<code class="docutils literal"><span class="pre">$config['charset']</span></code> will be used.</p> +</div> +<div class="section" id="id3"> +<h3><a class="toc-backref" href="#id15">Dependencies</a><a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<ul class="simple"> +<li><a class="reference external" href="http://php.net/iconv">iconv</a> extension</li> +</ul> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">This dependency is optional and these functions will +always be declared. If iconv is not available, they WILL +fall-back to their non-mbstring versions.</p> +</div> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Where a character set is supplied, it must be +supported by iconv and in a format that it recognizes.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For you own dependency check on the actual mbstring +extension, use the <code class="docutils literal"><span class="pre">MB_ENABLED</span></code> constant.</p> +</div> +</div> +<div class="section" id="id4"> +<h3><a class="toc-backref" href="#id16">Function reference</a><a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<dl class="function"> +<dt id="mb_strlen"> +<code class="descname">mb_strlen</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$encoding = NULL</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#mb_strlen" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$str</strong> (<em>string</em>) – Input string</li> +<li><strong>$encoding</strong> (<em>string</em>) – Character set</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Number of characters in the input string or FALSE on failure</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/mb_strlen">PHP manual for +mb_strlen()</a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="mb_strpos"> +<code class="descname">mb_strpos</code><span class="sig-paren">(</span><em>$haystack</em>, <em>$needle</em><span class="optional">[</span>, <em>$offset = 0</em><span class="optional">[</span>, <em>$encoding = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#mb_strpos" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$haystack</strong> (<em>string</em>) – String to search in</li> +<li><strong>$needle</strong> (<em>string</em>) – Part of string to search for</li> +<li><strong>$offset</strong> (<em>int</em>) – Search offset</li> +<li><strong>$encoding</strong> (<em>string</em>) – Character set</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Numeric character position of where $needle was found or FALSE if not found</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">mixed</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/mb_strpos">PHP manual for +mb_strpos()</a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="mb_substr"> +<code class="descname">mb_substr</code><span class="sig-paren">(</span><em>$str</em>, <em>$start</em><span class="optional">[</span>, <em>$length = NULL</em><span class="optional">[</span>, <em>$encoding = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#mb_substr" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$str</strong> (<em>string</em>) – Input string</li> +<li><strong>$start</strong> (<em>int</em>) – Position of first character</li> +<li><strong>$length</strong> (<em>int</em>) – Maximum number of characters</li> +<li><strong>$encoding</strong> (<em>string</em>) – Character set</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Portion of $str specified by $start and $length or FALSE on failure</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/mb_substr">PHP manual for +mb_substr()</a>.</p> +</dd></dl> + +</div> +</div> +<div class="section" id="standard-functions"> +<h2><a class="toc-backref" href="#id17">Standard Functions</a><a class="headerlink" href="#standard-functions" title="Permalink to this headline">¶</a></h2> +<p>This set of compatibility functions offers support for a few +standard functions in PHP that otherwise require a newer PHP version.</p> +<div class="section" id="id5"> +<h3><a class="toc-backref" href="#id18">Dependencies</a><a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<ul class="simple"> +<li>None</li> +</ul> +</div> +<div class="section" id="id6"> +<h3><a class="toc-backref" href="#id19">Function reference</a><a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<dl class="function"> +<dt id="array_column"> +<code class="descname">array_column</code><span class="sig-paren">(</span><em>array $array</em>, <em>$column_key</em><span class="optional">[</span>, <em>$index_key = NULL</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#array_column" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$array</strong> (<em>array</em>) – Array to fetch results from</li> +<li><strong>$column_key</strong> (<em>mixed</em>) – Key of the column to return values from</li> +<li><strong>$index_key</strong> (<em>mixed</em>) – Key to use for the returned values</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An array of values representing a single column from the input array</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">array</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/array_column">PHP manual for +array_column()</a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="hex2bin"> +<code class="descname">hex2bin</code><span class="sig-paren">(</span><em>$data</em><span class="sig-paren">)</span><a class="headerlink" href="#hex2bin" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$data</strong> (<em>array</em>) – Hexadecimal representation of data</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Binary representation of the given data</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> +</td> +</tr> +</tbody> +</table> +<p>For more information, please refer to the <a class="reference external" href="http://php.net/hex2bin">PHP manual for hex2bin()</a>.</p> +</dd></dl> + +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="routing.html" class="btn btn-neutral float-right" title="URI Routing">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="common_functions.html" class="btn btn-neutral" title="Common Functions"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html new file mode 100644 index 000000000..bcb5155d0 --- /dev/null +++ b/user_guide/general/controllers.html @@ -0,0 +1,845 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Controllers — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Reserved Names" href="reserved_names.html"/> + <link rel="prev" title="CodeIgniter URLs" href="urls.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Controllers</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="controllers"> +<h1><a class="toc-backref" href="#id1">Controllers</a><a class="headerlink" href="#controllers" title="Permalink to this headline">¶</a></h1> +<p>Controllers are the heart of your application, as they determine how +HTTP requests should be handled.</p> +<div class="contents topic" id="page-contents"> +<p class="topic-title first">Page Contents</p> +<ul class="simple"> +<li><a class="reference internal" href="#controllers" id="id1">Controllers</a><ul> +<li><a class="reference internal" href="#what-is-a-controller" id="id2">What is a Controller?</a></li> +<li><a class="reference internal" href="#let-s-try-it-hello-world" id="id3">Let’s try it: Hello World!</a></li> +<li><a class="reference internal" href="#methods" id="id4">Methods</a></li> +<li><a class="reference internal" href="#passing-uri-segments-to-your-methods" id="id5">Passing URI Segments to your methods</a></li> +<li><a class="reference internal" href="#defining-a-default-controller" id="id6">Defining a Default Controller</a></li> +<li><a class="reference internal" href="#remapping-method-calls" id="id7">Remapping Method Calls</a></li> +<li><a class="reference internal" href="#processing-output" id="id8">Processing Output</a></li> +<li><a class="reference internal" href="#private-methods" id="id9">Private methods</a></li> +<li><a class="reference internal" href="#organizing-your-controllers-into-sub-directories" id="id10">Organizing Your Controllers into Sub-directories</a></li> +<li><a class="reference internal" href="#class-constructors" id="id11">Class Constructors</a></li> +<li><a class="reference internal" href="#reserved-method-names" id="id12">Reserved method names</a></li> +<li><a class="reference internal" href="#that-s-it" id="id13">That’s it!</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="what-is-a-controller"> +<h2><a class="toc-backref" href="#id2">What is a Controller?</a><a class="headerlink" href="#what-is-a-controller" title="Permalink to this headline">¶</a></h2> +<p><strong>A Controller is simply a class file that is named in a way that can be +associated with a URI.</strong></p> +<p>Consider this URI:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span> +</pre></div> +</div> +<p>In the above example, CodeIgniter would attempt to find a controller +named Blog.php and load it.</p> +<p><strong>When a controller’s name matches the first segment of a URI, it will +be loaded.</strong></p> +</div> +<div class="section" id="let-s-try-it-hello-world"> +<h2><a class="toc-backref" href="#id3">Let’s try it: Hello World!</a><a class="headerlink" href="#let-s-try-it-hello-world" title="Permalink to this headline">¶</a></h2> +<p>Let’s create a simple controller so you can see it in action. Using your +text editor, create a file called Blog.php, and put the following code +in it:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="k">echo</span> <span class="s1">'Hello World!'</span><span class="p">;</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Then save the file to your <em>application/controllers/</em> directory.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">The file must be called ‘Blog.php’, with a capital ‘B’.</p> +</div> +<p>Now visit the your site using a URL similar to this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span> +</pre></div> +</div> +<p>If you did it right, you should see:</p> +<blockquote> +<div>Hello World!</div></blockquote> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Class names must start with an uppercase letter.</p> +</div> +<p>This is valid:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>This is <strong>not</strong> valid:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>Also, always make sure your controller extends the parent controller +class so that it can inherit all its methods.</p> +</div> +<div class="section" id="methods"> +<h2><a class="toc-backref" href="#id4">Methods</a><a class="headerlink" href="#methods" title="Permalink to this headline">¶</a></h2> +<p>In the above example the method name is <code class="docutils literal"><span class="pre">index()</span></code>. The “index” method +is always loaded by default if the <strong>second segment</strong> of the URI is +empty. Another way to show your “Hello World” message would be this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span><span class="nx">index</span><span class="o">/</span> +</pre></div> +</div> +<p><strong>The second segment of the URI determines which method in the +controller gets called.</strong></p> +<p>Let’s try it. Add a new method to your controller:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="k">echo</span> <span class="s1">'Hello World!'</span><span class="p">;</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">comments</span><span class="p">()</span> + <span class="p">{</span> + <span class="k">echo</span> <span class="s1">'Look at this!'</span><span class="p">;</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Now load the following URL to see the comment method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span><span class="nx">comments</span><span class="o">/</span> +</pre></div> +</div> +<p>You should see your new message.</p> +</div> +<div class="section" id="passing-uri-segments-to-your-methods"> +<h2><a class="toc-backref" href="#id5">Passing URI Segments to your methods</a><a class="headerlink" href="#passing-uri-segments-to-your-methods" title="Permalink to this headline">¶</a></h2> +<p>If your URI contains more than two segments they will be passed to your +method as parameters.</p> +<p>For example, let’s say you have a URI like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">products</span><span class="o">/</span><span class="nx">shoes</span><span class="o">/</span><span class="nx">sandals</span><span class="o">/</span><span class="mi">123</span> +</pre></div> +</div> +<p>Your method will be passed URI segments 3 and 4 (“sandals” and “123”):</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Products</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">shoes</span><span class="p">(</span><span class="nv">$sandals</span><span class="p">,</span> <span class="nv">$id</span><span class="p">)</span> + <span class="p">{</span> + <span class="k">echo</span> <span class="nv">$sandals</span><span class="p">;</span> + <span class="k">echo</span> <span class="nv">$id</span><span class="p">;</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">If you are using the <a class="reference internal" href="routing.html"><span class="doc">URI Routing</span></a> +feature, the segments passed to your method will be the re-routed +ones.</p> +</div> +</div> +<div class="section" id="defining-a-default-controller"> +<h2><a class="toc-backref" href="#id6">Defining a Default Controller</a><a class="headerlink" href="#defining-a-default-controller" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter can be told to load a default controller when a URI is not +present, as will be the case when only your site root URL is requested. +To specify a default controller, open your <strong>application/config/routes.php</strong> +file and set this variable:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'default_controller'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'blog'</span><span class="p">;</span> +</pre></div> +</div> +<p>Where ‘blog’ is the name of the controller class you want used. If you now +load your main index.php file without specifying any URI segments you’ll +see your “Hello World” message by default.</p> +<p>For more information, please refer to the “Reserved Routes” section of the +<a class="reference internal" href="routing.html"><span class="doc">URI Routing</span></a> documentation.</p> +</div> +<div class="section" id="remapping-method-calls"> +<h2><a class="toc-backref" href="#id7">Remapping Method Calls</a><a class="headerlink" href="#remapping-method-calls" title="Permalink to this headline">¶</a></h2> +<p>As noted above, the second segment of the URI typically determines which +method in the controller gets called. CodeIgniter permits you to override +this behavior through the use of the <code class="docutils literal"><span class="pre">_remap()</span></code> method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">public</span> <span class="k">function</span> <span class="nf">_remap</span><span class="p">()</span> +<span class="p">{</span> + <span class="c1">// Some code here...</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">If your controller contains a method named _remap(), +it will <strong>always</strong> get called regardless of what your URI contains. It +overrides the normal behavior in which the URI determines which method +is called, allowing you to define your own method routing rules.</p> +</div> +<p>The overridden method call (typically the second segment of the URI) will +be passed as a parameter to the <code class="docutils literal"><span class="pre">_remap()</span></code> method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">public</span> <span class="k">function</span> <span class="nf">_remap</span><span class="p">(</span><span class="nv">$method</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">if</span> <span class="p">(</span><span class="nv">$method</span> <span class="o">===</span> <span class="s1">'some_method'</span><span class="p">)</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="nv">$method</span><span class="p">();</span> + <span class="p">}</span> + <span class="k">else</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">default_method</span><span class="p">();</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Any extra segments after the method name are passed into <code class="docutils literal"><span class="pre">_remap()</span></code> as an +optional second parameter. This array can be used in combination with +PHP’s <a class="reference external" href="http://php.net/call_user_func_array">call_user_func_array()</a> +to emulate CodeIgniter’s default behavior.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">public</span> <span class="k">function</span> <span class="nf">_remap</span><span class="p">(</span><span class="nv">$method</span><span class="p">,</span> <span class="nv">$params</span> <span class="o">=</span> <span class="k">array</span><span class="p">())</span> +<span class="p">{</span> + <span class="nv">$method</span> <span class="o">=</span> <span class="s1">'process_'</span><span class="o">.</span><span class="nv">$method</span><span class="p">;</span> + <span class="k">if</span> <span class="p">(</span><span class="nb">method_exists</span><span class="p">(</span><span class="nv">$this</span><span class="p">,</span> <span class="nv">$method</span><span class="p">))</span> + <span class="p">{</span> + <span class="k">return</span> <span class="nb">call_user_func_array</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="nv">$this</span><span class="p">,</span> <span class="nv">$method</span><span class="p">),</span> <span class="nv">$params</span><span class="p">);</span> + <span class="p">}</span> + <span class="nx">show_404</span><span class="p">();</span> +<span class="p">}</span> +</pre></div> +</div> +</div> +<div class="section" id="processing-output"> +<h2><a class="toc-backref" href="#id8">Processing Output</a><a class="headerlink" href="#processing-output" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter has an output class that takes care of sending your final +rendered data to the web browser automatically. More information on this +can be found in the <a class="reference internal" href="views.html"><span class="doc">Views</span></a> and <a class="reference internal" href="../libraries/output.html"><span class="doc">Output Class</span></a> pages. In some cases, however, you might want to +post-process the finalized data in some way and send it to the browser +yourself. CodeIgniter permits you to add a method named <code class="docutils literal"><span class="pre">_output()</span></code> +to your controller that will receive the finalized output data.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">If your controller contains a method named <code class="docutils literal"><span class="pre">_output()</span></code>, +it will <strong>always</strong> be called by the output class instead of +echoing the finalized data directly. The first parameter of the +method will contain the finalized output.</p> +</div> +<p>Here is an example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">public</span> <span class="k">function</span> <span class="nf">_output</span><span class="p">(</span><span class="nv">$output</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="nv">$output</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>Please note that your <code class="docutils literal"><span class="pre">_output()</span></code> method will receive the +data in its finalized state. Benchmark and memory usage data +will be rendered, cache files written (if you have caching +enabled), and headers will be sent (if you use that +<a class="reference internal" href="../libraries/output.html"><span class="doc">feature</span></a>) before it is handed off +to the <code class="docutils literal"><span class="pre">_output()</span></code> method. +To have your controller’s output cached properly, its +<code class="docutils literal"><span class="pre">_output()</span></code> method can use:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">cache_expiration</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> +<span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">_write_cache</span><span class="p">(</span><span class="nv">$output</span><span class="p">);</span> +<span class="p">}</span> +</pre></div> +</div> +<p class="last">If you are using this feature the page execution timer and +memory usage stats might not be perfectly accurate since they +will not take into account any further processing you do. +For an alternate way to control output <em>before</em> any of the +final processing is done, please see the available methods +in the <a class="reference internal" href="../libraries/output.html"><span class="doc">Output Library</span></a>.</p> +</div> +</div> +<div class="section" id="private-methods"> +<h2><a class="toc-backref" href="#id9">Private methods</a><a class="headerlink" href="#private-methods" title="Permalink to this headline">¶</a></h2> +<p>In some cases you may want certain methods hidden from public access. +In order to achieve this, simply declare the method as being private +or protected and it will not be served via a URL request. For example, +if you were to have a method like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">private</span> <span class="k">function</span> <span class="nf">_utility</span><span class="p">()</span> +<span class="p">{</span> + <span class="c1">// some code</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Trying to access it via the URL, like this, will not work:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span><span class="nx">_utility</span><span class="o">/</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Prefixing method names with an underscore will also prevent +them from being called. This is a legacy feature that is left +for backwards-compatibility.</p> +</div> +</div> +<div class="section" id="organizing-your-controllers-into-sub-directories"> +<h2><a class="toc-backref" href="#id10">Organizing Your Controllers into Sub-directories</a><a class="headerlink" href="#organizing-your-controllers-into-sub-directories" title="Permalink to this headline">¶</a></h2> +<p>If you are building a large application you might want to hierarchically +organize or structure your controllers into sub-directories. CodeIgniter +permits you to do this.</p> +<p>Simply create sub-directories under the main <em>application/controllers/</em> +one and place your controller classes within them.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>When using this feature the first segment of your URI must +specify the folder. For example, let’s say you have a controller located +here:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">application</span><span class="o">/</span><span class="nx">controllers</span><span class="o">/</span><span class="nx">products</span><span class="o">/</span><span class="nx">Shoes</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +<p>To call the above controller your URI will look something like this:</p> +<div class="last highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">products</span><span class="o">/</span><span class="nx">shoes</span><span class="o">/</span><span class="nx">show</span><span class="o">/</span><span class="mi">123</span> +</pre></div> +</div> +</div> +<p>Each of your sub-directories may contain a default controller which will be +called if the URL contains <em>only</em> the sub-directory. Simply put a controller +in there that matches the name of your ‘default_controller’ as specified in +your <em>application/config/routes.php</em> file.</p> +<p>CodeIgniter also permits you to remap your URIs using its <a class="reference internal" href="routing.html"><span class="doc">URI +Routing</span></a> feature.</p> +</div> +<div class="section" id="class-constructors"> +<h2><a class="toc-backref" href="#id11">Class Constructors</a><a class="headerlink" href="#class-constructors" title="Permalink to this headline">¶</a></h2> +<p>If you intend to use a constructor in any of your Controllers, you +<strong>MUST</strong> place the following line of code in it:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">();</span> +</pre></div> +</div> +<p>The reason this line is necessary is because your local constructor will +be overriding the one in the parent controller class so we need to +manually call it.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">()</span> + <span class="p">{</span> + <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">();</span> + <span class="c1">// Your own constructor code</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Constructors are useful if you need to set some default values, or run a +default process when your class is instantiated. Constructors can’t +return a value, but they can do some default work.</p> +</div> +<div class="section" id="reserved-method-names"> +<h2><a class="toc-backref" href="#id12">Reserved method names</a><a class="headerlink" href="#reserved-method-names" title="Permalink to this headline">¶</a></h2> +<p>Since your controller classes will extend the main application +controller you must be careful not to name your methods identically to +the ones used by that class, otherwise your local functions will +override them. See <a class="reference internal" href="reserved_names.html"><span class="doc">Reserved Names</span></a> for a full +list.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">You should also never have a method named identically +to its class name. If you do, and there is no <code class="docutils literal"><span class="pre">__construct()</span></code> +method in the same class, then your e.g. <code class="docutils literal"><span class="pre">Index::index()</span></code> +method will be executed as a class constructor! This is a PHP4 +backwards-compatibility feature.</p> +</div> +</div> +<div class="section" id="that-s-it"> +<h2><a class="toc-backref" href="#id13">That’s it!</a><a class="headerlink" href="#that-s-it" title="Permalink to this headline">¶</a></h2> +<p>That, in a nutshell, is all there is to know about controllers.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="reserved_names.html" class="btn btn-neutral float-right" title="Reserved Names">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="urls.html" class="btn btn-neutral" title="CodeIgniter URLs"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/core_classes.html b/user_guide/general/core_classes.html new file mode 100644 index 000000000..b0be86dac --- /dev/null +++ b/user_guide/general/core_classes.html @@ -0,0 +1,607 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Creating Core System Classes — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Creating Ancillary Classes" href="ancillary_classes.html"/> + <link rel="prev" title="Creating Drivers" href="creating_drivers.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Creating Core System Classes</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="creating-core-system-classes"> +<h1>Creating Core System Classes<a class="headerlink" href="#creating-core-system-classes" title="Permalink to this headline">¶</a></h1> +<p>Every time CodeIgniter runs there are several base classes that are +initialized automatically as part of the core framework. It is possible, +however, to swap any of the core system classes with your own versions +or even extend the core versions.</p> +<p><strong>Most users will never have any need to do this, but the option to +replace or extend them does exist for those who would like to +significantly alter the CodeIgniter core.</strong></p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Messing with a core system class has a lot of implications, so +make sure you know what you are doing before attempting it.</p> +</div> +<div class="section" id="system-class-list"> +<h2>System Class List<a class="headerlink" href="#system-class-list" title="Permalink to this headline">¶</a></h2> +<p>The following is a list of the core system files that are invoked every +time CodeIgniter runs:</p> +<ul class="simple"> +<li>Benchmark</li> +<li>Config</li> +<li>Controller</li> +<li>Exceptions</li> +<li>Hooks</li> +<li>Input</li> +<li>Language</li> +<li>Loader</li> +<li>Log</li> +<li>Output</li> +<li>Router</li> +<li>Security</li> +<li>URI</li> +<li>Utf8</li> +</ul> +</div> +<div class="section" id="replacing-core-classes"> +<h2>Replacing Core Classes<a class="headerlink" href="#replacing-core-classes" title="Permalink to this headline">¶</a></h2> +<p>To use one of your own system classes instead of a default one simply +place your version inside your local <em>application/core/</em> directory:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">application</span><span class="o">/</span><span class="nx">core</span><span class="o">/</span><span class="nx">some_class</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +<p>If this directory does not exist you can create it.</p> +<p>Any file named identically to one from the list above will be used +instead of the one normally used.</p> +<p>Please note that your class must use CI as a prefix. For example, if +your file is named Input.php the class will be named:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">CI_Input</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +</div> +<div class="section" id="extending-core-class"> +<h2>Extending Core Class<a class="headerlink" href="#extending-core-class" title="Permalink to this headline">¶</a></h2> +<p>If all you need to do is add some functionality to an existing library - +perhaps add a method or two - then it’s overkill to replace the entire +library with your version. In this case it’s better to simply extend the +class. Extending a class is nearly identical to replacing a class with a +couple exceptions:</p> +<ul class="simple"> +<li>The class declaration must extend the parent class.</li> +<li>Your new class name and filename must be prefixed with MY_ (this +item is configurable. See below.).</li> +</ul> +<p>For example, to extend the native Input class you’ll create a file named +application/core/MY_Input.php, and declare your class with:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MY_Input</span> <span class="k">extends</span> <span class="nx">CI_Input</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>If you need to use a constructor in your class make sure you +extend the parent constructor:</p> +<div class="last highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MY_Input</span> <span class="k">extends</span> <span class="nx">CI_Input</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">()</span> + <span class="p">{</span> + <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">();</span> + <span class="c1">// Your own constructor code</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +</div> +<p><strong>Tip:</strong> Any functions in your class that are named identically to the +methods in the parent class will be used instead of the native ones +(this is known as “method overriding”). This allows you to substantially +alter the CodeIgniter core.</p> +<p>If you are extending the Controller core class, then be sure to extend +your new class in your application controller’s constructors.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Welcome</span> <span class="k">extends</span> <span class="nx">MY_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'welcome_message'</span><span class="p">);</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="section" id="setting-your-own-prefix"> +<h3>Setting Your Own Prefix<a class="headerlink" href="#setting-your-own-prefix" title="Permalink to this headline">¶</a></h3> +<p>To set your own sub-class prefix, open your +<em>application/config/config.php</em> file and look for this item:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'subclass_prefix'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'MY_'</span><span class="p">;</span> +</pre></div> +</div> +<p>Please note that all native CodeIgniter libraries are prefixed +with CI_ so DO NOT use that as your prefix.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="ancillary_classes.html" class="btn btn-neutral float-right" title="Creating Ancillary Classes">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="creating_drivers.html" class="btn btn-neutral" title="Creating Drivers"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/creating_drivers.html b/user_guide/general/creating_drivers.html new file mode 100644 index 000000000..0abeb80ed --- /dev/null +++ b/user_guide/general/creating_drivers.html @@ -0,0 +1,524 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Creating Drivers — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Creating Core System Classes" href="core_classes.html"/> + <link rel="prev" title="Using CodeIgniter Drivers" href="drivers.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Creating Drivers</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="creating-drivers"> +<h1>Creating Drivers<a class="headerlink" href="#creating-drivers" title="Permalink to this headline">¶</a></h1> +<div class="section" id="driver-directory-and-file-structure"> +<h2>Driver Directory and File Structure<a class="headerlink" href="#driver-directory-and-file-structure" title="Permalink to this headline">¶</a></h2> +<p>Sample driver directory and file structure layout:</p> +<ul class="simple"> +<li>/application/libraries/Driver_name<ul> +<li>Driver_name.php</li> +<li>drivers<ul> +<li>Driver_name_subclass_1.php</li> +<li>Driver_name_subclass_2.php</li> +<li>Driver_name_subclass_3.php</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">In order to maintain compatibility on case-sensitive +file systems, the Driver_name directory must be +named in the format returned by <code class="docutils literal"><span class="pre">ucfirst()</span></code>.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The Driver library’s architecture is such that +the subclasses don’t extend and therefore don’t inherit +properties or methods of the main driver.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="core_classes.html" class="btn btn-neutral float-right" title="Creating Core System Classes">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="drivers.html" class="btn btn-neutral" title="Using CodeIgniter Drivers"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html new file mode 100644 index 000000000..c8c1d2718 --- /dev/null +++ b/user_guide/general/creating_libraries.html @@ -0,0 +1,754 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Creating Libraries — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Using CodeIgniter Drivers" href="drivers.html"/> + <link rel="prev" title="Using CodeIgniter Libraries" href="libraries.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Creating Libraries</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="creating-libraries"> +<h1>Creating Libraries<a class="headerlink" href="#creating-libraries" title="Permalink to this headline">¶</a></h1> +<p>When we use the term “Libraries” we are normally referring to the +classes that are located in the libraries directory and described in the +Class Reference of this user guide. In this case, however, we will +instead describe how you can create your own libraries within your +application/libraries directory in order to maintain separation between +your local resources and the global framework resources.</p> +<p>As an added bonus, CodeIgniter permits your libraries to extend native +classes if you simply need to add some functionality to an existing +library. Or you can even replace native libraries just by placing +identically named versions in your <em>application/libraries</em> directory.</p> +<p>In summary:</p> +<ul class="simple"> +<li>You can create entirely new libraries.</li> +<li>You can extend native libraries.</li> +<li>You can replace native libraries.</li> +</ul> +<p>The page below explains these three concepts in detail.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The Database classes can not be extended or replaced with your +own classes. All other classes are able to be replaced/extended.</p> +</div> +<div class="section" id="storage"> +<h2>Storage<a class="headerlink" href="#storage" title="Permalink to this headline">¶</a></h2> +<p>Your library classes should be placed within your <em>application/libraries</em> +directory, as this is where CodeIgniter will look for them when they are +initialized.</p> +</div> +<div class="section" id="naming-conventions"> +<h2>Naming Conventions<a class="headerlink" href="#naming-conventions" title="Permalink to this headline">¶</a></h2> +<ul class="simple"> +<li>File names must be capitalized. For example: Myclass.php</li> +<li>Class declarations must be capitalized. For example: class Myclass</li> +<li>Class names and file names must match.</li> +</ul> +</div> +<div class="section" id="the-class-file"> +<h2>The Class File<a class="headerlink" href="#the-class-file" title="Permalink to this headline">¶</a></h2> +<p>Classes should have this basic prototype:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="nb">defined</span><span class="p">(</span><span class="s1">'BASEPATH'</span><span class="p">)</span> <span class="k">OR</span> <span class="k">exit</span><span class="p">(</span><span class="s1">'No direct script access allowed'</span><span class="p">);</span> + +<span class="k">class</span> <span class="nc">Someclass</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">some_method</span><span class="p">()</span> + <span class="p">{</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">We are using the name Someclass purely as an example.</p> +</div> +</div> +<div class="section" id="using-your-class"> +<h2>Using Your Class<a class="headerlink" href="#using-your-class" title="Permalink to this headline">¶</a></h2> +<p>From within any of your <a class="reference internal" href="controllers.html"><span class="doc">Controller</span></a> methods you +can initialize your class using the standard:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'someclass'</span><span class="p">);</span> +</pre></div> +</div> +<p>Where <em>someclass</em> is the file name, without the “.php” file extension. +You can submit the file name capitalized or lower case. CodeIgniter +doesn’t care.</p> +<p>Once loaded you can access your class using the lower case version:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">someclass</span><span class="o">-></span><span class="na">some_method</span><span class="p">();</span><span class="nx"> </span> <span class="c1">// Object instances will always be lower case</span> +</pre></div> +</div> +</div> +<div class="section" id="passing-parameters-when-initializing-your-class"> +<h2>Passing Parameters When Initializing Your Class<a class="headerlink" href="#passing-parameters-when-initializing-your-class" title="Permalink to this headline">¶</a></h2> +<p>In the library loading method you can dynamically pass data as an +array via the second parameter and it will be passed to your class +constructor:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$params</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'type'</span> <span class="o">=></span> <span class="s1">'large'</span><span class="p">,</span> <span class="s1">'color'</span> <span class="o">=></span> <span class="s1">'red'</span><span class="p">);</span> + +<span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'someclass'</span><span class="p">,</span> <span class="nv">$params</span><span class="p">);</span> +</pre></div> +</div> +<p>If you use this feature you must set up your class constructor to expect +data:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> <span class="nb">defined</span><span class="p">(</span><span class="s1">'BASEPATH'</span><span class="p">)</span> <span class="k">OR</span> <span class="k">exit</span><span class="p">(</span><span class="s1">'No direct script access allowed'</span><span class="p">);</span> + +<span class="k">class</span> <span class="nc">Someclass</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">(</span><span class="nv">$params</span><span class="p">)</span> + <span class="p">{</span> + <span class="c1">// Do something with $params</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>You can also pass parameters stored in a config file. Simply create a +config file named identically to the class file name and store it in +your <em>application/config/</em> directory. Note that if you dynamically pass +parameters as described above, the config file option will not be +available.</p> +</div> +<div class="section" id="utilizing-codeigniter-resources-within-your-library"> +<h2>Utilizing CodeIgniter Resources within Your Library<a class="headerlink" href="#utilizing-codeigniter-resources-within-your-library" title="Permalink to this headline">¶</a></h2> +<p>To access CodeIgniter’s native resources within your library use the +<code class="docutils literal"><span class="pre">get_instance()</span></code> method. This method returns the CodeIgniter super +object.</p> +<p>Normally from within your controller methods you will call any of the +available CodeIgniter methods using the <code class="docutils literal"><span class="pre">$this</span></code> construct:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'session'</span><span class="p">);</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">config</span><span class="o">-></span><span class="na">item</span><span class="p">(</span><span class="s1">'base_url'</span><span class="p">);</span> +<span class="c1">// etc.</span> +</pre></div> +</div> +<p><code class="docutils literal"><span class="pre">$this</span></code>, however, only works directly within your controllers, your +models, or your views. If you would like to use CodeIgniter’s classes +from within your own custom classes you can do so as follows:</p> +<p>First, assign the CodeIgniter object to a variable:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> +</pre></div> +</div> +<p>Once you’ve assigned the object to a variable, you’ll use that variable +<em>instead</em> of <code class="docutils literal"><span class="pre">$this</span></code>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> + +<span class="nv">$CI</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> +<span class="nv">$CI</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'session'</span><span class="p">);</span> +<span class="nv">$CI</span><span class="o">-></span><span class="na">config</span><span class="o">-></span><span class="na">item</span><span class="p">(</span><span class="s1">'base_url'</span><span class="p">);</span> +<span class="c1">// etc.</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>You’ll notice that the above <code class="docutils literal"><span class="pre">get_instance()</span></code> function is being +passed by reference:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> +</pre></div> +</div> +<p class="last">This is very important. Assigning by reference allows you to use the +original CodeIgniter object rather than creating a copy of it.</p> +</div> +<p>However, since a library is a class, it would be better if you +take full advantage of the OOP principles. So, in order to +be able to use the CodeIgniter super-object in all of the class +methods, you’re encouraged to assign it to a property instead:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Example_library</span> <span class="p">{</span> + + <span class="k">protected</span> <span class="nv">$CI</span><span class="p">;</span> + + <span class="c1">// We'll use a constructor, as you can't directly call a function</span> + <span class="c1">// from a property definition.</span> + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">()</span> + <span class="p">{</span> + <span class="c1">// Assign the CodeIgniter super-object</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">CI</span> <span class="o">=&</span> <span class="nx">get_instance</span><span class="p">();</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">foo</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">CI</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> + <span class="nx">redirect</span><span class="p">();</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">bar</span><span class="p">()</span> + <span class="p">{</span> + <span class="k">echo</span> <span class="nv">$this</span><span class="o">-></span><span class="na">CI</span><span class="o">-></span><span class="na">config</span><span class="o">-></span><span class="na">item</span><span class="p">(</span><span class="s1">'base_url'</span><span class="p">);</span> + <span class="p">}</span> + +<span class="p">}</span> +</pre></div> +</div> +</div> +<div class="section" id="replacing-native-libraries-with-your-versions"> +<h2>Replacing Native Libraries with Your Versions<a class="headerlink" href="#replacing-native-libraries-with-your-versions" title="Permalink to this headline">¶</a></h2> +<p>Simply by naming your class files identically to a native library will +cause CodeIgniter to use it instead of the native one. To use this +feature you must name the file and the class declaration exactly the +same as the native library. For example, to replace the native Email +library you’ll create a file named <em>application/libraries/Email.php</em>, +and declare your class with:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">CI_Email</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>Note that most native classes are prefixed with CI_.</p> +<p>To load your library you’ll see the standard loading method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'email'</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">At this time the Database classes can not be replaced with +your own versions.</p> +</div> +</div> +<div class="section" id="extending-native-libraries"> +<h2>Extending Native Libraries<a class="headerlink" href="#extending-native-libraries" title="Permalink to this headline">¶</a></h2> +<p>If all you need to do is add some functionality to an existing library - +perhaps add a method or two - then it’s overkill to replace the entire +library with your version. In this case it’s better to simply extend the +class. Extending a class is nearly identical to replacing a class with a +couple exceptions:</p> +<ul class="simple"> +<li>The class declaration must extend the parent class.</li> +<li>Your new class name and filename must be prefixed with MY_ (this +item is configurable. See below.).</li> +</ul> +<p>For example, to extend the native Email class you’ll create a file named +<em>application/libraries/MY_Email.php</em>, and declare your class with:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MY_Email</span> <span class="k">extends</span> <span class="nx">CI_Email</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>If you need to use a constructor in your class make sure you +extend the parent constructor:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MY_Email</span> <span class="k">extends</span> <span class="nx">CI_Email</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">(</span><span class="nv">$config</span> <span class="o">=</span> <span class="k">array</span><span class="p">())</span> + <span class="p">{</span> + <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">(</span><span class="nv">$config</span><span class="p">);</span> + <span class="c1">// Your own constructor code</span> + <span class="p">}</span> + +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Not all of the libraries have the same (or any) parameters +in their constructor. Take a look at the library that you’re +extending first to see how it should be implemented.</p> +</div> +<div class="section" id="loading-your-sub-class"> +<h3>Loading Your Sub-class<a class="headerlink" href="#loading-your-sub-class" title="Permalink to this headline">¶</a></h3> +<p>To load your sub-class you’ll use the standard syntax normally used. DO +NOT include your prefix. For example, to load the example above, which +extends the Email class, you will use:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'email'</span><span class="p">);</span> +</pre></div> +</div> +<p>Once loaded you will use the class variable as you normally would for +the class you are extending. In the case of the email class all calls +will use:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">email</span><span class="o">-></span><span class="na">some_method</span><span class="p">();</span> +</pre></div> +</div> +</div> +<div class="section" id="setting-your-own-prefix"> +<h3>Setting Your Own Prefix<a class="headerlink" href="#setting-your-own-prefix" title="Permalink to this headline">¶</a></h3> +<p>To set your own sub-class prefix, open your +<em>application/config/config.php</em> file and look for this item:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'subclass_prefix'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'MY_'</span><span class="p">;</span> +</pre></div> +</div> +<p>Please note that all native CodeIgniter libraries are prefixed with CI_ +so DO NOT use that as your prefix.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="drivers.html" class="btn btn-neutral float-right" title="Using CodeIgniter Drivers">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="libraries.html" class="btn btn-neutral" title="Using CodeIgniter Libraries"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html new file mode 100644 index 000000000..498e002a4 --- /dev/null +++ b/user_guide/general/credits.html @@ -0,0 +1,502 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Credits — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="prev" title="Server Requirements" href="requirements.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li>Credits</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="credits"> +<h1>Credits<a class="headerlink" href="#credits" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter was originally developed by <a class="reference external" href="https://ellislab.com/">Rick Ellis</a> +(CEO of <a class="reference external" href="https://ellislab.com/">EllisLab, Inc.</a>). The framework was written for +performance in the real world, with many of the class libraries, helpers, and +sub-systems borrowed from the code-base of <a class="reference external" href="https://ellislab.com/expressionengine">ExpressionEngine</a>.</p> +<p>It was, for years, developed and maintained by EllisLab, the ExpressionEngine +Development Team and a group of community members called the Reactor Team.</p> +<p>In 2014, CodeIgniter was acquired by the <a class="reference external" href="http://www.bcit.ca/">British Columbia Institute of Technology</a> and was then officially announced as a community-maintained +project.</p> +<p>Bleeding edge development is spearheaded by the handpicked contributors +of the Reactor Team.</p> +<p>A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and +for bringing frameworks into the general consciousness of the web community.</p> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + + <a href="requirements.html" class="btn btn-neutral" title="Server Requirements"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/drivers.html b/user_guide/general/drivers.html new file mode 100644 index 000000000..470d4ea19 --- /dev/null +++ b/user_guide/general/drivers.html @@ -0,0 +1,530 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Using CodeIgniter Drivers — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Creating Drivers" href="creating_drivers.html"/> + <link rel="prev" title="Creating Libraries" href="creating_libraries.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Using CodeIgniter Drivers</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="using-codeigniter-drivers"> +<h1>Using CodeIgniter Drivers<a class="headerlink" href="#using-codeigniter-drivers" title="Permalink to this headline">¶</a></h1> +<p>Drivers are a special type of Library that has a parent class and any +number of potential child classes. Child classes have access to the +parent class, but not their siblings. Drivers provide an elegant syntax +in your <a class="reference internal" href="controllers.html"><span class="doc">controllers</span></a> for libraries that benefit +from or require being broken down into discrete classes.</p> +<p>Drivers are found in the <em>system/libraries/</em> directory, in their own +sub-directory which is identically named to the parent library class. +Also inside that directory is a subdirectory named drivers, which +contains all of the possible child class files.</p> +<p>To use a driver you will initialize it within a controller using the +following initialization method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">driver</span><span class="p">(</span><span class="s1">'class_name'</span><span class="p">);</span> +</pre></div> +</div> +<p>Where class name is the name of the driver class you want to invoke. For +example, to load a driver named “Some_parent” you would do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">driver</span><span class="p">(</span><span class="s1">'some_parent'</span><span class="p">);</span> +</pre></div> +</div> +<p>Methods of that class can then be invoked with:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">some_parent</span><span class="o">-></span><span class="na">some_method</span><span class="p">();</span> +</pre></div> +</div> +<p>The child classes, the drivers themselves, can then be called directly +through the parent class, without initializing them:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">some_parent</span><span class="o">-></span><span class="na">child_one</span><span class="o">-></span><span class="na">some_method</span><span class="p">();</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">some_parent</span><span class="o">-></span><span class="na">child_two</span><span class="o">-></span><span class="na">another_method</span><span class="p">();</span> +</pre></div> +</div> +<div class="section" id="creating-your-own-drivers"> +<h2>Creating Your Own Drivers<a class="headerlink" href="#creating-your-own-drivers" title="Permalink to this headline">¶</a></h2> +<p>Please read the section of the user guide that discusses how to <a class="reference internal" href="creating_drivers.html"><span class="doc">create +your own drivers</span></a>.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="creating_drivers.html" class="btn btn-neutral float-right" title="Creating Drivers">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="creating_libraries.html" class="btn btn-neutral" title="Creating Libraries"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/environments.html b/user_guide/general/environments.html new file mode 100644 index 000000000..0aabd17c5 --- /dev/null +++ b/user_guide/general/environments.html @@ -0,0 +1,538 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Handling Multiple Environments — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Alternate PHP Syntax for View Files" href="alternative_php.html"/> + <link rel="prev" title="Managing your Applications" href="managing_apps.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Handling Multiple Environments</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="handling-multiple-environments"> +<h1>Handling Multiple Environments<a class="headerlink" href="#handling-multiple-environments" title="Permalink to this headline">¶</a></h1> +<p>Developers often desire different system behavior depending on whether +an application is running in a development or production environment. +For example, verbose error output is something that would be useful +while developing an application, but it may also pose a security issue +when “live”.</p> +<div class="section" id="the-environment-constant"> +<h2>The ENVIRONMENT Constant<a class="headerlink" href="#the-environment-constant" title="Permalink to this headline">¶</a></h2> +<p>By default, CodeIgniter comes with the environment constant set to use +the value provided in <code class="docutils literal"><span class="pre">$_SERVER['CI_ENV']</span></code>, otherwise defaults to +‘development’. At the top of index.php, you will see:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nb">define</span><span class="p">(</span><span class="s1">'ENVIRONMENT'</span><span class="p">,</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">'CI_ENV'</span><span class="p">])</span> <span class="o">?</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">'CI_ENV'</span><span class="p">]</span> <span class="o">:</span> <span class="s1">'development'</span><span class="p">);</span> +</pre></div> +</div> +<p>This server variable can be set in your .htaccess file, or Apache +config using <a class="reference external" href="https://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv">SetEnv</a>. +Alternative methods are available for nginx and other servers, or you can +remove this logic entirely and set the constant based on the server’s IP address.</p> +<p>In addition to affecting some basic framework behavior (see the next +section), you may use this constant in your own development to +differentiate between which environment you are running in.</p> +</div> +<div class="section" id="effects-on-default-framework-behavior"> +<h2>Effects On Default Framework Behavior<a class="headerlink" href="#effects-on-default-framework-behavior" title="Permalink to this headline">¶</a></h2> +<p>There are some places in the CodeIgniter system where the ENVIRONMENT +constant is used. This section describes how default framework behavior +is affected.</p> +<div class="section" id="error-reporting"> +<h3>Error Reporting<a class="headerlink" href="#error-reporting" title="Permalink to this headline">¶</a></h3> +<p>Setting the ENVIRONMENT constant to a value of ‘development’ will cause +all PHP errors to be rendered to the browser when they occur. +Conversely, setting the constant to ‘production’ will disable all error +output. Disabling error reporting in production is a <a class="reference internal" href="security.html"><span class="doc">good security +practice</span></a>.</p> +</div> +<div class="section" id="configuration-files"> +<h3>Configuration Files<a class="headerlink" href="#configuration-files" title="Permalink to this headline">¶</a></h3> +<p>Optionally, you can have CodeIgniter load environment-specific +configuration files. This may be useful for managing things like +differing API keys across multiple environments. This is described in +more detail in the environment section of the <a class="reference internal" href="../libraries/config.html"><span class="doc">Config Class</span></a> documentation.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="alternative_php.html" class="btn btn-neutral float-right" title="Alternate PHP Syntax for View Files">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="managing_apps.html" class="btn btn-neutral" title="Managing your Applications"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/errors.html b/user_guide/general/errors.html new file mode 100644 index 000000000..d031b9356 --- /dev/null +++ b/user_guide/general/errors.html @@ -0,0 +1,649 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Error Handling — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Web Page Caching" href="caching.html"/> + <link rel="prev" title="URI Routing" href="routing.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Error Handling</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="error-handling"> +<h1>Error Handling<a class="headerlink" href="#error-handling" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter lets you build error reporting into your applications using +the functions described below. In addition, it has an error logging +class that permits error and debugging messages to be saved as text +files.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">By default, CodeIgniter displays all PHP errors. You might +wish to change this behavior once your development is complete. You’ll +find the error_reporting() function located at the top of your main +index.php file. Disabling error reporting will NOT prevent log files +from being written if there are errors.</p> +</div> +<p>Unlike most systems in CodeIgniter, the error functions are simple +procedural interfaces that are available globally throughout the +application. This approach permits error messages to get triggered +without having to worry about class/function scoping.</p> +<p>CodeIgniter also returns a status code whenever a portion of the core +calls <code class="docutils literal"><span class="pre">exit()</span></code>. This exit status code is separate from the HTTP status +code, and serves as a notice to other processes that may be watching of +whether the script completed successfully, or if not, what kind of +problem it encountered that caused it to abort. These values are +defined in <em>application/config/constants.php</em>. While exit status codes +are most useful in CLI settings, returning the proper code helps server +software keep track of your scripts and the health of your application.</p> +<p>The following functions let you generate errors:</p> +<dl class="function"> +<dt id="show_error"> +<code class="descname">show_error</code><span class="sig-paren">(</span><em>$message</em>, <em>$status_code</em>, <em>$heading = 'An Error Was Encountered'</em><span class="sig-paren">)</span><a class="headerlink" href="#show_error" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$message</strong> (<em>mixed</em>) – Error message</li> +<li><strong>$status_code</strong> (<em>int</em>) – HTTP Response status code</li> +<li><strong>$heading</strong> (<em>string</em>) – Error page heading</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">void</p> +</td> +</tr> +</tbody> +</table> +<p>This function will display the error message supplied to it using +the error template appropriate to your execution:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">application</span><span class="o">/</span><span class="nx">views</span><span class="o">/</span><span class="nx">errors</span><span class="o">/</span><span class="nx">html</span><span class="o">/</span><span class="nx">error_general</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +<p>or:</p> +<blockquote> +<div>application/views/errors/cli/error_general.php</div></blockquote> +<p>The optional parameter <code class="docutils literal"><span class="pre">$status_code</span></code> determines what HTTP status +code should be sent with the error. If <code class="docutils literal"><span class="pre">$status_code</span></code> is less +than 100, the HTTP status code will be set to 500, and the exit +status code will be set to <code class="docutils literal"><span class="pre">$status_code</span> <span class="pre">+</span> <span class="pre">EXIT__AUTO_MIN</span></code>. +If that value is larger than <code class="docutils literal"><span class="pre">EXIT__AUTO_MAX</span></code>, or if +<code class="docutils literal"><span class="pre">$status_code</span></code> is 100 or higher, the exit status code will be set +to <code class="docutils literal"><span class="pre">EXIT_ERROR</span></code>. +You can check in <em>application/config/constants.php</em> for more detail.</p> +</dd></dl> + +<dl class="function"> +<dt id="show_404"> +<code class="descname">show_404</code><span class="sig-paren">(</span><em>$page = ''</em>, <em>$log_error = TRUE</em><span class="sig-paren">)</span><a class="headerlink" href="#show_404" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$page</strong> (<em>string</em>) – URI string</li> +<li><strong>$log_error</strong> (<em>bool</em>) – Whether to log the error</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">void</p> +</td> +</tr> +</tbody> +</table> +<p>This function will display the 404 error message supplied to it +using the error template appropriate to your execution:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">application</span><span class="o">/</span><span class="nx">views</span><span class="o">/</span><span class="nx">errors</span><span class="o">/</span><span class="nx">html</span><span class="o">/</span><span class="nx">error_404</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +<p>or:</p> +<blockquote> +<div>application/views/errors/cli/error_404.php</div></blockquote> +<p>The function expects the string passed to it to be the file path to +the page that isn’t found. The exit status code will be set to +<code class="docutils literal"><span class="pre">EXIT_UNKNOWN_FILE</span></code>. +Note that CodeIgniter automatically shows 404 messages if +controllers are not found.</p> +<p>CodeIgniter automatically logs any <code class="docutils literal"><span class="pre">show_404()</span></code> calls. Setting the +optional second parameter to FALSE will skip logging.</p> +</dd></dl> + +<dl class="function"> +<dt id="log_message"> +<code class="descname">log_message</code><span class="sig-paren">(</span><em>$level</em>, <em>$message</em><span class="sig-paren">)</span><a class="headerlink" href="#log_message" title="Permalink to this definition">¶</a></dt> +<dd><table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> +<li><strong>$level</strong> (<em>string</em>) – Log level: ‘error’, ‘debug’ or ‘info’</li> +<li><strong>$message</strong> (<em>string</em>) – Message to log</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">void</p> +</td> +</tr> +</tbody> +</table> +<p>This function lets you write messages to your log files. You must +supply one of three “levels” in the first parameter, indicating what +type of message it is (debug, error, info), with the message itself +in the second parameter.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$some_var</span> <span class="o">==</span> <span class="s1">''</span><span class="p">)</span> +<span class="p">{</span> + <span class="nx">log_message</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="s1">'Some variable did not contain a value.'</span><span class="p">);</span> +<span class="p">}</span> +<span class="k">else</span> +<span class="p">{</span> + <span class="nx">log_message</span><span class="p">(</span><span class="s1">'debug'</span><span class="p">,</span> <span class="s1">'Some variable was correctly set'</span><span class="p">);</span> +<span class="p">}</span> + +<span class="nx">log_message</span><span class="p">(</span><span class="s1">'info'</span><span class="p">,</span> <span class="s1">'The purpose of some variable is to provide some value.'</span><span class="p">);</span> +</pre></div> +</div> +<p>There are three message types:</p> +<ol class="arabic simple"> +<li>Error Messages. These are actual errors, such as PHP errors or +user errors.</li> +<li>Debug Messages. These are messages that assist in debugging. For +example, if a class has been initialized, you could log this as +debugging info.</li> +<li>Informational Messages. These are the lowest priority messages, +simply giving information regarding some process.</li> +</ol> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">In order for the log file to actually be written, the +<em>logs/</em> directory must be writable. In addition, you must +set the “threshold” for logging in +<em>application/config/config.php</em>. You might, for example, +only want error messages to be logged, and not the other +two types. If you set it to zero logging will be disabled.</p> +</div> +</dd></dl> + +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="caching.html" class="btn btn-neutral float-right" title="Web Page Caching">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="routing.html" class="btn btn-neutral" title="URI Routing"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html new file mode 100644 index 000000000..7d7093053 --- /dev/null +++ b/user_guide/general/helpers.html @@ -0,0 +1,629 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Helper Functions — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Using CodeIgniter Libraries" href="libraries.html"/> + <link rel="prev" title="Models" href="models.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Helper Functions</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="helper-functions"> +<h1>Helper Functions<a class="headerlink" href="#helper-functions" title="Permalink to this headline">¶</a></h1> +<p>Helpers, as the name suggests, help you with tasks. Each helper file is +simply a collection of functions in a particular category. There are <strong>URL +Helpers</strong>, that assist in creating links, there are Form Helpers that help +you create form elements, <strong>Text Helpers</strong> perform various text formatting +routines, <strong>Cookie Helpers</strong> set and read cookies, File Helpers help you +deal with files, etc.</p> +<p>Unlike most other systems in CodeIgniter, Helpers are not written in an +Object Oriented format. They are simple, procedural functions. Each +helper function performs one specific task, with no dependence on other +functions.</p> +<p>CodeIgniter does not load Helper Files by default, so the first step in +using a Helper is to load it. Once loaded, it becomes globally available +in your <a class="reference internal" href="controllers.html"><span class="doc">controller</span></a> and +<a class="reference internal" href="views.html"><span class="doc">views</span></a>.</p> +<p>Helpers are typically stored in your <strong>system/helpers</strong>, or +<strong>application/helpers directory</strong>. CodeIgniter will look first in your +<strong>application/helpers directory</strong>. If the directory does not exist or the +specified helper is not located there CI will instead look in your +global <em>system/helpers/</em> directory.</p> +<div class="section" id="loading-a-helper"> +<h2>Loading a Helper<a class="headerlink" href="#loading-a-helper" title="Permalink to this headline">¶</a></h2> +<p>Loading a helper file is quite simple using the following method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'name'</span><span class="p">);</span> +</pre></div> +</div> +<p>Where <strong>name</strong> is the file name of the helper, without the .php file +extension or the “helper” part.</p> +<p>For example, to load the <strong>URL Helper</strong> file, which is named +<strong>url_helper.php</strong>, you would do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span><span class="s1">'url'</span><span class="p">);</span> +</pre></div> +</div> +<p>A helper can be loaded anywhere within your controller methods (or +even within your View files, although that’s not a good practice), as +long as you load it before you use it. You can load your helpers in your +controller constructor so that they become available automatically in +any function, or you can load a helper in a specific function that needs +it.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The Helper loading method above does not return a value, so +don’t try to assign it to a variable. Just use it as shown.</p> +</div> +</div> +<div class="section" id="loading-multiple-helpers"> +<h2>Loading Multiple Helpers<a class="headerlink" href="#loading-multiple-helpers" title="Permalink to this headline">¶</a></h2> +<p>If you need to load more than one helper you can specify them in an +array, like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">helper</span><span class="p">(</span> + <span class="k">array</span><span class="p">(</span><span class="s1">'helper1'</span><span class="p">,</span> <span class="s1">'helper2'</span><span class="p">,</span> <span class="s1">'helper3'</span><span class="p">)</span> +<span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="auto-loading-helpers"> +<h2>Auto-loading Helpers<a class="headerlink" href="#auto-loading-helpers" title="Permalink to this headline">¶</a></h2> +<p>If you find that you need a particular helper globally throughout your +application, you can tell CodeIgniter to auto-load it during system +initialization. This is done by opening the <strong>application/config/autoload.php</strong> +file and adding the helper to the autoload array.</p> +</div> +<div class="section" id="using-a-helper"> +<h2>Using a Helper<a class="headerlink" href="#using-a-helper" title="Permalink to this headline">¶</a></h2> +<p>Once you’ve loaded the Helper File containing the function you intend to +use, you’ll call it the way you would a standard PHP function.</p> +<p>For example, to create a link using the <code class="docutils literal"><span class="pre">anchor()</span></code> function in one of +your view files you would do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nx">anchor</span><span class="p">(</span><span class="s1">'blog/comments'</span><span class="p">,</span> <span class="s1">'Click Here'</span><span class="p">);</span><span class="cp">?></span> +</pre></div> +</div> +<p>Where “Click Here” is the name of the link, and “blog/comments” is the +URI to the controller/method you wish to link to.</p> +</div> +<div class="section" id="extending-helpers"> +<h2>“Extending” Helpers<a class="headerlink" href="#extending-helpers" title="Permalink to this headline">¶</a></h2> +<p>To “extend” Helpers, create a file in your <strong>application/helpers/</strong> folder +with an identical name to the existing Helper, but prefixed with <strong>MY_</strong> +(this item is configurable. See below.).</p> +<p>If all you need to do is add some functionality to an existing helper - +perhaps add a function or two, or change how a particular helper +function operates - then it’s overkill to replace the entire helper with +your version. In this case it’s better to simply “extend” the Helper.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The term “extend” is used loosely since Helper functions are +procedural and discrete and cannot be extended in the traditional +programmatic sense. Under the hood, this gives you the ability to +add to or or to replace the functions a Helper provides.</p> +</div> +<p>For example, to extend the native <strong>Array Helper</strong> you’ll create a file +named <strong>application/helpers/MY_array_helper.php</strong>, and add or override +functions:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// any_in_array() is not in the Array Helper, so it defines a new function</span> +<span class="k">function</span> <span class="nf">any_in_array</span><span class="p">(</span><span class="nv">$needle</span><span class="p">,</span> <span class="nv">$haystack</span><span class="p">)</span> +<span class="p">{</span> + <span class="nv">$needle</span> <span class="o">=</span> <span class="nb">is_array</span><span class="p">(</span><span class="nv">$needle</span><span class="p">)</span> <span class="o">?</span> <span class="nv">$needle</span> <span class="o">:</span> <span class="k">array</span><span class="p">(</span><span class="nv">$needle</span><span class="p">);</span> + + <span class="k">foreach</span> <span class="p">(</span><span class="nv">$needle</span> <span class="k">as</span> <span class="nv">$item</span><span class="p">)</span> + <span class="p">{</span> + <span class="k">if</span> <span class="p">(</span><span class="nb">in_array</span><span class="p">(</span><span class="nv">$item</span><span class="p">,</span> <span class="nv">$haystack</span><span class="p">))</span> + <span class="p">{</span> + <span class="k">return</span> <span class="k">TRUE</span><span class="p">;</span> + <span class="p">}</span> + <span class="p">}</span> + + <span class="k">return</span> <span class="k">FALSE</span><span class="p">;</span> +<span class="p">}</span> + +<span class="c1">// random_element() is included in Array Helper, so it overrides the native function</span> +<span class="k">function</span> <span class="nf">random_element</span><span class="p">(</span><span class="nv">$array</span><span class="p">)</span> +<span class="p">{</span> + <span class="nb">shuffle</span><span class="p">(</span><span class="nv">$array</span><span class="p">);</span> + <span class="k">return</span> <span class="nb">array_pop</span><span class="p">(</span><span class="nv">$array</span><span class="p">);</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="section" id="setting-your-own-prefix"> +<h3>Setting Your Own Prefix<a class="headerlink" href="#setting-your-own-prefix" title="Permalink to this headline">¶</a></h3> +<p>The filename prefix for “extending” Helpers is the same used to extend +libraries and core classes. To set your own prefix, open your +<strong>application/config/config.php</strong> file and look for this item:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'subclass_prefix'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'MY_'</span><span class="p">;</span> +</pre></div> +</div> +<p>Please note that all native CodeIgniter libraries are prefixed with <strong>CI_</strong> +so DO NOT use that as your prefix.</p> +</div> +</div> +<div class="section" id="now-what"> +<h2>Now What?<a class="headerlink" href="#now-what" title="Permalink to this headline">¶</a></h2> +<p>In the Table of Contents you’ll find a list of all the available Helper +Files. Browse each one to see what they do.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="libraries.html" class="btn btn-neutral float-right" title="Using CodeIgniter Libraries">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="models.html" class="btn btn-neutral" title="Models"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html new file mode 100644 index 000000000..4d5935358 --- /dev/null +++ b/user_guide/general/hooks.html @@ -0,0 +1,617 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Hooks - Extending the Framework Core — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Auto-loading Resources" href="autoloader.html"/> + <link rel="prev" title="Creating Ancillary Classes" href="ancillary_classes.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Hooks - Extending the Framework Core</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="hooks-extending-the-framework-core"> +<h1>Hooks - Extending the Framework Core<a class="headerlink" href="#hooks-extending-the-framework-core" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter’s Hooks feature provides a means to tap into and modify the +inner workings of the framework without hacking the core files. When +CodeIgniter runs it follows a specific execution process, diagramed in +the <a class="reference internal" href="../overview/appflow.html"><span class="doc">Application Flow</span></a> page. There may be +instances, however, where you’d like to cause some action to take place +at a particular stage in the execution process. For example, you might +want to run a script right before your controllers get loaded, or right +after, or you might want to trigger one of your own scripts in some +other location.</p> +<div class="section" id="enabling-hooks"> +<h2>Enabling Hooks<a class="headerlink" href="#enabling-hooks" title="Permalink to this headline">¶</a></h2> +<p>The hooks feature can be globally enabled/disabled by setting the +following item in the <strong>application/config/config.php</strong> file:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'enable_hooks'</span><span class="p">]</span> <span class="o">=</span> <span class="k">TRUE</span><span class="p">;</span> +</pre></div> +</div> +</div> +<div class="section" id="defining-a-hook"> +<h2>Defining a Hook<a class="headerlink" href="#defining-a-hook" title="Permalink to this headline">¶</a></h2> +<p>Hooks are defined in the <strong>application/config/hooks.php</strong> file. +Each hook is specified as an array with this prototype:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$hook</span><span class="p">[</span><span class="s1">'pre_controller'</span><span class="p">]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'MyClass'</span><span class="p">,</span> + <span class="s1">'function'</span> <span class="o">=></span> <span class="s1">'Myfunction'</span><span class="p">,</span> + <span class="s1">'filename'</span> <span class="o">=></span> <span class="s1">'Myclass.php'</span><span class="p">,</span> + <span class="s1">'filepath'</span> <span class="o">=></span> <span class="s1">'hooks'</span><span class="p">,</span> + <span class="s1">'params'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="s1">'beer'</span><span class="p">,</span> <span class="s1">'wine'</span><span class="p">,</span> <span class="s1">'snacks'</span><span class="p">)</span> +<span class="p">);</span> +</pre></div> +</div> +<p><strong>Notes:</strong></p> +<p>The array index correlates to the name of the particular hook point you +want to use. In the above example the hook point is pre_controller. A +list of hook points is found below. The following items should be +defined in your associative hook array:</p> +<ul class="simple"> +<li><strong>class</strong> The name of the class you wish to invoke. If you prefer to +use a procedural function instead of a class, leave this item blank.</li> +<li><strong>function</strong> The function (or method) name you wish to call.</li> +<li><strong>filename</strong> The file name containing your class/function.</li> +<li><strong>filepath</strong> The name of the directory containing your script. +Note: +Your script must be located in a directory INSIDE your <em>application/</em> +directory, so the file path is relative to that directory. For example, +if your script is located in <em>application/hooks/</em>, you will simply use +‘hooks’ as your filepath. If your script is located in +<em>application/hooks/utilities/</em> you will use ‘hooks/utilities’ as your +filepath. No trailing slash.</li> +<li><strong>params</strong> Any parameters you wish to pass to your script. This item +is optional.</li> +</ul> +<p>You can also use lambda/anoymous functions (or closures) as hooks, with +a simpler syntax:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$hook</span><span class="p">[</span><span class="s1">'post_controller'</span><span class="p">]</span> <span class="o">=</span> <span class="k">function</span><span class="p">()</span> +<span class="p">{</span> + <span class="cm">/* do something here */</span> +<span class="p">};</span> +</pre></div> +</div> +</div> +<div class="section" id="multiple-calls-to-the-same-hook"> +<h2>Multiple Calls to the Same Hook<a class="headerlink" href="#multiple-calls-to-the-same-hook" title="Permalink to this headline">¶</a></h2> +<p>If want to use the same hook point with more than one script, simply +make your array declaration multi-dimensional, like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$hook</span><span class="p">[</span><span class="s1">'pre_controller'</span><span class="p">][]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'MyClass'</span><span class="p">,</span> + <span class="s1">'function'</span> <span class="o">=></span> <span class="s1">'MyMethod'</span><span class="p">,</span> + <span class="s1">'filename'</span> <span class="o">=></span> <span class="s1">'Myclass.php'</span><span class="p">,</span> + <span class="s1">'filepath'</span> <span class="o">=></span> <span class="s1">'hooks'</span><span class="p">,</span> + <span class="s1">'params'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="s1">'beer'</span><span class="p">,</span> <span class="s1">'wine'</span><span class="p">,</span> <span class="s1">'snacks'</span><span class="p">)</span> +<span class="p">);</span> + +<span class="nv">$hook</span><span class="p">[</span><span class="s1">'pre_controller'</span><span class="p">][]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'MyOtherClass'</span><span class="p">,</span> + <span class="s1">'function'</span> <span class="o">=></span> <span class="s1">'MyOtherMethod'</span><span class="p">,</span> + <span class="s1">'filename'</span> <span class="o">=></span> <span class="s1">'Myotherclass.php'</span><span class="p">,</span> + <span class="s1">'filepath'</span> <span class="o">=></span> <span class="s1">'hooks'</span><span class="p">,</span> + <span class="s1">'params'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="s1">'red'</span><span class="p">,</span> <span class="s1">'yellow'</span><span class="p">,</span> <span class="s1">'blue'</span><span class="p">)</span> +<span class="p">);</span> +</pre></div> +</div> +<p>Notice the brackets after each array index:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$hook</span><span class="p">[</span><span class="s1">'pre_controller'</span><span class="p">][]</span> +</pre></div> +</div> +<p>This permits you to have the same hook point with multiple scripts. The +order you define your array will be the execution order.</p> +</div> +<div class="section" id="hook-points"> +<h2>Hook Points<a class="headerlink" href="#hook-points" title="Permalink to this headline">¶</a></h2> +<p>The following is a list of available hook points.</p> +<ul class="simple"> +<li><strong>pre_system</strong> +Called very early during system execution. Only the benchmark and +hooks class have been loaded at this point. No routing or other +processes have happened.</li> +<li><strong>pre_controller</strong> +Called immediately prior to any of your controllers being called. +All base classes, routing, and security checks have been done.</li> +<li><strong>post_controller_constructor</strong> +Called immediately after your controller is instantiated, but prior +to any method calls happening.</li> +<li><strong>post_controller</strong> +Called immediately after your controller is fully executed.</li> +<li><strong>display_override</strong> +Overrides the <code class="docutils literal"><span class="pre">_display()</span></code> method, used to send the finalized page +to the web browser at the end of system execution. This permits you +to use your own display methodology. Note that you will need to +reference the CI superobject with <code class="docutils literal"><span class="pre">$this->CI</span> <span class="pre">=&</span> <span class="pre">get_instance()</span></code> and +then the finalized data will be available by calling +<code class="docutils literal"><span class="pre">$this->CI->output->get_output()</span></code>.</li> +<li><strong>cache_override</strong> +Enables you to call your own method instead of the <code class="docutils literal"><span class="pre">_display_cache()</span></code> +method in the <a class="reference internal" href="../libraries/output.html"><span class="doc">Output Library</span></a>. This permits +you to use your own cache display mechanism.</li> +<li><strong>post_system</strong> +Called after the final rendered page is sent to the browser, at the +end of system execution after the finalized data is sent to the +browser.</li> +</ul> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="autoloader.html" class="btn btn-neutral float-right" title="Auto-loading Resources">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="ancillary_classes.html" class="btn btn-neutral" title="Creating Ancillary Classes"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/index.html b/user_guide/general/index.html new file mode 100644 index 000000000..a72cb17f6 --- /dev/null +++ b/user_guide/general/index.html @@ -0,0 +1,523 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>General Topics — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="next" title="CodeIgniter URLs" href="urls.html"/> + <link rel="prev" title="Developer’s Certificate of Origin 1.1" href="../DCO.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="current reference internal" href="#">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="current reference internal" href="#">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li>General Topics</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="general-topics"> +<h1>General Topics<a class="headerlink" href="#general-topics" title="Permalink to this headline">¶</a></h1> +<div class="toctree-wrapper compound"> +<ul> +<li class="toctree-l1"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l1"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l1"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l1"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l1"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l1"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l1"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l1"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l1"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l1"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l1"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l1"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l1"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l1"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l1"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l1"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l1"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l1"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l1"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l1"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l1"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l1"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l1"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l1"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l1"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l1"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="urls.html" class="btn btn-neutral float-right" title="CodeIgniter URLs">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="../DCO.html" class="btn btn-neutral" title="Developer’s Certificate of Origin 1.1"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/libraries.html b/user_guide/general/libraries.html new file mode 100644 index 000000000..d2877f739 --- /dev/null +++ b/user_guide/general/libraries.html @@ -0,0 +1,521 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Using CodeIgniter Libraries — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Creating Libraries" href="creating_libraries.html"/> + <link rel="prev" title="Helper Functions" href="helpers.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Using CodeIgniter Libraries</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="using-codeigniter-libraries"> +<h1>Using CodeIgniter Libraries<a class="headerlink" href="#using-codeigniter-libraries" title="Permalink to this headline">¶</a></h1> +<p>All of the available libraries are located in your <em>system/libraries/</em> +directory. In most cases, to use one of these classes involves initializing +it within a <a class="reference internal" href="controllers.html"><span class="doc">controller</span></a> using the following +initialization method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'class_name'</span><span class="p">);</span> +</pre></div> +</div> +<p>Where ‘class_name’ is the name of the class you want to invoke. For +example, to load the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a> you would do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="s1">'form_validation'</span><span class="p">);</span> +</pre></div> +</div> +<p>Once initialized you can use it as indicated in the user guide page +corresponding to that class.</p> +<p>Additionally, multiple libraries can be loaded at the same time by +passing an array of libraries to the load method.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">library</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">'email'</span><span class="p">,</span> <span class="s1">'table'</span><span class="p">));</span> +</pre></div> +</div> +<div class="section" id="creating-your-own-libraries"> +<h2>Creating Your Own Libraries<a class="headerlink" href="#creating-your-own-libraries" title="Permalink to this headline">¶</a></h2> +<p>Please read the section of the user guide that discusses how to +<a class="reference internal" href="creating_libraries.html"><span class="doc">create your own libraries</span></a>.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="creating_libraries.html" class="btn btn-neutral float-right" title="Creating Libraries">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="helpers.html" class="btn btn-neutral" title="Helper Functions"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/managing_apps.html b/user_guide/general/managing_apps.html new file mode 100644 index 000000000..925968190 --- /dev/null +++ b/user_guide/general/managing_apps.html @@ -0,0 +1,554 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Managing your Applications — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Handling Multiple Environments" href="environments.html"/> + <link rel="prev" title="Running via the CLI" href="cli.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Managing your Applications</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="managing-your-applications"> +<h1>Managing your Applications<a class="headerlink" href="#managing-your-applications" title="Permalink to this headline">¶</a></h1> +<p>By default it is assumed that you only intend to use CodeIgniter to +manage one application, which you will build in your <em>application/</em> +directory. It is possible, however, to have multiple sets of +applications that share a single CodeIgniter installation, or even to +rename or relocate your application directory.</p> +<div class="section" id="renaming-the-application-directory"> +<h2>Renaming the Application Directory<a class="headerlink" href="#renaming-the-application-directory" title="Permalink to this headline">¶</a></h2> +<p>If you would like to rename your application directory you may do so +as long as you open your main index.php file and set its name using +the <code class="docutils literal"><span class="pre">$application_folder</span></code> variable:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$application_folder</span> <span class="o">=</span> <span class="s1">'application'</span><span class="p">;</span> +</pre></div> +</div> +</div> +<div class="section" id="relocating-your-application-directory"> +<h2>Relocating your Application Directory<a class="headerlink" href="#relocating-your-application-directory" title="Permalink to this headline">¶</a></h2> +<p>It is possible to move your application directory to a different +location on your server than your web root. To do so open +your main index.php and set a <em>full server path</em> in the +<code class="docutils literal"><span class="pre">$application_folder</span></code> variable:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$application_folder</span> <span class="o">=</span> <span class="s1">'/path/to/your/application'</span><span class="p">;</span> +</pre></div> +</div> +</div> +<div class="section" id="running-multiple-applications-with-one-codeigniter-installation"> +<h2>Running Multiple Applications with one CodeIgniter Installation<a class="headerlink" href="#running-multiple-applications-with-one-codeigniter-installation" title="Permalink to this headline">¶</a></h2> +<p>If you would like to share a common CodeIgniter installation to manage +several different applications simply put all of the directories located +inside your application directory into their own sub-directory.</p> +<p>For example, let’s say you want to create two applications, named “foo” +and “bar”. You could structure your application directories like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">applications</span><span class="o">/</span><span class="nx">foo</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">foo</span><span class="o">/</span><span class="nx">config</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">foo</span><span class="o">/</span><span class="nx">controllers</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">foo</span><span class="o">/</span><span class="nx">libraries</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">foo</span><span class="o">/</span><span class="nx">models</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">foo</span><span class="o">/</span><span class="nx">views</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">bar</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">bar</span><span class="o">/</span><span class="nx">config</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">bar</span><span class="o">/</span><span class="nx">controllers</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">bar</span><span class="o">/</span><span class="nx">libraries</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">bar</span><span class="o">/</span><span class="nx">models</span><span class="o">/</span> +<span class="nx">applications</span><span class="o">/</span><span class="nx">bar</span><span class="o">/</span><span class="nx">views</span><span class="o">/</span> +</pre></div> +</div> +<p>To select a particular application for use requires that you open your +main index.php file and set the <code class="docutils literal"><span class="pre">$application_folder</span></code> variable. For +example, to select the “foo” application for use you would do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$application_folder</span> <span class="o">=</span> <span class="s1">'applications/foo'</span><span class="p">;</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Each of your applications will need its own index.php file +which calls the desired application. The index.php file can be named +anything you want.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="environments.html" class="btn btn-neutral float-right" title="Handling Multiple Environments">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="cli.html" class="btn btn-neutral" title="Running via the CLI"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/models.html b/user_guide/general/models.html new file mode 100644 index 000000000..6a79f5d46 --- /dev/null +++ b/user_guide/general/models.html @@ -0,0 +1,673 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Models — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Helper Functions" href="helpers.html"/> + <link rel="prev" title="Views" href="views.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Models</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="models"> +<h1><a class="toc-backref" href="#id1">Models</a><a class="headerlink" href="#models" title="Permalink to this headline">¶</a></h1> +<p>Models are <strong>optionally</strong> available for those who want to use a more +traditional MVC approach.</p> +<div class="contents topic" id="page-contents"> +<p class="topic-title first">Page Contents</p> +<ul class="simple"> +<li><a class="reference internal" href="#models" id="id1">Models</a><ul> +<li><a class="reference internal" href="#what-is-a-model" id="id2">What is a Model?</a></li> +<li><a class="reference internal" href="#anatomy-of-a-model" id="id3">Anatomy of a Model</a></li> +<li><a class="reference internal" href="#loading-a-model" id="id4">Loading a Model</a></li> +<li><a class="reference internal" href="#auto-loading-models" id="id5">Auto-loading Models</a></li> +<li><a class="reference internal" href="#connecting-to-your-database" id="id6">Connecting to your Database</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="what-is-a-model"> +<h2><a class="toc-backref" href="#id2">What is a Model?</a><a class="headerlink" href="#what-is-a-model" title="Permalink to this headline">¶</a></h2> +<p>Models are PHP classes that are designed to work with information in +your database. For example, let’s say you use CodeIgniter to manage a +blog. You might have a model class that contains functions to insert, +update, and retrieve your blog data. Here is an example of what such a +model class might look like:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Blog_model</span> <span class="k">extends</span> <span class="nx">CI_Model</span> <span class="p">{</span> + + <span class="k">public</span> <span class="nv">$title</span><span class="p">;</span> + <span class="k">public</span> <span class="nv">$content</span><span class="p">;</span> + <span class="k">public</span> <span class="nv">$date</span><span class="p">;</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">get_last_ten_entries</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$query</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">get</span><span class="p">(</span><span class="s1">'entries'</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span> + <span class="k">return</span> <span class="nv">$query</span><span class="o">-></span><span class="na">result</span><span class="p">();</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">insert_entry</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">title</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">'title'</span><span class="p">];</span> <span class="c1">// please read the below note</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">content</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">'content'</span><span class="p">];</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">date</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> + + <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">insert</span><span class="p">(</span><span class="s1">'entries'</span><span class="p">,</span> <span class="nv">$this</span><span class="p">);</span> + <span class="p">}</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">update_entry</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">title</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">'title'</span><span class="p">];</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">content</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">'content'</span><span class="p">];</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">date</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> + + <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">update</span><span class="p">(</span><span class="s1">'entries'</span><span class="p">,</span> <span class="nv">$this</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">'id'</span> <span class="o">=></span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">'id'</span><span class="p">]));</span> + <span class="p">}</span> + +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The methods in the above example use the <a class="reference internal" href="../database/query_builder.html"><span class="doc">Query Builder</span></a> database methods.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For the sake of simplicity in this example we’re using <code class="docutils literal"><span class="pre">$_POST</span></code> +directly. This is generally bad practice, and a more common approach +would be to use the <a class="reference internal" href="../libraries/input.html"><span class="doc">Input Library</span></a> +<code class="docutils literal"><span class="pre">$this->input->post('title')</span></code>.</p> +</div> +</div> +<div class="section" id="anatomy-of-a-model"> +<h2><a class="toc-backref" href="#id3">Anatomy of a Model</a><a class="headerlink" href="#anatomy-of-a-model" title="Permalink to this headline">¶</a></h2> +<p>Model classes are stored in your <strong>application/models/</strong> directory. +They can be nested within sub-directories if you want this type of +organization.</p> +<p>The basic prototype for a model class is this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Model_name</span> <span class="k">extends</span> <span class="nx">CI_Model</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>Where <strong>Model_name</strong> is the name of your class. Class names <strong>must</strong> have +the first letter capitalized with the rest of the name lowercase. Make +sure your class extends the base Model class.</p> +<p>The file name must match the class name. For example, if this is your class:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">User_model</span> <span class="k">extends</span> <span class="nx">CI_Model</span> <span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>Your file will be this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">application</span><span class="o">/</span><span class="nx">models</span><span class="o">/</span><span class="nx">User_model</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +</div> +<div class="section" id="loading-a-model"> +<h2><a class="toc-backref" href="#id4">Loading a Model</a><a class="headerlink" href="#loading-a-model" title="Permalink to this headline">¶</a></h2> +<p>Your models will typically be loaded and called from within your +<a class="reference internal" href="controllers.html"><span class="doc">controller</span></a> methods. To load a model you will use +the following method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'model_name'</span><span class="p">);</span> +</pre></div> +</div> +<p>If your model is located in a sub-directory, include the relative path +from your models directory. For example, if you have a model located at +<em>application/models/blog/Queries.php</em> you’ll load it using:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'blog/queries'</span><span class="p">);</span> +</pre></div> +</div> +<p>Once loaded, you will access your model methods using an object with the +same name as your class:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'model_name'</span><span class="p">);</span> + +<span class="nv">$this</span><span class="o">-></span><span class="na">model_name</span><span class="o">-></span><span class="na">method</span><span class="p">();</span> +</pre></div> +</div> +<p>If you would like your model assigned to a different object name you can +specify it via the second parameter of the loading method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'model_name'</span><span class="p">,</span> <span class="s1">'foobar'</span><span class="p">);</span> + +<span class="nv">$this</span><span class="o">-></span><span class="na">foobar</span><span class="o">-></span><span class="na">method</span><span class="p">();</span> +</pre></div> +</div> +<p>Here is an example of a controller, that loads a model, then serves a +view:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Blog_controller</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">blog</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'blog'</span><span class="p">);</span> + + <span class="nv">$data</span><span class="p">[</span><span class="s1">'query'</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">blog</span><span class="o">-></span><span class="na">get_last_ten_entries</span><span class="p">();</span> + + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'blog'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +</div> +<div class="section" id="auto-loading-models"> +<h2><a class="toc-backref" href="#id5">Auto-loading Models</a><a class="headerlink" href="#auto-loading-models" title="Permalink to this headline">¶</a></h2> +<p>If you find that you need a particular model globally throughout your +application, you can tell CodeIgniter to auto-load it during system +initialization. This is done by opening the +<strong>application/config/autoload.php</strong> file and adding the model to the +autoload array.</p> +</div> +<div class="section" id="connecting-to-your-database"> +<h2><a class="toc-backref" href="#id6">Connecting to your Database</a><a class="headerlink" href="#connecting-to-your-database" title="Permalink to this headline">¶</a></h2> +<p>When a model is loaded it does <strong>NOT</strong> connect automatically to your +database. The following options for connecting are available to you:</p> +<ul> +<li><p class="first">You can connect using the standard database methods <a class="reference internal" href="../database/connecting.html"><span class="doc">described +here</span></a>, either from within your +Controller class or your Model class.</p> +</li> +<li><p class="first">You can tell the model loading method to auto-connect by passing +TRUE (boolean) via the third parameter, and connectivity settings, +as defined in your database config file will be used:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'model_name'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +</pre></div> +</div> +</li> +<li><p class="first">You can manually pass database connectivity settings via the third +parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'hostname'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'localhost'</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'username'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'myusername'</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'password'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'mypassword'</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'database'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'mydatabase'</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'dbdriver'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'mysqli'</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'dbprefix'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">''</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'pconnect'</span><span class="p">]</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'db_debug'</span><span class="p">]</span> <span class="o">=</span> <span class="k">TRUE</span><span class="p">;</span> + +<span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">model</span><span class="p">(</span><span class="s1">'model_name'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$config</span><span class="p">);</span> +</pre></div> +</div> +</li> +</ul> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="helpers.html" class="btn btn-neutral float-right" title="Helper Functions">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="views.html" class="btn btn-neutral" title="Views"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html new file mode 100644 index 000000000..dbacb3014 --- /dev/null +++ b/user_guide/general/profiling.html @@ -0,0 +1,624 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Profiling Your Application — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Running via the CLI" href="cli.html"/> + <link rel="prev" title="Web Page Caching" href="caching.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Profiling Your Application</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="profiling-your-application"> +<h1>Profiling Your Application<a class="headerlink" href="#profiling-your-application" title="Permalink to this headline">¶</a></h1> +<p>The Profiler Class will display benchmark results, queries you have run, +and <code class="docutils literal"><span class="pre">$_POST</span></code> data at the bottom of your pages. This information can be +useful during development in order to help with debugging and +optimization.</p> +<div class="section" id="initializing-the-class"> +<h2>Initializing the Class<a class="headerlink" href="#initializing-the-class" title="Permalink to this headline">¶</a></h2> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">This class does NOT need to be initialized. It is loaded +automatically by the <a class="reference internal" href="../libraries/output.html"><span class="doc">Output Library</span></a> +if profiling is enabled as shown below.</p> +</div> +</div> +<div class="section" id="enabling-the-profiler"> +<h2>Enabling the Profiler<a class="headerlink" href="#enabling-the-profiler" title="Permalink to this headline">¶</a></h2> +<p>To enable the profiler place the following line anywhere within your +<a class="reference internal" href="controllers.html"><span class="doc">Controller</span></a> methods:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">enable_profiler</span><span class="p">(</span><span class="k">TRUE</span><span class="p">);</span> +</pre></div> +</div> +<p>When enabled a report will be generated and inserted at the bottom of +your pages.</p> +<p>To disable the profiler you will use:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">enable_profiler</span><span class="p">(</span><span class="k">FALSE</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="setting-benchmark-points"> +<h2>Setting Benchmark Points<a class="headerlink" href="#setting-benchmark-points" title="Permalink to this headline">¶</a></h2> +<p>In order for the Profiler to compile and display your benchmark data you +must name your mark points using specific syntax.</p> +<p>Please read the information on setting Benchmark points in the +<a class="reference internal" href="../libraries/benchmark.html"><span class="doc">Benchmark Library</span></a> page.</p> +</div> +<div class="section" id="enabling-and-disabling-profiler-sections"> +<h2>Enabling and Disabling Profiler Sections<a class="headerlink" href="#enabling-and-disabling-profiler-sections" title="Permalink to this headline">¶</a></h2> +<p>Each section of Profiler data can be enabled or disabled by setting a +corresponding config variable to TRUE or FALSE. This can be done one of +two ways. First, you can set application wide defaults with the +<em>application/config/profiler.php</em> config file.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'config'</span><span class="p">]</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'queries'</span><span class="p">]</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">;</span> +</pre></div> +</div> +<p>In your controllers, you can override the defaults and config file +values by calling the <code class="docutils literal"><span class="pre">set_profiler_sections()</span></code> method of the +<a class="reference internal" href="../libraries/output.html"><span class="doc">Output Library</span></a>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$sections</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'config'</span> <span class="o">=></span> <span class="k">TRUE</span><span class="p">,</span> + <span class="s1">'queries'</span> <span class="o">=></span> <span class="k">TRUE</span> +<span class="p">);</span> + +<span class="nv">$this</span><span class="o">-></span><span class="na">output</span><span class="o">-></span><span class="na">set_profiler_sections</span><span class="p">(</span><span class="nv">$sections</span><span class="p">);</span> +</pre></div> +</div> +<p>Available sections and the array key used to access them are described +in the table below.</p> +<table border="1" class="docutils"> +<colgroup> +<col width="23%" /> +<col width="68%" /> +<col width="8%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Key</th> +<th class="head">Description</th> +<th class="head">Default</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td><strong>benchmarks</strong></td> +<td>Elapsed time of Benchmark points and total execution time</td> +<td>TRUE</td> +</tr> +<tr class="row-odd"><td><strong>config</strong></td> +<td>CodeIgniter Config variables</td> +<td>TRUE</td> +</tr> +<tr class="row-even"><td><strong>controller_info</strong></td> +<td>The Controller class and method requested</td> +<td>TRUE</td> +</tr> +<tr class="row-odd"><td><strong>get</strong></td> +<td>Any GET data passed in the request</td> +<td>TRUE</td> +</tr> +<tr class="row-even"><td><strong>http_headers</strong></td> +<td>The HTTP headers for the current request</td> +<td>TRUE</td> +</tr> +<tr class="row-odd"><td><strong>memory_usage</strong></td> +<td>Amount of memory consumed by the current request, in bytes</td> +<td>TRUE</td> +</tr> +<tr class="row-even"><td><strong>post</strong></td> +<td>Any POST data passed in the request</td> +<td>TRUE</td> +</tr> +<tr class="row-odd"><td><strong>queries</strong></td> +<td>Listing of all database queries executed, including execution time</td> +<td>TRUE</td> +</tr> +<tr class="row-even"><td><strong>uri_string</strong></td> +<td>The URI of the current request</td> +<td>TRUE</td> +</tr> +<tr class="row-odd"><td><strong>session_data</strong></td> +<td>Data stored in the current session</td> +<td>TRUE</td> +</tr> +<tr class="row-even"><td><strong>query_toggle_count</strong></td> +<td>The number of queries after which the query block will default to +hidden.</td> +<td>25</td> +</tr> +</tbody> +</table> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Disabling the <a class="reference internal" href="../database/configuration.html"><span class="doc">save_queries</span></a> setting in +your database configuration will also effectively disable profiling for +database queries and render the ‘queries’ setting above useless. You can +optionally override this setting with <code class="docutils literal"><span class="pre">$this->db->save_queries</span> <span class="pre">=</span> <span class="pre">TRUE;</span></code>. +Without this setting you won’t be able to view the queries or the +<cite>last_query <database/helpers></cite>.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="cli.html" class="btn btn-neutral float-right" title="Running via the CLI">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="caching.html" class="btn btn-neutral" title="Web Page Caching"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html new file mode 100644 index 000000000..c66377393 --- /dev/null +++ b/user_guide/general/requirements.html @@ -0,0 +1,511 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Server Requirements — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="next" title="Credits" href="credits.html"/> + <link rel="prev" title="The MIT License (MIT)" href="../license.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li>Server Requirements</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="server-requirements"> +<h1>Server Requirements<a class="headerlink" href="#server-requirements" title="Permalink to this headline">¶</a></h1> +<p><a class="reference external" href="http://php.net/">PHP</a> version 5.6 or newer is recommended.</p> +<p>It should work on 5.3.7 as well, but we strongly advise you NOT to run +such old versions of PHP, because of potential security and performance +issues, as well as missing features.</p> +<p>A database is required for most web application programming. +Currently supported databases are:</p> +<blockquote> +<div><ul class="simple"> +<li>MySQL (5.1+) via the <em>mysql</em> (deprecated), <em>mysqli</em> and <em>pdo</em> drivers</li> +<li>Oracle via the <em>oci8</em> and <em>pdo</em> drivers</li> +<li>PostgreSQL via the <em>postgre</em> and <em>pdo</em> drivers</li> +<li>MS SQL via the <em>mssql</em>, <em>sqlsrv</em> (version 2005 and above only) and <em>pdo</em> drivers</li> +<li>SQLite via the <em>sqlite</em> (version 2), <em>sqlite3</em> (version 3) and <em>pdo</em> drivers</li> +<li>CUBRID via the <em>cubrid</em> and <em>pdo</em> drivers</li> +<li>Interbase/Firebird via the <em>ibase</em> and <em>pdo</em> drivers</li> +<li>ODBC via the <em>odbc</em> and <em>pdo</em> drivers (you should know that ODBC is actually an abstraction layer)</li> +</ul> +</div></blockquote> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="credits.html" class="btn btn-neutral float-right" title="Credits">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="../license.html" class="btn btn-neutral" title="The MIT License (MIT)"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/reserved_names.html b/user_guide/general/reserved_names.html new file mode 100644 index 000000000..2e3adec4d --- /dev/null +++ b/user_guide/general/reserved_names.html @@ -0,0 +1,583 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Reserved Names — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Views" href="views.html"/> + <link rel="prev" title="Controllers" href="controllers.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Reserved Names</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="reserved-names"> +<h1>Reserved Names<a class="headerlink" href="#reserved-names" title="Permalink to this headline">¶</a></h1> +<p>In order to help out, CodeIgniter uses a series of function, method, +class and variable names in its operation. Because of this, some names +cannot be used by a developer. Following is a list of reserved names +that cannot be used.</p> +<div class="section" id="controller-names"> +<h2>Controller names<a class="headerlink" href="#controller-names" title="Permalink to this headline">¶</a></h2> +<p>Since your controller classes will extend the main application +controller you must be careful not to name your methods identically to +the ones used by that class, otherwise your local methods will +override them. The following is a list of reserved names. Do not name +your controller any of these:</p> +<ul class="simple"> +<li>CI_Controller</li> +<li>Default</li> +<li>index</li> +</ul> +</div> +<div class="section" id="functions"> +<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2> +<ul class="simple"> +<li><a class="reference internal" href="common_functions.html#is_php" title="is_php"><code class="xref php php-func docutils literal"><span class="pre">is_php()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#is_really_writable" title="is_really_writable"><code class="xref php php-func docutils literal"><span class="pre">is_really_writable()</span></code></a></li> +<li><code class="docutils literal"><span class="pre">load_class()</span></code></li> +<li><code class="docutils literal"><span class="pre">is_loaded()</span></code></li> +<li><code class="docutils literal"><span class="pre">get_config()</span></code></li> +<li><a class="reference internal" href="common_functions.html#config_item" title="config_item"><code class="xref php php-func docutils literal"><span class="pre">config_item()</span></code></a></li> +<li><a class="reference internal" href="errors.html#show_error" title="show_error"><code class="xref php php-func docutils literal"><span class="pre">show_error()</span></code></a></li> +<li><a class="reference internal" href="errors.html#show_404" title="show_404"><code class="xref php php-func docutils literal"><span class="pre">show_404()</span></code></a></li> +<li><a class="reference internal" href="errors.html#log_message" title="log_message"><code class="xref php php-func docutils literal"><span class="pre">log_message()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#set_status_header" title="set_status_header"><code class="xref php php-func docutils literal"><span class="pre">set_status_header()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#get_mimes" title="get_mimes"><code class="xref php php-func docutils literal"><span class="pre">get_mimes()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#html_escape" title="html_escape"><code class="xref php php-func docutils literal"><span class="pre">html_escape()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#remove_invisible_characters" title="remove_invisible_characters"><code class="xref php php-func docutils literal"><span class="pre">remove_invisible_characters()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#is_https" title="is_https"><code class="xref php php-func docutils literal"><span class="pre">is_https()</span></code></a></li> +<li><a class="reference internal" href="common_functions.html#function_usable" title="function_usable"><code class="xref php php-func docutils literal"><span class="pre">function_usable()</span></code></a></li> +<li><a class="reference internal" href="ancillary_classes.html#get_instance" title="get_instance"><code class="xref php php-func docutils literal"><span class="pre">get_instance()</span></code></a></li> +<li><code class="docutils literal"><span class="pre">_error_handler()</span></code></li> +<li><code class="docutils literal"><span class="pre">_exception_handler()</span></code></li> +<li><code class="docutils literal"><span class="pre">_stringify_attributes()</span></code></li> +</ul> +</div> +<div class="section" id="variables"> +<h2>Variables<a class="headerlink" href="#variables" title="Permalink to this headline">¶</a></h2> +<ul class="simple"> +<li><code class="docutils literal"><span class="pre">$config</span></code></li> +<li><code class="docutils literal"><span class="pre">$db</span></code></li> +<li><code class="docutils literal"><span class="pre">$lang</span></code></li> +</ul> +</div> +<div class="section" id="constants"> +<h2>Constants<a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h2> +<ul class="simple"> +<li>ENVIRONMENT</li> +<li>FCPATH</li> +<li>SELF</li> +<li>BASEPATH</li> +<li>APPPATH</li> +<li>VIEWPATH</li> +<li>CI_VERSION</li> +<li>MB_ENABLED</li> +<li>ICONV_ENABLED</li> +<li>UTF8_ENABLED</li> +<li>FILE_READ_MODE</li> +<li>FILE_WRITE_MODE</li> +<li>DIR_READ_MODE</li> +<li>DIR_WRITE_MODE</li> +<li>FOPEN_READ</li> +<li>FOPEN_READ_WRITE</li> +<li>FOPEN_WRITE_CREATE_DESTRUCTIVE</li> +<li>FOPEN_READ_WRITE_CREATE_DESTRUCTIVE</li> +<li>FOPEN_WRITE_CREATE</li> +<li>FOPEN_READ_WRITE_CREATE</li> +<li>FOPEN_WRITE_CREATE_STRICT</li> +<li>FOPEN_READ_WRITE_CREATE_STRICT</li> +<li>SHOW_DEBUG_BACKTRACE</li> +<li>EXIT_SUCCESS</li> +<li>EXIT_ERROR</li> +<li>EXIT_CONFIG</li> +<li>EXIT_UNKNOWN_FILE</li> +<li>EXIT_UNKNOWN_CLASS</li> +<li>EXIT_UNKNOWN_METHOD</li> +<li>EXIT_USER_INPUT</li> +<li>EXIT_DATABASE</li> +<li>EXIT__AUTO_MIN</li> +<li>EXIT__AUTO_MAX</li> +</ul> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="views.html" class="btn btn-neutral float-right" title="Views">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="controllers.html" class="btn btn-neutral" title="Controllers"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/routing.html b/user_guide/general/routing.html new file mode 100644 index 000000000..aced6f00f --- /dev/null +++ b/user_guide/general/routing.html @@ -0,0 +1,689 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>URI Routing — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Error Handling" href="errors.html"/> + <link rel="prev" title="Compatibility Functions" href="compatibility_functions.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>URI Routing</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="uri-routing"> +<h1>URI Routing<a class="headerlink" href="#uri-routing" title="Permalink to this headline">¶</a></h1> +<p>Typically there is a one-to-one relationship between a URL string and +its corresponding controller class/method. The segments in a URI +normally follow this pattern:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">class</span><span class="o">/</span><span class="nx">function</span><span class="o">/</span><span class="nx">id</span><span class="o">/</span> +</pre></div> +</div> +<p>In some instances, however, you may want to remap this relationship so +that a different class/method can be called instead of the one +corresponding to the URL.</p> +<p>For example, let’s say you want your URLs to have this prototype:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">product</span><span class="o">/</span><span class="mi">1</span><span class="o">/</span> +<span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">product</span><span class="o">/</span><span class="mi">2</span><span class="o">/</span> +<span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">product</span><span class="o">/</span><span class="mi">3</span><span class="o">/</span> +<span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">product</span><span class="o">/</span><span class="mi">4</span><span class="o">/</span> +</pre></div> +</div> +<p>Normally the second segment of the URL is reserved for the method +name, but in the example above it instead has a product ID. To +overcome this, CodeIgniter allows you to remap the URI handler.</p> +<div class="section" id="setting-your-own-routing-rules"> +<h2>Setting your own routing rules<a class="headerlink" href="#setting-your-own-routing-rules" title="Permalink to this headline">¶</a></h2> +<p>Routing rules are defined in your <em>application/config/routes.php</em> file. +In it you’ll see an array called <code class="docutils literal"><span class="pre">$route</span></code> that permits you to specify +your own routing criteria. Routes can either be specified using wildcards +or Regular Expressions.</p> +</div> +<div class="section" id="wildcards"> +<h2>Wildcards<a class="headerlink" href="#wildcards" title="Permalink to this headline">¶</a></h2> +<p>A typical wildcard route might look something like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'product/:num'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'catalog/product_lookup'</span><span class="p">;</span> +</pre></div> +</div> +<p>In a route, the array key contains the URI to be matched, while the +array value contains the destination it should be re-routed to. In the +above example, if the literal word “product” is found in the first +segment of the URL, and a number is found in the second segment, the +“catalog” class and the “product_lookup” method are instead used.</p> +<p>You can match literal values or you can use two wildcard types:</p> +<p><strong>(:num)</strong> will match a segment containing only numbers. +<strong>(:any)</strong> will match a segment containing any character (except for ‘/’, which is the segment delimiter).</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Wildcards are actually aliases for regular expressions, with +<strong>:any</strong> being translated to <strong>[^/]+</strong> and <strong>:num</strong> to <strong>[0-9]+</strong>, +respectively.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Routes will run in the order they are defined. Higher routes +will always take precedence over lower ones.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Route rules are not filters! Setting a rule of e.g. +‘foo/bar/(:num)’ will not prevent controller <em>Foo</em> and method +<em>bar</em> to be called with a non-numeric value if that is a valid +route.</p> +</div> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>Here are a few routing examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'journals'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'blogs'</span><span class="p">;</span> +</pre></div> +</div> +<p>A URL containing the word “journals” in the first segment will be +remapped to the “blogs” class.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'blog/joe'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'blogs/users/34'</span><span class="p">;</span> +</pre></div> +</div> +<p>A URL containing the segments blog/joe will be remapped to the “blogs” +class and the “users” method. The ID will be set to “34”.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'product/(:any)'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'catalog/product_lookup'</span><span class="p">;</span> +</pre></div> +</div> +<p>A URL with “product” as the first segment, and anything in the second +will be remapped to the “catalog” class and the “product_lookup” +method.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'product/(:num)'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'catalog/product_lookup_by_id/$1'</span><span class="p">;</span> +</pre></div> +</div> +<p>A URL with “product” as the first segment, and a number in the second +will be remapped to the “catalog” class and the +“product_lookup_by_id” method passing in the match as a variable to +the method.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Do not use leading/trailing slashes.</p> +</div> +</div> +<div class="section" id="regular-expressions"> +<h2>Regular Expressions<a class="headerlink" href="#regular-expressions" title="Permalink to this headline">¶</a></h2> +<p>If you prefer you can use regular expressions to define your routing +rules. Any valid regular expression is allowed, as are back-references.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you use back-references you must use the dollar syntax +rather than the double backslash syntax.</p> +</div> +<p>A typical RegEx route might look something like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'products/([a-z]+)/(\d+)'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'$1/id_$2'</span><span class="p">;</span> +</pre></div> +</div> +<p>In the above example, a URI similar to products/shirts/123 would instead +call the “shirts” controller class and the “id_123” method.</p> +<p>With regular expressions, you can also catch multiple segments at once. +For example, if a user accesses a password protected area of your web +application and you wish to be able to redirect them back to the same +page after they log in, you may find this example useful:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'login/(.+)'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'auth/login/$1'</span><span class="p">;</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">In the above example, if the <code class="docutils literal"><span class="pre">$1</span></code> placeholder contains a +slash, it will still be split into multiple parameters when +passed to <code class="docutils literal"><span class="pre">Auth::login()</span></code>.</p> +</div> +<p>For those of you who don’t know regular expressions and want to learn +more about them, <a class="reference external" href="http://www.regular-expressions.info/">regular-expressions.info</a> +might be a good starting point.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">You can also mix and match wildcards with regular expressions.</p> +</div> +</div> +<div class="section" id="callbacks"> +<h2>Callbacks<a class="headerlink" href="#callbacks" title="Permalink to this headline">¶</a></h2> +<p>You can also use callbacks in place of the normal routing rules to process +the back-references. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'products/([a-zA-Z]+)/edit/(\d+)'</span><span class="p">]</span> <span class="o">=</span> <span class="k">function</span> <span class="p">(</span><span class="nv">$product_type</span><span class="p">,</span> <span class="nv">$id</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">return</span> <span class="s1">'catalog/product_edit/'</span> <span class="o">.</span> <span class="nb">strtolower</span><span class="p">(</span><span class="nv">$product_type</span><span class="p">)</span> <span class="o">.</span> <span class="s1">'/'</span> <span class="o">.</span> <span class="nv">$id</span><span class="p">;</span> +<span class="p">};</span> +</pre></div> +</div> +</div> +<div class="section" id="using-http-verbs-in-routes"> +<h2>Using HTTP verbs in routes<a class="headerlink" href="#using-http-verbs-in-routes" title="Permalink to this headline">¶</a></h2> +<p>It is possible to use HTTP verbs (request method) to define your routing rules. +This is particularly useful when building RESTful applications. You can use standard HTTP +verbs (GET, PUT, POST, DELETE, PATCH) or a custom one such (e.g. PURGE). HTTP verb rules +are case-insensitive. All you need to do is to add the verb as an array key to your route. +Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'products'</span><span class="p">][</span><span class="s1">'put'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'product/insert'</span><span class="p">;</span> +</pre></div> +</div> +<p>In the above example, a PUT request to URI “products” would call the <code class="docutils literal"><span class="pre">Product::insert()</span></code> +controller method.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'products/(:num)'</span><span class="p">][</span><span class="s1">'DELETE'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'product/delete/$1'</span><span class="p">;</span> +</pre></div> +</div> +<p>A DELETE request to URL with “products” as first the segment and a number in the second will be +mapped to the <code class="docutils literal"><span class="pre">Product::delete()</span></code> method, passing the numeric value as the first parameter.</p> +<p>Using HTTP verbs is of course, optional.</p> +</div> +<div class="section" id="reserved-routes"> +<h2>Reserved Routes<a class="headerlink" href="#reserved-routes" title="Permalink to this headline">¶</a></h2> +<p>There are three reserved routes:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'default_controller'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'welcome'</span><span class="p">;</span> +</pre></div> +</div> +<p>This route points to the action that should be executed if the URI contains +no data, which will be the case when people load your root URL. +The setting accepts a <strong>controller/method</strong> value and <code class="docutils literal"><span class="pre">index()</span></code> would be +the default method if you don’t specify one. In the above example, it is +<code class="docutils literal"><span class="pre">Welcome::index()</span></code> that would be called.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">You can NOT use a directory as a part of this setting!</p> +</div> +<p>You are encouraged to always have a default route as otherwise a 404 page +will appear by default.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'404_override'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">''</span><span class="p">;</span> +</pre></div> +</div> +<p>This route indicates which controller class should be loaded if the +requested controller is not found. It will override the default 404 +error page. Same per-directory rules as with ‘default_controller’ +apply here as well.</p> +<p>It won’t affect to the <code class="docutils literal"><span class="pre">show_404()</span></code> function, which will +continue loading the default <em>error_404.php</em> file at +<em>application/views/errors/error_404.php</em>.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$route</span><span class="p">[</span><span class="s1">'translate_uri_dashes'</span><span class="p">]</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">;</span> +</pre></div> +</div> +<p>As evident by the boolean value, this is not exactly a route. This +option enables you to automatically replace dashes (‘-‘) with +underscores in the controller and method URI segments, thus saving you +additional route entries if you need to do that. +This is required, because the dash isn’t a valid class or method name +character and would cause a fatal error if you try to use it.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="errors.html" class="btn btn-neutral float-right" title="Error Handling">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="compatibility_functions.html" class="btn btn-neutral" title="Compatibility Functions"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/security.html b/user_guide/general/security.html new file mode 100644 index 000000000..fefe3104a --- /dev/null +++ b/user_guide/general/security.html @@ -0,0 +1,663 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Security — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="PHP Style Guide" href="styleguide.html"/> + <link rel="prev" title="Alternate PHP Syntax for View Files" href="alternative_php.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Security</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="security"> +<h1>Security<a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h1> +<p>This page describes some “best practices” regarding web security, and +details CodeIgniter’s internal security features.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you came here looking for a security contact, please refer to +our <cite>Contribution Guide <../contributing/index></cite>.</p> +</div> +<div class="section" id="uri-security"> +<h2>URI Security<a class="headerlink" href="#uri-security" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter is fairly restrictive regarding which characters it allows +in your URI strings in order to help minimize the possibility that +malicious data can be passed to your application. URIs may only contain +the following:</p> +<ul class="simple"> +<li>Alpha-numeric text (latin characters only)</li> +<li>Tilde: ~</li> +<li>Percent sign: %</li> +<li>Period: .</li> +<li>Colon: :</li> +<li>Underscore: _</li> +<li>Dash: -</li> +<li>Space</li> +</ul> +</div> +<div class="section" id="register-globals"> +<h2>Register_globals<a class="headerlink" href="#register-globals" title="Permalink to this headline">¶</a></h2> +<p>During system initialization all global variables that are found to exist +in the <code class="docutils literal"><span class="pre">$_GET</span></code>, <code class="docutils literal"><span class="pre">$_POST</span></code>, <code class="docutils literal"><span class="pre">$_REQUEST</span></code> and <code class="docutils literal"><span class="pre">$_COOKIE</span></code> are unset.</p> +<p>The unsetting routine is effectively the same as <em>register_globals = off</em>.</p> +</div> +<div class="section" id="display-errors"> +<h2>display_errors<a class="headerlink" href="#display-errors" title="Permalink to this headline">¶</a></h2> +<p>In production environments, it is typically desirable to “disable” PHP’s +error reporting by setting the internal <em>display_errors</em> flag to a value +of 0. This disables native PHP errors from being rendered as output, +which may potentially contain sensitive information.</p> +<p>Setting CodeIgniter’s <strong>ENVIRONMENT</strong> constant in index.php to a value of +<strong>‘production’</strong> will turn off these errors. In development mode, it is +recommended that a value of ‘development’ is used. More information +about differentiating between environments can be found on the +<a class="reference internal" href="environments.html"><span class="doc">Handling Environments</span></a> page.</p> +</div> +<div class="section" id="magic-quotes-runtime"> +<h2>magic_quotes_runtime<a class="headerlink" href="#magic-quotes-runtime" title="Permalink to this headline">¶</a></h2> +<p>The <em>magic_quotes_runtime</em> directive is turned off during system +initialization so that you don’t have to remove slashes when retrieving +data from your database.</p> +<div class="section" id="best-practices"> +<h3>Best Practices<a class="headerlink" href="#best-practices" title="Permalink to this headline">¶</a></h3> +<p>Before accepting any data into your application, whether it be POST data +from a form submission, COOKIE data, URI data, XML-RPC data, or even +data from the SERVER array, you are encouraged to practice this three +step approach:</p> +<ol class="arabic simple"> +<li>Validate the data to ensure it conforms to the correct type, length, +size, etc.</li> +<li>Filter the data as if it were tainted.</li> +<li>Escape the data before submitting it into your database or outputting +it to a browser.</li> +</ol> +<p>CodeIgniter provides the following functions and tips to assist you +in this process:</p> +</div> +</div> +<div class="section" id="xss-filtering"> +<h2>XSS Filtering<a class="headerlink" href="#xss-filtering" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter comes with a Cross Site Scripting filter. This filter +looks for commonly used techniques to embed malicious JavaScript into +your data, or other types of code that attempt to hijack cookies or +do other malicious things. The XSS Filter is described +<a class="reference internal" href="../libraries/security.html"><span class="doc">here</span></a>.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">XSS filtering should <em>only be performed on output</em>. Filtering +input data may modify the data in undesirable ways, including +stripping special characters from passwords, which reduces +security instead of improving it.</p> +</div> +</div> +<div class="section" id="csrf-protection"> +<h2>CSRF protection<a class="headerlink" href="#csrf-protection" title="Permalink to this headline">¶</a></h2> +<p>CSRF stands for Cross-Site Request Forgery, which is the process of an +attacker tricking their victim into unknowingly submitting a request.</p> +<p>CodeIgniter provides CSRF protection out of the box, which will get +automatically triggered for every non-GET HTTP request, but also needs +you to create your submit forms in a certain way. This is explained in +the <a class="reference internal" href="../libraries/security.html"><span class="doc">Security Library</span></a> documentation.</p> +</div> +<div class="section" id="password-handling"> +<h2>Password handling<a class="headerlink" href="#password-handling" title="Permalink to this headline">¶</a></h2> +<p>It is <em>critical</em> that you handle passwords in your application properly.</p> +<p>Unfortunately, many developers don’t know how to do that, and the web is +full of outdated or otherwise wrongful advices, which doesn’t help.</p> +<p>We would like to give you a list of combined do’s and don’ts to help you +with that. Please read below.</p> +<ul> +<li><p class="first">DO NOT store passwords in plain-text format.</p> +<p>Always <strong>hash</strong> your passwords.</p> +</li> +<li><p class="first">DO NOT use Base64 or similar encoding for storing passwords.</p> +<p>This is as good as storing them in plain-text. Really. Do <strong>hashing</strong>, +not <em>encoding</em>.</p> +<p>Encoding, and encryption too, are two-way processes. Passwords are +secrets that must only be known to their owner, and thus must work +only in one direction. Hashing does that - there’s <em>no</em> un-hashing or +de-hashing, but there is decoding and decryption.</p> +</li> +<li><p class="first">DO NOT use weak or broken hashing algorithms like MD5 or SHA1.</p> +<p>These algorithms are old, proven to be flawed, and not designed for +password hashing in the first place.</p> +<p>Also, DON’T invent your own algorithms.</p> +<p>Only use strong password hashing algorithms like BCrypt, which is used +in PHP’s own <a class="reference external" href="http://php.net/password">Password Hashing</a> functions.</p> +<p>Please use them, even if you’re not running PHP 5.5+, CodeIgniter +provides them for you.</p> +</li> +<li><p class="first">DO NOT ever display or send a password in plain-text format!</p> +<p>Even to the password’s owner, if you need a “Forgotten password” +feature, just randomly generate a new, one-time (this is also important) +password and send that instead.</p> +</li> +<li><p class="first">DO NOT put unnecessary limits on your users’ passwords.</p> +<p>If you’re using a hashing algorithm other than BCrypt (which has a limit +of 72 characters), you should set a relatively high limit on password +lengths in order to mitigate DoS attacks - say, 1024 characters.</p> +<p>Other than that however, there’s no point in forcing a rule that a +password can only be up to a number of characters, or that it can’t +contain a certain set of special characters.</p> +<p>Not only does this <strong>reduce</strong> security instead of improving it, but +there’s literally no reason to do it. No technical limitations and +no (practical) storage constraints apply once you’ve hashed them, none!</p> +</li> +</ul> +</div> +<div class="section" id="validate-input-data"> +<h2>Validate input data<a class="headerlink" href="#validate-input-data" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter has a <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a> that assists you in +validating, filtering, and prepping your data.</p> +<p>Even if that doesn’t work for your use case however, be sure to always +validate and sanitize all input data. For example, if you expect a numeric +string for an input variable, you can check for that with <code class="docutils literal"><span class="pre">is_numeric()</span></code> +or <code class="docutils literal"><span class="pre">ctype_digit()</span></code>. Always try to narrow down your checks to a certain +pattern.</p> +<p>Have it in mind that this includes not only <code class="docutils literal"><span class="pre">$_POST</span></code> and <code class="docutils literal"><span class="pre">$_GET</span></code> +variables, but also cookies, the user-agent string and basically +<em>all data that is not created directly by your own code</em>.</p> +</div> +<div class="section" id="escape-all-data-before-database-insertion"> +<h2>Escape all data before database insertion<a class="headerlink" href="#escape-all-data-before-database-insertion" title="Permalink to this headline">¶</a></h2> +<p>Never insert information into your database without escaping it. +Please see the section that discusses <a class="reference internal" href="../database/queries.html"><span class="doc">database queries</span></a> for more information.</p> +</div> +<div class="section" id="hide-your-files"> +<h2>Hide your files<a class="headerlink" href="#hide-your-files" title="Permalink to this headline">¶</a></h2> +<p>Another good security practice is to only leave your <em>index.php</em> +and “assets” (e.g. .js, css and image files) under your server’s +<em>webroot</em> directory (most commonly named “htdocs/”). These are +the only files that you would need to be accessible from the web.</p> +<p>Allowing your visitors to see anything else would potentially +allow them to access sensitive data, execute scripts, etc.</p> +<p>If you’re not allowed to do that, you can try using a .htaccess +file to restrict access to those resources.</p> +<p>CodeIgniter will have an index.html file in all of its +directories in an attempt to hide some of this data, but have +it in mind that this is not enough to prevent a serious +attacker.</p> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="styleguide.html" class="btn btn-neutral float-right" title="PHP Style Guide">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="alternative_php.html" class="btn btn-neutral" title="Alternate PHP Syntax for View Files"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/styleguide.html b/user_guide/general/styleguide.html new file mode 100644 index 000000000..32b1726d0 --- /dev/null +++ b/user_guide/general/styleguide.html @@ -0,0 +1,1128 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>PHP Style Guide — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Libraries" href="../libraries/index.html"/> + <link rel="prev" title="Security" href="security.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAKwCaAwERAAIRAQMRAf/EAHsAAQAABwEBAAAAAAAAAAAAAAABAwQFBgcIAgkBAQAAAAAAAAAAAAAAAAAAAAAQAAEDAwICBwYEAgsAAAAAAAIBAwQAEQUSBiEHkROTVNQWGDFBUVIUCHEiMtOUFWGBobHRQlMkZIRVEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDSC+ygkOOaUoKigUCgUCgUCgUCgUCgUCgUCgkuGguIP9FBMFb0Hqg7We+3jlmIqqYFf4ub+/QYlnOR/LqIBKGFUbf8qWv971BytQXXE7Y3Lnm3HsFhp2TaZJAdchRXpIgSpdEJWxJEW3xoKV7F5OMy7JkQn2o7D6w33XGjEAkoiqrJEqIiOIiKuhePCgqp22dyYyS3CyWHnQ5joG61HkRnmnTbaFSMhExRVQRRVJU9iUHjE7ez+fJ0MFipmUNhBV8YUd2SoIV9KkjQla9ltegttBdPLW4/qocL+UTfrMiHW4+P9M71shuyrqaHTcxsl7jegpsji8nh5ZwMvDfgTm0RTjSmjYdFCS6KoOIipdFunCgmNYTMv457MMY6U7iI6oMieDDhRm1VbIhuoOkbqtuK0Hpzb+eZcYZexUxt6UyUqK2cd0SdjtgrhOgijcgERUlJOCIl6CpgbP3blRI8XgMjNARAyKNDfeRBdFDBVUAXgQrqH4pxoJTu2NysY97LP4ac1io5q1InHFeGO24LnVKJuKOkSQ/yKir+rh7aCLG1dzypZQI2FnvTgccYOM3FeN0XWERXAUEFVQgQkUktdLpegm+Td3/Xli/L+S/mYNJIOF9G/wBeLKrZHFb0akG6W1WtQWSg3Dyg5e7V3fipE3O4/wCrktyzYA+ufas2LbZIlmnAT2kvuoN1wft95augilglX/tzP3qCu9O3LL/wV/i5v79BvmTADq14UGu91467Z6U9y0HzH/ncj/U/sT/CgynZG7I2NezpZGUjIycJkYkZSG+uQ81pbBNKLxJfjwoMqZ3/ALYHl35AJ7/cuwHcu5k7r1Q5pHetBjquqVVJWGxj9Zrtcl/Ggy3dHMvauR3HFZj5nHNxSyW5JISYDMoIwx8tFIGHZhPNaykGapr6rUAiicEoMG21lMRj8buPAz8xhJrr7uOeiPTCyAwXUaGR1mgozbTusOsFLEiJ7fbQa/h7gcjy2H3V6xppwDNtUSxCJIqp7valBuWVzJ22xuCROXNNZiJkMtms0DbjUkAZjzoDrTMd9dDRI44ZC2YsrYdKWP2WDT2S3N9dNdlRYrGMYc06IURXSYb0igrpWS485xVNS6nF4rwslkoMwnbpgZLB7bmt5uMweAhDEl4B5uSLzzqTnnyVpW2jaJHRMSIjdDiiotvy3DOE5rYTEbkl5yFn28k7JyG4c7AU2HtLH1uKfaiMPI40CdYbpNtmLdwTSn5rewLNld+7TLdeal4WarWBkbVKBjgdElMJJwAAY5fl4kB3b1fp4XvagsGS3FjJfLzDNtS8aeXx7LzT7TyzByQE5PccRGRC0ZRUDRV6y62vbjagzLmJzS2vuPK43JY6aP1TW6Jz+RIWyFtyC06y3EkiiinAo7YCqfq1AqqnGgsOH3lhZO8d1pmcpB8j5XIm9OYlBJSQ/FSS4427DKO0RC8AlcEMhFdViRR1WDWR5t3WXVuL1d106kG9vdeye2g60+1FDyW0shIcXVpyroXt8I8dfd+NB1vioAdWnD3UF1+gD4UFc6CEKpagxXN43rwJLUHz7yX2c8zokt9uHlsPIhA4aRnnHJTLptIS6CNsY7iASpxUUMkReGpfbQW0vtN5pitvrsN28rwtBD0nc0+/Yft5XhaB6TuaXfsP28rwtA9J3NPv2H7eV4Wgek7mn37D9vK8LQPSdzT79h+3leFoHpO5pd+w/byvC0D0nc0u/Yft5XhaB6TuaXfsP28rwtA9J3NLv2H7eV4Wgek7ml37D9vK8LQPSdzS79h+3leFoHpO5p9+w/byvC0E9r7Reazy2HIYVPxkS/CUHVn26cosxyv2g7h89LYmZSXOenvLEQ1YaQ222RATcQCP8rSGqqA8S02W2pQ6FhMoAIlqCtsnwoCpdKClejI4i3Sgtb+GBxVuNBSFt1pV/RQefLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8uM/JQPLjPyUDy4z8lA8utJ/koJ7WCbBU/LQXOPAFq1koK8B0pag90CggtBBf6qB0UDooHRQOigdFA6KB0UDooHRQOigdFA6KB0UDooI0EaBQf//Z" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>PHP Style Guide</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="php-style-guide"> +<h1><a class="toc-backref" href="#id1">PHP Style Guide</a><a class="headerlink" href="#php-style-guide" title="Permalink to this headline">¶</a></h1> +<p>The following page describes the coding styles adhered to when +contributing to the development of CodeIgniter. There is no requirement +to use these styles in your own CodeIgniter application, though they +are recommended.</p> +<div class="contents topic" id="table-of-contents"> +<p class="topic-title first">Table of Contents</p> +<ul class="simple"> +<li><a class="reference internal" href="#php-style-guide" id="id1">PHP Style Guide</a><ul> +<li><a class="reference internal" href="#file-format" id="id2">File Format</a><ul> +<li><a class="reference internal" href="#textmate" id="id3">TextMate</a></li> +<li><a class="reference internal" href="#bbedit" id="id4">BBEdit</a></li> +</ul> +</li> +<li><a class="reference internal" href="#php-closing-tag" id="id5">PHP Closing Tag</a></li> +<li><a class="reference internal" href="#file-naming" id="id6">File Naming</a></li> +<li><a class="reference internal" href="#class-and-method-naming" id="id7">Class and Method Naming</a></li> +<li><a class="reference internal" href="#variable-names" id="id8">Variable Names</a></li> +<li><a class="reference internal" href="#commenting" id="id9">Commenting</a></li> +<li><a class="reference internal" href="#constants" id="id10">Constants</a></li> +<li><a class="reference internal" href="#true-false-and-null" id="id11">TRUE, FALSE, and NULL</a></li> +<li><a class="reference internal" href="#logical-operators" id="id12">Logical Operators</a></li> +<li><a class="reference internal" href="#comparing-return-values-and-typecasting" id="id13">Comparing Return Values and Typecasting</a></li> +<li><a class="reference internal" href="#debugging-code" id="id14">Debugging Code</a></li> +<li><a class="reference internal" href="#whitespace-in-files" id="id15">Whitespace in Files</a></li> +<li><a class="reference internal" href="#compatibility" id="id16">Compatibility</a></li> +<li><a class="reference internal" href="#one-file-per-class" id="id17">One File per Class</a></li> +<li><a class="reference internal" href="#whitespace" id="id18">Whitespace</a></li> +<li><a class="reference internal" href="#line-breaks" id="id19">Line Breaks</a></li> +<li><a class="reference internal" href="#code-indenting" id="id20">Code Indenting</a></li> +<li><a class="reference internal" href="#bracket-and-parenthetic-spacing" id="id21">Bracket and Parenthetic Spacing</a></li> +<li><a class="reference internal" href="#localized-text" id="id22">Localized Text</a></li> +<li><a class="reference internal" href="#private-methods-and-variables" id="id23">Private Methods and Variables</a></li> +<li><a class="reference internal" href="#php-errors" id="id24">PHP Errors</a></li> +<li><a class="reference internal" href="#short-open-tags" id="id25">Short Open Tags</a></li> +<li><a class="reference internal" href="#one-statement-per-line" id="id26">One Statement Per Line</a></li> +<li><a class="reference internal" href="#strings" id="id27">Strings</a></li> +<li><a class="reference internal" href="#sql-queries" id="id28">SQL Queries</a></li> +<li><a class="reference internal" href="#default-function-arguments" id="id29">Default Function Arguments</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="file-format"> +<h2><a class="toc-backref" href="#id2">File Format</a><a class="headerlink" href="#file-format" title="Permalink to this headline">¶</a></h2> +<p>Files should be saved with Unicode (UTF-8) encoding. The BOM should +<em>not</em> be used. Unlike UTF-16 and UTF-32, there’s no byte order to +indicate in a UTF-8 encoded file, and the BOM can have a negative side +effect in PHP of sending output, preventing the application from being +able to set its own headers. Unix line endings should be used (LF).</p> +<p>Here is how to apply these settings in some of the more common text +editors. Instructions for your text editor may vary; check your text +editor’s documentation.</p> +<div class="section" id="textmate"> +<h3><a class="toc-backref" href="#id3">TextMate</a><a class="headerlink" href="#textmate" title="Permalink to this headline">¶</a></h3> +<ol class="arabic simple"> +<li>Open the Application Preferences</li> +<li>Click Advanced, and then the “Saving” tab</li> +<li>In “File Encoding”, select “UTF-8 (recommended)”</li> +<li>In “Line Endings”, select “LF (recommended)”</li> +<li><em>Optional:</em> Check “Use for existing files as well” if you wish to +modify the line endings of files you open to your new preference.</li> +</ol> +</div> +<div class="section" id="bbedit"> +<h3><a class="toc-backref" href="#id4">BBEdit</a><a class="headerlink" href="#bbedit" title="Permalink to this headline">¶</a></h3> +<ol class="arabic simple"> +<li>Open the Application Preferences</li> +<li>Select “Text Encodings” on the left.</li> +<li>In “Default text encoding for new documents”, select “Unicode (UTF-8, +no BOM)”</li> +<li><em>Optional:</em> In “If file’s encoding can’t be guessed, use”, select +“Unicode (UTF-8, no BOM)”</li> +<li>Select “Text Files” on the left.</li> +<li>In “Default line breaks”, select “Mac OS X and Unix (LF)”</li> +</ol> +</div> +</div> +<div class="section" id="php-closing-tag"> +<h2><a class="toc-backref" href="#id5">PHP Closing Tag</a><a class="headerlink" href="#php-closing-tag" title="Permalink to this headline">¶</a></h2> +<p>The PHP closing tag on a PHP document <strong>?></strong> is optional to the PHP +parser. However, if used, any whitespace following the closing tag, +whether introduced by the developer, user, or an FTP application, can +cause unwanted output, PHP errors, or if the latter are suppressed, +blank pages. For this reason, all PHP files MUST OMIT the PHP closing +tag and end with a single empty line instead.</p> +</div> +<div class="section" id="file-naming"> +<h2><a class="toc-backref" href="#id6">File Naming</a><a class="headerlink" href="#file-naming" title="Permalink to this headline">¶</a></h2> +<p>Class files must be named in a Ucfirst-like manner, while any other file name +(configurations, views, generic scripts, etc.) should be in all lowercase.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">somelibrary</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">someLibrary</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">SOMELIBRARY</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">Some_Library</span><span class="o">.</span><span class="nx">php</span> + +<span class="nx">Application_config</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">Application_Config</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">applicationConfig</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">Somelibrary</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">Some_library</span><span class="o">.</span><span class="nx">php</span> + +<span class="nx">applicationconfig</span><span class="o">.</span><span class="nx">php</span> +<span class="nx">application_config</span><span class="o">.</span><span class="nx">php</span> +</pre></div> +</div> +<p>Furthermore, class file names should match the name of the class itself. +For example, if you have a class named <cite>Myclass</cite>, then its filename must +be <strong>Myclass.php</strong>.</p> +</div> +<div class="section" id="class-and-method-naming"> +<h2><a class="toc-backref" href="#id7">Class and Method Naming</a><a class="headerlink" href="#class-and-method-naming" title="Permalink to this headline">¶</a></h2> +<p>Class names should always start with an uppercase letter. Multiple words +should be separated with an underscore, and not CamelCased.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">superclass</span> +<span class="k">class</span> <span class="nc">SuperClass</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Super_class</span> +</pre></div> +</div> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Super_class</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">__construct</span><span class="p">()</span> + <span class="p">{</span> + + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Class methods should be entirely lowercased and named to clearly +indicate their function, preferably including a verb. Try to avoid +overly long and verbose names. Multiple words should be separated +with an underscore.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">fileproperties</span><span class="p">()</span> <span class="c1">// not descriptive and needs underscore separator</span> +<span class="k">function</span> <span class="nf">fileProperties</span><span class="p">()</span> <span class="c1">// not descriptive and uses CamelCase</span> +<span class="k">function</span> <span class="nf">getfileproperties</span><span class="p">()</span> <span class="c1">// Better! But still missing underscore separator</span> +<span class="k">function</span> <span class="nf">getFileProperties</span><span class="p">()</span> <span class="c1">// uses CamelCase</span> +<span class="k">function</span> <span class="nf">get_the_file_properties_from_the_file</span><span class="p">()</span> <span class="c1">// wordy</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">get_file_properties</span><span class="p">()</span> <span class="c1">// descriptive, underscore separator, and all lowercase letters</span> +</pre></div> +</div> +</div> +<div class="section" id="variable-names"> +<h2><a class="toc-backref" href="#id8">Variable Names</a><a class="headerlink" href="#variable-names" title="Permalink to this headline">¶</a></h2> +<p>The guidelines for variable naming are very similar to those used for +class methods. Variables should contain only lowercase letters, +use underscore separators, and be reasonably named to indicate their +purpose and contents. Very short, non-word variables should only be used +as iterators in for() loops.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$j</span> <span class="o">=</span> <span class="s1">'foo'</span><span class="p">;</span> <span class="c1">// single letter variables should only be used in for() loops</span> +<span class="nv">$Str</span> <span class="c1">// contains uppercase letters</span> +<span class="nv">$bufferedText</span> <span class="c1">// uses CamelCasing, and could be shortened without losing semantic meaning</span> +<span class="nv">$groupid</span> <span class="c1">// multiple words, needs underscore separator</span> +<span class="nv">$name_of_last_city_used</span> <span class="c1">// too long</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="p">(</span><span class="nv">$j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nv">$j</span> <span class="o"><</span> <span class="mi">10</span><span class="p">;</span> <span class="nv">$j</span><span class="o">++</span><span class="p">)</span> +<span class="nv">$str</span> +<span class="nv">$buffer</span> +<span class="nv">$group_id</span> +<span class="nv">$last_city</span> +</pre></div> +</div> +</div> +<div class="section" id="commenting"> +<h2><a class="toc-backref" href="#id9">Commenting</a><a class="headerlink" href="#commenting" title="Permalink to this headline">¶</a></h2> +<p>In general, code should be commented prolifically. It not only helps +describe the flow and intent of the code for less experienced +programmers, but can prove invaluable when returning to your own code +months down the line. There is not a required format for comments, but +the following are recommended.</p> +<p><a class="reference external" href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock">DocBlock</a> +style comments preceding class, method, and property declarations so they can be +picked up by IDEs:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="sd">/**</span> +<span class="sd"> * Super Class</span> +<span class="sd"> *</span> +<span class="sd"> * @package Package Name</span> +<span class="sd"> * @subpackage Subpackage</span> +<span class="sd"> * @category Category</span> +<span class="sd"> * @author Author Name</span> +<span class="sd"> * @link http://example.com</span> +<span class="sd"> */</span> +<span class="k">class</span> <span class="nc">Super_class</span> <span class="p">{</span> +</pre></div> +</div> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="sd">/**</span> +<span class="sd"> * Encodes string for use in XML</span> +<span class="sd"> *</span> +<span class="sd"> * @param string $str Input string</span> +<span class="sd"> * @return string</span> +<span class="sd"> */</span> +<span class="k">function</span> <span class="nf">xml_encode</span><span class="p">(</span><span class="nv">$str</span><span class="p">)</span> +</pre></div> +</div> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="sd">/**</span> +<span class="sd"> * Data for class manipulation</span> +<span class="sd"> *</span> +<span class="sd"> * @var array</span> +<span class="sd"> */</span> +<span class="k">public</span> <span class="nv">$data</span> <span class="o">=</span> <span class="k">array</span><span class="p">();</span> +</pre></div> +</div> +<p>Use single line comments within code, leaving a blank line between large +comment blocks and code.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// break up the string by newlines</span> +<span class="nv">$parts</span> <span class="o">=</span> <span class="nb">explode</span><span class="p">(</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span> <span class="nv">$str</span><span class="p">);</span> + +<span class="c1">// A longer comment that needs to give greater detail on what is</span> +<span class="c1">// occurring and why can use multiple single-line comments. Try to</span> +<span class="c1">// keep the width reasonable, around 70 characters is the easiest to</span> +<span class="c1">// read. Don't hesitate to link to permanent external resources</span> +<span class="c1">// that may provide greater detail:</span> +<span class="c1">//</span> +<span class="c1">// http://example.com/information_about_something/in_particular/</span> + +<span class="nv">$parts</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">foo</span><span class="p">(</span><span class="nv">$parts</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="constants"> +<h2><a class="toc-backref" href="#id10">Constants</a><a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h2> +<p>Constants follow the same guidelines as do variables, except constants +should always be fully uppercase. <em>Always use CodeIgniter constants when +appropriate, i.e. SLASH, LD, RD, PATH_CACHE, etc.</em></p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">myConstant</span> <span class="c1">// missing underscore separator and not fully uppercase</span> +<span class="nx">N</span> <span class="c1">// no single-letter constants</span> +<span class="nx">S_C_VER</span> <span class="c1">// not descriptive</span> +<span class="nv">$str</span> <span class="o">=</span> <span class="nb">str_replace</span><span class="p">(</span><span class="s1">'{foo}'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="nv">$str</span><span class="p">);</span> <span class="c1">// should use LD and RD constants</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">MY_CONSTANT</span> +<span class="nx">NEWLINE</span> +<span class="nx">SUPER_CLASS_VERSION</span> +<span class="nv">$str</span> <span class="o">=</span> <span class="nb">str_replace</span><span class="p">(</span><span class="nx">LD</span><span class="o">.</span><span class="s1">'foo'</span><span class="o">.</span><span class="nx">RD</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="nv">$str</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="true-false-and-null"> +<h2><a class="toc-backref" href="#id11">TRUE, FALSE, and NULL</a><a class="headerlink" href="#true-false-and-null" title="Permalink to this headline">¶</a></h2> +<p><strong>TRUE</strong>, <strong>FALSE</strong>, and <strong>NULL</strong> keywords should always be fully +uppercase.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="o">==</span> <span class="k">true</span><span class="p">)</span> +<span class="nv">$bar</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span> +<span class="k">function</span> <span class="nf">foo</span><span class="p">(</span><span class="nv">$bar</span> <span class="o">=</span> <span class="k">null</span><span class="p">)</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="o">==</span> <span class="k">TRUE</span><span class="p">)</span> +<span class="nv">$bar</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">;</span> +<span class="k">function</span> <span class="nf">foo</span><span class="p">(</span><span class="nv">$bar</span> <span class="o">=</span> <span class="k">NULL</span><span class="p">)</span> +</pre></div> +</div> +</div> +<div class="section" id="logical-operators"> +<h2><a class="toc-backref" href="#id12">Logical Operators</a><a class="headerlink" href="#logical-operators" title="Permalink to this headline">¶</a></h2> +<p>Use of the <code class="docutils literal"><span class="pre">||</span></code> “or” comparison operator is discouraged, as its clarity +on some output devices is low (looking like the number 11, for instance). +<code class="docutils literal"><span class="pre">&&</span></code> is preferred over <code class="docutils literal"><span class="pre">AND</span></code> but either are acceptable, and a space should +always precede and follow <code class="docutils literal"><span class="pre">!</span></code>.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="o">||</span> <span class="nv">$bar</span><span class="p">)</span> +<span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="k">AND</span> <span class="nv">$bar</span><span class="p">)</span> <span class="c1">// okay but not recommended for common syntax highlighting applications</span> +<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nv">$foo</span><span class="p">)</span> +<span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="nb">is_array</span><span class="p">(</span><span class="nv">$foo</span><span class="p">))</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="k">OR</span> <span class="nv">$bar</span><span class="p">)</span> +<span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="o">&&</span> <span class="nv">$bar</span><span class="p">)</span> <span class="c1">// recommended</span> +<span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$foo</span><span class="p">)</span> +<span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nb">is_array</span><span class="p">(</span><span class="nv">$foo</span><span class="p">))</span> +</pre></div> +</div> +</div> +<div class="section" id="comparing-return-values-and-typecasting"> +<h2><a class="toc-backref" href="#id13">Comparing Return Values and Typecasting</a><a class="headerlink" href="#comparing-return-values-and-typecasting" title="Permalink to this headline">¶</a></h2> +<p>Some PHP functions return FALSE on failure, but may also have a valid +return value of “” or 0, which would evaluate to FALSE in loose +comparisons. Be explicit by comparing the variable type when using these +return values in conditionals to ensure the return value is indeed what +you expect, and not a value that has an equivalent loose-type +evaluation.</p> +<p>Use the same stringency in returning and checking your own variables. +Use <strong>===</strong> and <strong>!==</strong> as necessary.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// If 'foo' is at the beginning of the string, strpos will return a 0,</span> +<span class="c1">// resulting in this conditional evaluating as TRUE</span> +<span class="k">if</span> <span class="p">(</span><span class="nb">strpos</span><span class="p">(</span><span class="nv">$str</span><span class="p">,</span> <span class="s1">'foo'</span><span class="p">)</span> <span class="o">==</span> <span class="k">FALSE</span><span class="p">)</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nb">strpos</span><span class="p">(</span><span class="nv">$str</span><span class="p">,</span> <span class="s1">'foo'</span><span class="p">)</span> <span class="o">===</span> <span class="k">FALSE</span><span class="p">)</span> +</pre></div> +</div> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">build_string</span><span class="p">(</span><span class="nv">$str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">if</span> <span class="p">(</span><span class="nv">$str</span> <span class="o">==</span> <span class="s2">""</span><span class="p">)</span> <span class="c1">// uh-oh! What if FALSE or the integer 0 is passed as an argument?</span> + <span class="p">{</span> + + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">build_string</span><span class="p">(</span><span class="nv">$str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">if</span> <span class="p">(</span><span class="nv">$str</span> <span class="o">===</span> <span class="s2">""</span><span class="p">)</span> + <span class="p">{</span> + + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>See also information regarding <a class="reference external" href="http://php.net/manual/en/language.types.type-juggling.php#language.types.typecasting">typecasting</a>, +which can be quite useful. Typecasting has a slightly different effect +which may be desirable. When casting a variable as a string, for +instance, NULL and boolean FALSE variables become empty strings, 0 (and +other numbers) become strings of digits, and boolean TRUE becomes “1”:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$str</span> <span class="o">=</span> <span class="p">(</span><span class="nx">string</span><span class="p">)</span> <span class="nv">$str</span><span class="p">;</span> <span class="c1">// cast $str as a string</span> +</pre></div> +</div> +</div> +<div class="section" id="debugging-code"> +<h2><a class="toc-backref" href="#id14">Debugging Code</a><a class="headerlink" href="#debugging-code" title="Permalink to this headline">¶</a></h2> +<p>Do not leave debugging code in your submissions, even when commented out. +Things such as <code class="docutils literal"><span class="pre">var_dump()</span></code>, <code class="docutils literal"><span class="pre">print_r()</span></code>, <code class="docutils literal"><span class="pre">die()</span></code>/<code class="docutils literal"><span class="pre">exit()</span></code> should not be included +in your code unless it serves a specific purpose other than debugging.</p> +</div> +<div class="section" id="whitespace-in-files"> +<h2><a class="toc-backref" href="#id15">Whitespace in Files</a><a class="headerlink" href="#whitespace-in-files" title="Permalink to this headline">¶</a></h2> +<p>No whitespace can precede the opening PHP tag or follow the closing PHP +tag. Output is buffered, so whitespace in your files can cause output to +begin before CodeIgniter outputs its content, leading to errors and an +inability for CodeIgniter to send proper headers.</p> +</div> +<div class="section" id="compatibility"> +<h2><a class="toc-backref" href="#id16">Compatibility</a><a class="headerlink" href="#compatibility" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter recommends PHP 5.6 or newer to be used, but it should be +compatible with PHP 5.3.7. Your code must either be compatible with this +requirement, provide a suitable fallback, or be an optional feature that +dies quietly without affecting a user’s application.</p> +<p>Additionally, do not use PHP functions that require non-default libraries +to be installed unless your code contains an alternative method when the +function is not available.</p> +</div> +<div class="section" id="one-file-per-class"> +<h2><a class="toc-backref" href="#id17">One File per Class</a><a class="headerlink" href="#one-file-per-class" title="Permalink to this headline">¶</a></h2> +<p>Use separate files for each class, unless the classes are <em>closely related</em>. +An example of a CodeIgniter file that contains multiple classes is the +Xmlrpc library file.</p> +</div> +<div class="section" id="whitespace"> +<h2><a class="toc-backref" href="#id18">Whitespace</a><a class="headerlink" href="#whitespace" title="Permalink to this headline">¶</a></h2> +<p>Use tabs for whitespace in your code, not spaces. This may seem like a +small thing, but using tabs instead of whitespace allows the developer +looking at your code to have indentation at levels that they prefer and +customize in whatever application they use. And as a side benefit, it +results in (slightly) more compact files, storing one tab character +versus, say, four space characters.</p> +</div> +<div class="section" id="line-breaks"> +<h2><a class="toc-backref" href="#id19">Line Breaks</a><a class="headerlink" href="#line-breaks" title="Permalink to this headline">¶</a></h2> +<p>Files must be saved with Unix line breaks. This is more of an issue for +developers who work in Windows, but in any case ensure that your text +editor is setup to save files with Unix line breaks.</p> +</div> +<div class="section" id="code-indenting"> +<h2><a class="toc-backref" href="#id20">Code Indenting</a><a class="headerlink" href="#code-indenting" title="Permalink to this headline">¶</a></h2> +<p>Use Allman style indenting. With the exception of Class declarations, +braces are always placed on a line by themselves, and indented at the +same level as the control statement that “owns” them.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">foo</span><span class="p">(</span><span class="nv">$bar</span><span class="p">)</span> <span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> + +<span class="k">foreach</span> <span class="p">(</span><span class="nv">$arr</span> <span class="k">as</span> <span class="nv">$key</span> <span class="o">=></span> <span class="nv">$val</span><span class="p">)</span> <span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> + +<span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="o">==</span> <span class="nv">$bar</span><span class="p">)</span> <span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> <span class="k">else</span> <span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> + +<span class="k">for</span> <span class="p">(</span><span class="nv">$i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nv">$i</span> <span class="o"><</span> <span class="mi">10</span><span class="p">;</span> <span class="nv">$i</span><span class="o">++</span><span class="p">)</span> + <span class="p">{</span> + <span class="k">for</span> <span class="p">(</span><span class="nv">$j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nv">$j</span> <span class="o"><</span> <span class="mi">10</span><span class="p">;</span> <span class="nv">$j</span><span class="o">++</span><span class="p">)</span> + <span class="p">{</span> + <span class="c1">// ...</span> + <span class="p">}</span> + <span class="p">}</span> + +<span class="k">try</span> <span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> +<span class="k">catch</span><span class="p">()</span> <span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">foo</span><span class="p">(</span><span class="nv">$bar</span><span class="p">)</span> +<span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> + +<span class="k">foreach</span> <span class="p">(</span><span class="nv">$arr</span> <span class="k">as</span> <span class="nv">$key</span> <span class="o">=></span> <span class="nv">$val</span><span class="p">)</span> +<span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> + +<span class="k">if</span> <span class="p">(</span><span class="nv">$foo</span> <span class="o">==</span> <span class="nv">$bar</span><span class="p">)</span> +<span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> +<span class="k">else</span> +<span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> + +<span class="k">for</span> <span class="p">(</span><span class="nv">$i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nv">$i</span> <span class="o"><</span> <span class="mi">10</span><span class="p">;</span> <span class="nv">$i</span><span class="o">++</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">for</span> <span class="p">(</span><span class="nv">$j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nv">$j</span> <span class="o"><</span> <span class="mi">10</span><span class="p">;</span> <span class="nv">$j</span><span class="o">++</span><span class="p">)</span> + <span class="p">{</span> + <span class="c1">// ...</span> + <span class="p">}</span> +<span class="p">}</span> + +<span class="k">try</span> +<span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> +<span class="k">catch</span><span class="p">()</span> +<span class="p">{</span> + <span class="c1">// ...</span> +<span class="p">}</span> +</pre></div> +</div> +</div> +<div class="section" id="bracket-and-parenthetic-spacing"> +<h2><a class="toc-backref" href="#id21">Bracket and Parenthetic Spacing</a><a class="headerlink" href="#bracket-and-parenthetic-spacing" title="Permalink to this headline">¶</a></h2> +<p>In general, parenthesis and brackets should not use any additional +spaces. The exception is that a space should always follow PHP control +structures that accept arguments with parenthesis (declare, do-while, +elseif, for, foreach, if, switch, while), to help distinguish them from +functions and increase readability.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$arr</span><span class="p">[</span> <span class="nv">$foo</span> <span class="p">]</span> <span class="o">=</span> <span class="s1">'foo'</span><span class="p">;</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$arr</span><span class="p">[</span><span class="nv">$foo</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'foo'</span><span class="p">;</span> <span class="c1">// no spaces around array keys</span> +</pre></div> +</div> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">foo</span> <span class="p">(</span> <span class="nv">$bar</span> <span class="p">)</span> +<span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">foo</span><span class="p">(</span><span class="nv">$bar</span><span class="p">)</span> <span class="c1">// no spaces around parenthesis in function declarations</span> +<span class="p">{</span> + +<span class="p">}</span> +</pre></div> +</div> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">foreach</span><span class="p">(</span> <span class="nv">$query</span><span class="o">-></span><span class="na">result</span><span class="p">()</span> <span class="k">as</span> <span class="nv">$row</span> <span class="p">)</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">foreach</span> <span class="p">(</span><span class="nv">$query</span><span class="o">-></span><span class="na">result</span><span class="p">()</span> <span class="k">as</span> <span class="nv">$row</span><span class="p">)</span> <span class="c1">// single space following PHP control structures, but not in interior parenthesis</span> +</pre></div> +</div> +</div> +<div class="section" id="localized-text"> +<h2><a class="toc-backref" href="#id22">Localized Text</a><a class="headerlink" href="#localized-text" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter libraries should take advantage of corresponding language files +whenever possible.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">return</span> <span class="s2">"Invalid Selection"</span><span class="p">;</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">return</span> <span class="nv">$this</span><span class="o">-></span><span class="na">lang</span><span class="o">-></span><span class="na">line</span><span class="p">(</span><span class="s1">'invalid_selection'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="private-methods-and-variables"> +<h2><a class="toc-backref" href="#id23">Private Methods and Variables</a><a class="headerlink" href="#private-methods-and-variables" title="Permalink to this headline">¶</a></h2> +<p>Methods and variables that are only accessed internally, +such as utility and helper functions that your public methods use for +code abstraction, should be prefixed with an underscore.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">public</span> <span class="k">function</span> <span class="nf">convert_text</span><span class="p">()</span> +<span class="k">private</span> <span class="k">function</span> <span class="nf">_convert_text</span><span class="p">()</span> +</pre></div> +</div> +</div> +<div class="section" id="php-errors"> +<h2><a class="toc-backref" href="#id24">PHP Errors</a><a class="headerlink" href="#php-errors" title="Permalink to this headline">¶</a></h2> +<p>Code must run error free and not rely on warnings and notices to be +hidden to meet this requirement. For instance, never access a variable +that you did not set yourself (such as <code class="docutils literal"><span class="pre">$_POST</span></code> array keys) without first +checking to see that it <code class="docutils literal"><span class="pre">isset()</span></code>.</p> +<p>Make sure that your dev environment has error reporting enabled +for ALL users, and that display_errors is enabled in the PHP +environment. You can check this setting with:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nb">ini_get</span><span class="p">(</span><span class="s1">'display_errors'</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">exit</span> <span class="s2">"Enabled"</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +<p>On some servers where <em>display_errors</em> is disabled, and you do not have +the ability to change this in the php.ini, you can often enable it with:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nb">ini_set</span><span class="p">(</span><span class="s1">'display_errors'</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Setting the <a class="reference external" href="http://php.net/manual/en/errorfunc.configuration.php#ini.display-errors">display_errors</a> +setting with <code class="docutils literal"><span class="pre">ini_set()</span></code> at runtime is not identical to having +it enabled in the PHP environment. Namely, it will not have any +effect if the script has fatal errors.</p> +</div> +</div> +<div class="section" id="short-open-tags"> +<h2><a class="toc-backref" href="#id25">Short Open Tags</a><a class="headerlink" href="#short-open-tags" title="Permalink to this headline">¶</a></h2> +<p>Always use full PHP opening tags, in case a server does not have +<em>short_open_tag</em> enabled.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span> <span class="k">echo</span> <span class="nv">$foo</span><span class="p">;</span> <span class="cp">?></span> + +<span class="cp"><?</span><span class="o">=</span><span class="nv">$foo</span><span class="cp">?></span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nv">$foo</span><span class="p">;</span> <span class="cp">?></span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">PHP 5.4 will always have the <strong><?=</strong> tag available.</p> +</div> +</div> +<div class="section" id="one-statement-per-line"> +<h2><a class="toc-backref" href="#id26">One Statement Per Line</a><a class="headerlink" href="#one-statement-per-line" title="Permalink to this headline">¶</a></h2> +<p>Never combine statements on one line.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$foo</span> <span class="o">=</span> <span class="s1">'this'</span><span class="p">;</span> <span class="nv">$bar</span> <span class="o">=</span> <span class="s1">'that'</span><span class="p">;</span> <span class="nv">$bat</span> <span class="o">=</span> <span class="nb">str_replace</span><span class="p">(</span><span class="nv">$foo</span><span class="p">,</span> <span class="nv">$bar</span><span class="p">,</span> <span class="nv">$bag</span><span class="p">);</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$foo</span> <span class="o">=</span> <span class="s1">'this'</span><span class="p">;</span> +<span class="nv">$bar</span> <span class="o">=</span> <span class="s1">'that'</span><span class="p">;</span> +<span class="nv">$bat</span> <span class="o">=</span> <span class="nb">str_replace</span><span class="p">(</span><span class="nv">$foo</span><span class="p">,</span> <span class="nv">$bar</span><span class="p">,</span> <span class="nv">$bag</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="strings"> +<h2><a class="toc-backref" href="#id27">Strings</a><a class="headerlink" href="#strings" title="Permalink to this headline">¶</a></h2> +<p>Always use single quoted strings unless you need variables parsed, and +in cases where you do need variables parsed, use braces to prevent +greedy token parsing. You may also use double-quoted strings if the +string contains single quotes, so you do not have to use escape +characters.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="s2">"My String"</span> <span class="c1">// no variable parsing, so no use for double quotes</span> +<span class="s2">"My string </span><span class="si">$foo</span><span class="s2">"</span> <span class="c1">// needs braces</span> +<span class="s1">'SELECT foo FROM bar WHERE baz = \'bag\''</span> <span class="c1">// ugly</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="s1">'My String'</span> +<span class="s2">"My string </span><span class="si">{</span><span class="nv">$foo</span><span class="si">}</span><span class="s2">"</span> +<span class="s2">"SELECT foo FROM bar WHERE baz = 'bag'"</span> +</pre></div> +</div> +</div> +<div class="section" id="sql-queries"> +<h2><a class="toc-backref" href="#id28">SQL Queries</a><a class="headerlink" href="#sql-queries" title="Permalink to this headline">¶</a></h2> +<p>SQL keywords are always capitalized: SELECT, INSERT, UPDATE, WHERE, +AS, JOIN, ON, IN, etc.</p> +<p>Break up long queries into multiple lines for legibility, preferably +breaking for each clause.</p> +<p><strong>INCORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// keywords are lowercase and query is too long for</span> +<span class="c1">// a single line (... indicates continuation of line)</span> +<span class="nv">$query</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="s2">"select foo, bar, baz, foofoo, foobar as raboof, foobaz from exp_pre_email_addresses</span> +<span class="s2">...where foo != 'oof' and baz != 'zab' order by foobaz limit 5, 100"</span><span class="p">);</span> +</pre></div> +</div> +<p><strong>CORRECT</strong>:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$query</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="s2">"SELECT foo, bar, baz, foofoo, foobar AS raboof, foobaz</span> +<span class="s2"> FROM exp_pre_email_addresses</span> +<span class="s2"> WHERE foo != 'oof'</span> +<span class="s2"> AND baz != 'zab'</span> +<span class="s2"> ORDER BY foobaz</span> +<span class="s2"> LIMIT 5, 100"</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="default-function-arguments"> +<h2><a class="toc-backref" href="#id29">Default Function Arguments</a><a class="headerlink" href="#default-function-arguments" title="Permalink to this headline">¶</a></h2> +<p>Whenever appropriate, provide function argument defaults, which helps +prevent PHP errors with mistaken calls and provides common fallback +values which can save a few lines of code. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">function</span> <span class="nf">foo</span><span class="p">(</span><span class="nv">$bar</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$baz</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">)</span> +</pre></div> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="../libraries/index.html" class="btn btn-neutral float-right" title="Libraries">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="security.html" class="btn btn-neutral" title="Security"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/urls.html b/user_guide/general/urls.html new file mode 100644 index 000000000..7539dfef8 --- /dev/null +++ b/user_guide/general/urls.html @@ -0,0 +1,597 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>CodeIgniter URLs — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Controllers" href="controllers.html"/> + <link rel="prev" title="General Topics" href="index.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2 current"><a class="current reference internal" href="#">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2 current"><a class="current reference internal" href="#">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>CodeIgniter URLs</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="codeigniter-urls"> +<h1>CodeIgniter URLs<a class="headerlink" href="#codeigniter-urls" title="Permalink to this headline">¶</a></h1> +<p>By default, URLs in CodeIgniter are designed to be search-engine and +human friendly. Rather than using the standard “query string” approach +to URLs that is synonymous with dynamic systems, CodeIgniter uses a +<strong>segment-based</strong> approach:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">news</span><span class="o">/</span><span class="nx">article</span><span class="o">/</span><span class="nx">my_article</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Query string URLs can be optionally enabled, as described +below.</p> +</div> +<div class="section" id="uri-segments"> +<h2>URI Segments<a class="headerlink" href="#uri-segments" title="Permalink to this headline">¶</a></h2> +<p>The segments in the URL, in following with the Model-View-Controller +approach, usually represent:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">class</span><span class="o">/</span><span class="nx">function</span><span class="o">/</span><span class="nx">ID</span> +</pre></div> +</div> +<ol class="arabic simple"> +<li>The first segment represents the controller <strong>class</strong> that should be +invoked.</li> +<li>The second segment represents the class <strong>function</strong>, or method, that +should be called.</li> +<li>The third, and any additional segments, represent the ID and any +variables that will be passed to the controller.</li> +</ol> +<p>The <a class="reference internal" href="../libraries/uri.html"><span class="doc">URI Library</span></a> and the <a class="reference internal" href="../helpers/url_helper.html"><span class="doc">URL Helper</span></a> contain functions that make it easy to work +with your URI data. In addition, your URLs can be remapped using the +<a class="reference internal" href="routing.html"><span class="doc">URI Routing</span></a> feature for more flexibility.</p> +</div> +<div class="section" id="removing-the-index-php-file"> +<h2>Removing the index.php file<a class="headerlink" href="#removing-the-index-php-file" title="Permalink to this headline">¶</a></h2> +<p>By default, the <strong>index.php</strong> file will be included in your URLs:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">news</span><span class="o">/</span><span class="nx">article</span><span class="o">/</span><span class="nx">my_article</span> +</pre></div> +</div> +<p>If your Apache server has <em>mod_rewrite</em> enabled, you can easily remove this +file by using a .htaccess file with some simple rules. Here is an example +of such a file, using the “negative” method in which everything is redirected +except the specified items:</p> +<div class="highlight-apache"><div class="highlight"><pre><span></span><span class="nb">RewriteEngine</span> <span class="k">On</span> +<span class="nb">RewriteCond</span> %{REQUEST_FILENAME} !-f +<span class="nb">RewriteCond</span> %{REQUEST_FILENAME} !-d +<span class="nb">RewriteRule</span> ^(.*)$ index.php/$1 [L] +</pre></div> +</div> +<p>In the above example, any HTTP request other than those for existing +directories and existing files is treated as a request for your index.php file.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">These specific rules might not work for all server configurations.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Make sure to also exclude from the above rule any assets that you +might need to be accessible from the outside world.</p> +</div> +</div> +<div class="section" id="adding-a-url-suffix"> +<h2>Adding a URL Suffix<a class="headerlink" href="#adding-a-url-suffix" title="Permalink to this headline">¶</a></h2> +<p>In your <strong>config/config.php</strong> file you can specify a suffix that will be +added to all URLs generated by CodeIgniter. For example, if a URL is +this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">products</span><span class="o">/</span><span class="nx">view</span><span class="o">/</span><span class="nx">shoes</span> +</pre></div> +</div> +<p>You can optionally add a suffix, like <strong>.html,</strong> making the page appear to +be of a certain type:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">products</span><span class="o">/</span><span class="nx">view</span><span class="o">/</span><span class="nx">shoes</span><span class="o">.</span><span class="nx">html</span> +</pre></div> +</div> +</div> +<div class="section" id="enabling-query-strings"> +<h2>Enabling Query Strings<a class="headerlink" href="#enabling-query-strings" title="Permalink to this headline">¶</a></h2> +<p>In some cases you might prefer to use query strings URLs:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">?</span><span class="nx">c</span><span class="o">=</span><span class="nx">products</span><span class="o">&</span><span class="nx">m</span><span class="o">=</span><span class="nx">view</span><span class="o">&</span><span class="nx">id</span><span class="o">=</span><span class="mi">345</span> +</pre></div> +</div> +<p>CodeIgniter optionally supports this capability, which can be enabled in +your <strong>application/config.php</strong> file. If you open your config file you’ll +see these items:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$config</span><span class="p">[</span><span class="s1">'enable_query_strings'</span><span class="p">]</span> <span class="o">=</span> <span class="k">FALSE</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'controller_trigger'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'c'</span><span class="p">;</span> +<span class="nv">$config</span><span class="p">[</span><span class="s1">'function_trigger'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'m'</span><span class="p">;</span> +</pre></div> +</div> +<p>If you change “enable_query_strings” to TRUE this feature will become +active. Your controllers and functions will then be accessible using the +“trigger” words you’ve set to invoke your controllers and methods:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">?</span><span class="nx">c</span><span class="o">=</span><span class="nx">controller</span><span class="o">&</span><span class="nx">m</span><span class="o">=</span><span class="nx">method</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you are using query strings you will have to build your own +URLs, rather than utilizing the URL helpers (and other helpers +that generate URLs, like some of the form helpers) as these are +designed to work with segment based URLs.</p> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="controllers.html" class="btn btn-neutral float-right" title="Controllers">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="index.html" class="btn btn-neutral" title="General Topics"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/views.html b/user_guide/general/views.html new file mode 100644 index 000000000..f0ae7e027 --- /dev/null +++ b/user_guide/general/views.html @@ -0,0 +1,704 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Views — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="up" title="General Topics" href="index.html"/> + <link rel="next" title="Models" href="models.html"/> + <link rel="prev" title="Reserved Names" href="reserved_names.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul> +<li class="toctree-l1"><a class="reference internal" href="welcome.html">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">General Topics</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">General Topics</a> »</li> + + <li>Views</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="views"> +<h1>Views<a class="headerlink" href="#views" title="Permalink to this headline">¶</a></h1> +<p>A view is simply a web page, or a page fragment, like a header, footer, +sidebar, etc. In fact, views can flexibly be embedded within other views +(within other views, etc., etc.) if you need this type of hierarchy.</p> +<p>Views are never called directly, they must be loaded by a +<a class="reference internal" href="controllers.html"><span class="doc">controller</span></a>. Remember that in an MVC framework, the +Controller acts as the traffic cop, so it is responsible for fetching a +particular view. If you have not read the +<a class="reference internal" href="controllers.html"><span class="doc">Controllers</span></a> page you should do so before +continuing.</p> +<p>Using the example controller you created in the +<a class="reference internal" href="controllers.html"><span class="doc">controller</span></a> page, let’s add a view to it.</p> +<div class="section" id="creating-a-view"> +<h2>Creating a View<a class="headerlink" href="#creating-a-view" title="Permalink to this headline">¶</a></h2> +<p>Using your text editor, create a file called blogview.php, and put this +in it:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">html</span><span class="o">></span> +<span class="o"><</span><span class="nx">head</span><span class="o">></span> + <span class="o"><</span><span class="nx">title</span><span class="o">></span><span class="nx">My</span> <span class="nx">Blog</span><span class="o"></</span><span class="nx">title</span><span class="o">></span> +<span class="o"></</span><span class="nx">head</span><span class="o">></span> +<span class="o"><</span><span class="nx">body</span><span class="o">></span> + <span class="o"><</span><span class="nx">h1</span><span class="o">></span><span class="nx">Welcome</span> <span class="nx">to</span> <span class="nx">my</span> <span class="nx">Blog</span><span class="o">!</</span><span class="nx">h1</span><span class="o">></span> +<span class="o"></</span><span class="nx">body</span><span class="o">></span> +<span class="o"></</span><span class="nx">html</span><span class="o">></span> +</pre></div> +</div> +<p>Then save the file in your <em>application/views/</em> directory.</p> +</div> +<div class="section" id="loading-a-view"> +<h2>Loading a View<a class="headerlink" href="#loading-a-view" title="Permalink to this headline">¶</a></h2> +<p>To load a particular view file you will use the following method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'name'</span><span class="p">);</span> +</pre></div> +</div> +<p>Where name is the name of your view file.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The .php file extension does not need to be specified +unless you use something other than .php.</p> +</div> +<p>Now, open the controller file you made earlier called Blog.php, and +replace the echo statement with the view loading method:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'blogview'</span><span class="p">);</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>If you visit your site using the URL you did earlier you should see your +new view. The URL was similar to this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">index</span><span class="o">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span> +</pre></div> +</div> +</div> +<div class="section" id="loading-multiple-views"> +<h2>Loading multiple views<a class="headerlink" href="#loading-multiple-views" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter will intelligently handle multiple calls to +<code class="docutils literal"><span class="pre">$this->load->view()</span></code> from within a controller. If more than one call +happens they will be appended together. For example, you may wish to +have a header view, a menu view, a content view, and a footer view. That +might look something like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> + +<span class="k">class</span> <span class="nc">Page</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$data</span><span class="p">[</span><span class="s1">'page_title'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'Your title'</span><span class="p">;</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'header'</span><span class="p">);</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'menu'</span><span class="p">);</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'content'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'footer'</span><span class="p">);</span> + <span class="p">}</span> + +<span class="p">}</span> +</pre></div> +</div> +<p>In the example above, we are using “dynamically added data”, which you +will see below.</p> +</div> +<div class="section" id="storing-views-within-sub-directories"> +<h2>Storing Views within Sub-directories<a class="headerlink" href="#storing-views-within-sub-directories" title="Permalink to this headline">¶</a></h2> +<p>Your view files can also be stored within sub-directories if you prefer +that type of organization. When doing so you will need to include the +directory name loading the view. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'directory_name/file_name'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="adding-dynamic-data-to-the-view"> +<h2>Adding Dynamic Data to the View<a class="headerlink" href="#adding-dynamic-data-to-the-view" title="Permalink to this headline">¶</a></h2> +<p>Data is passed from the controller to the view by way of an <strong>array</strong> or +an <strong>object</strong> in the second parameter of the view loading method. Here +is an example using an array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$data</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'title'</span> <span class="o">=></span> <span class="s1">'My Title'</span><span class="p">,</span> + <span class="s1">'heading'</span> <span class="o">=></span> <span class="s1">'My Heading'</span><span class="p">,</span> + <span class="s1">'message'</span> <span class="o">=></span> <span class="s1">'My Message'</span> +<span class="p">);</span> + +<span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'blogview'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> +</pre></div> +</div> +<p>And here’s an example using an object:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$data</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Someclass</span><span class="p">();</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'blogview'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you use an object, the class variables will be turned +into array elements.</p> +</div> +<p>Let’s try it with your controller file. Open it add this code:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$data</span><span class="p">[</span><span class="s1">'title'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"My Real Title"</span><span class="p">;</span> + <span class="nv">$data</span><span class="p">[</span><span class="s1">'heading'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"My Real Heading"</span><span class="p">;</span> + + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'blogview'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Now open your view file and change the text to variables that correspond +to the array keys in your data:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">html</span><span class="o">></span> +<span class="o"><</span><span class="nx">head</span><span class="o">></span> + <span class="o"><</span><span class="nx">title</span><span class="o">><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nv">$title</span><span class="p">;</span><span class="cp">?></span><span class="p"></</span><span class="nt">title</span><span class="p">></span> +<span class="p"></</span><span class="nt">head</span><span class="p">></span> +<span class="p"><</span><span class="nt">body</span><span class="p">></span> + <span class="p"><</span><span class="nt">h1</span><span class="p">></span><span class="cp"><?php</span> <span class="k">echo</span> <span class="nv">$heading</span><span class="p">;</span><span class="cp">?></span><span class="p"></</span><span class="nt">h1</span><span class="p">></span> +<span class="p"></</span><span class="nt">body</span><span class="p">></span> +<span class="p"></</span><span class="nt">html</span><span class="p">></span> +</pre></div> +</div> +<p>Then load the page at the URL you’ve been using and you should see the +variables replaced.</p> +</div> +<div class="section" id="creating-loops"> +<h2>Creating Loops<a class="headerlink" href="#creating-loops" title="Permalink to this headline">¶</a></h2> +<p>The data array you pass to your view files is not limited to simple +variables. You can pass multi dimensional arrays, which can be looped to +generate multiple rows. For example, if you pull data from your database +it will typically be in the form of a multi-dimensional array.</p> +<p>Here’s a simple example. Add this to your controller:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><?</span><span class="nx">php</span> +<span class="k">class</span> <span class="nc">Blog</span> <span class="k">extends</span> <span class="nx">CI_Controller</span> <span class="p">{</span> + + <span class="k">public</span> <span class="k">function</span> <span class="nf">index</span><span class="p">()</span> + <span class="p">{</span> + <span class="nv">$data</span><span class="p">[</span><span class="s1">'todo_list'</span><span class="p">]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'Clean House'</span><span class="p">,</span> <span class="s1">'Call Mom'</span><span class="p">,</span> <span class="s1">'Run Errands'</span><span class="p">);</span> + + <span class="nv">$data</span><span class="p">[</span><span class="s1">'title'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"My Real Title"</span><span class="p">;</span> + <span class="nv">$data</span><span class="p">[</span><span class="s1">'heading'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"My Real Heading"</span><span class="p">;</span> + + <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'blogview'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> + <span class="p">}</span> +<span class="p">}</span> +</pre></div> +</div> +<p>Now open your view file and create a loop:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">html</span><span class="o">></span> +<span class="o"><</span><span class="nx">head</span><span class="o">></span> + <span class="o"><</span><span class="nx">title</span><span class="o">><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nv">$title</span><span class="p">;</span><span class="cp">?></span><span class="p"></</span><span class="nt">title</span><span class="p">></span> +<span class="p"></</span><span class="nt">head</span><span class="p">></span> +<span class="p"><</span><span class="nt">body</span><span class="p">></span> + <span class="p"><</span><span class="nt">h1</span><span class="p">></span><span class="cp"><?php</span> <span class="k">echo</span> <span class="nv">$heading</span><span class="p">;</span><span class="cp">?></span><span class="p"></</span><span class="nt">h1</span><span class="p">></span> + + <span class="p"><</span><span class="nt">h3</span><span class="p">></span>My Todo List<span class="p"></</span><span class="nt">h3</span><span class="p">></span> + + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="cp"><?php</span> <span class="k">foreach</span> <span class="p">(</span><span class="nv">$todo_list</span> <span class="k">as</span> <span class="nv">$item</span><span class="p">)</span><span class="o">:</span><span class="cp">?></span> + + <span class="p"><</span><span class="nt">li</span><span class="p">></span><span class="cp"><?php</span> <span class="k">echo</span> <span class="nv">$item</span><span class="p">;</span><span class="cp">?></span><span class="p"></</span><span class="nt">li</span><span class="p">></span> + + <span class="cp"><?php</span> <span class="k">endforeach</span><span class="p">;</span><span class="cp">?></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + +<span class="p"></</span><span class="nt">body</span><span class="p">></span> +<span class="p"></</span><span class="nt">html</span><span class="p">></span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">You’ll notice that in the example above we are using PHP’s +alternative syntax. If you are not familiar with it you can read about +it <a class="reference internal" href="alternative_php.html"><span class="doc">here</span></a>.</p> +</div> +</div> +<div class="section" id="returning-views-as-data"> +<h2>Returning views as data<a class="headerlink" href="#returning-views-as-data" title="Permalink to this headline">¶</a></h2> +<p>There is a third <strong>optional</strong> parameter lets you change the behavior of +the method so that it returns data as a string rather than sending it +to your browser. This can be useful if you want to process the data in +some way. If you set the parameter to TRUE (boolean) it will return +data. The default behavior is false, which sends it to your browser. +Remember to assign it to a variable if you want the data returned:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">load</span><span class="o">-></span><span class="na">view</span><span class="p">(</span><span class="s1">'myfile'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +</pre></div> +</div> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="models.html" class="btn btn-neutral float-right" title="Models">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="reserved_names.html" class="btn btn-neutral" title="Reserved Names"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file diff --git a/user_guide/general/welcome.html b/user_guide/general/welcome.html new file mode 100644 index 000000000..683898954 --- /dev/null +++ b/user_guide/general/welcome.html @@ -0,0 +1,520 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Welcome to CodeIgniter — CodeIgniter 3.1.9 documentation</title> + + + + + <link rel="shortcut icon" href="../_static/ci-icon.ico"/> + + + + <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> + + + + + + + + + + <link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" /> + + + + <link rel="index" title="Index" + href="../genindex.html"/> + <link rel="search" title="Search" href="../search.html"/> + <link rel="top" title="CodeIgniter 3.1.9 documentation" href="../index.html"/> + <link rel="next" title="Installation Instructions" href="../installation/index.html"/> + <link rel="prev" title="CodeIgniter User Guide" href="../index.html"/> + + + <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav" role="document"> + + <div id="nav"> + <div id="nav_inner"> + + + + <div id="pulldown-menu" class="ciNav"> + <ul class="current"> +<li class="toctree-l1 current"><a class="current reference internal" href="#">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + </div> + + + </div> +</div> +<div id="nav2"> + <a href="#" id="openToc"> + <img src="data:image/jpeg;base64,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" title="Toggle Table of Contents" alt="Toggle Table of Contents" /> + </a> +</div> + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-nav-search"> + + <a href="../index.html" class="fa fa-home"> CodeIgniter</a> + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + <ul class="current"> +<li class="toctree-l1 current"><a class="current reference internal" href="#">Welcome to CodeIgniter</a></li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> +<li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> +<li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> +<li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer’s Certificate of Origin 1.1</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="styleguide.html">PHP Style Guide</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../libraries/index.html">Libraries</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../libraries/benchmark.html">Benchmarking Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/caching.html">Caching Driver</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/calendar.html">Calendaring Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/cart.html">Shopping Cart Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/config.html">Config Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/email.html">Email Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encrypt.html">Encrypt Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/encryption.html">Encryption Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/file_uploading.html">File Uploading Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/form_validation.html">Form Validation</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/ftp.html">FTP Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/image_lib.html">Image Manipulation Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/input.html">Input Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/javascript.html">Javascript Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/language.html">Language Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/loader.html">Loader Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/migration.html">Migrations Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/output.html">Output Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/pagination.html">Pagination Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/parser.html">Template Parser Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/security.html">Security Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/sessions.html">Session Library</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/table.html">HTML Table Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/trackback.html">Trackback Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/typography.html">Typography Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/unit_testing.html">Unit Testing Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/uri.html">URI Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/user_agent.html">User Agent Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../libraries/zip.html">Zip Encoding Class</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> +<li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> +</ul> +</li> +</ul> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> +</ul> +</li> +</ul> + + + + </div> + + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">CodeIgniter</a> + </nav> + + + + <div class="wy-nav-content"> + <div class="rst-content"> + <div role="navigation" aria-label="breadcrumbs navigation"> + <ul class="wy-breadcrumbs"> + <li><a href="../index.html">Docs</a> »</li> + + <li>Welcome to CodeIgniter</li> + <li class="wy-breadcrumbs-aside"> + + </li> + <div style="float:right;margin-left:5px;" id="closeMe"> + <img title="Classic Layout" alt="classic layout" src="data:image/gif;base64,R0lGODlhFAAUAJEAAAAAADMzM////wAAACH5BAUUAAIALAAAAAAUABQAAAImlI+py+0PU5gRBRDM3DxbWoXis42X13USOLauUIqnlsaH/eY6UwAAOw==" /> + </div> + </ul> + <hr/> +</div> + <div role="main" class="document"> + + <div class="section" id="welcome-to-codeigniter"> +<h1>Welcome to CodeIgniter<a class="headerlink" href="#welcome-to-codeigniter" title="Permalink to this headline">¶</a></h1> +<p>CodeIgniter is an Application Development Framework - a toolkit - for +people who build web sites using PHP. Its goal is to enable you to +develop projects much faster than you could if you were writing code +from scratch, by providing a rich set of libraries for commonly needed +tasks, as well as a simple interface and logical structure to access +these libraries. CodeIgniter lets you creatively focus on your project +by minimizing the amount of code needed for a given task.</p> +<div class="section" id="who-is-codeigniter-for"> +<h2>Who is CodeIgniter For?<a class="headerlink" href="#who-is-codeigniter-for" title="Permalink to this headline">¶</a></h2> +<p>CodeIgniter is right for you if:</p> +<ul class="simple"> +<li>You want a framework with a small footprint.</li> +<li>You need exceptional performance.</li> +<li>You need broad compatibility with standard hosting accounts that run +a variety of PHP versions and configurations.</li> +<li>You want a framework that requires nearly zero configuration.</li> +<li>You want a framework that does not require you to use the command +line.</li> +<li>You want a framework that does not require you to adhere to +restrictive coding rules.</li> +<li>You are not interested in large-scale monolithic libraries like PEAR.</li> +<li>You do not want to be forced to learn a templating language (although +a template parser is optionally available if you desire one).</li> +<li>You eschew complexity, favoring simple solutions.</li> +<li>You need clear, thorough documentation.</li> +</ul> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="../installation/index.html" class="btn btn-neutral float-right" title="Installation Instructions">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="../index.html" class="btn btn-neutral" title="CodeIgniter User Guide"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2014 - 2018, British Columbia Institute of Technology. + Last updated on Jun 12, 2018. + </p> + </div> + + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + </div> + </div> + + </section> + + </div> + + + + + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'../', + VERSION:'3.1.9', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'.html', + HAS_SOURCE: false + }; + </script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.StickyNav.enable(); + }); + </script> + + +</body> +</html>
\ No newline at end of file |