diff options
author | Andrey Andreev <narf@devilix.net> | 2018-03-22 15:48:55 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2018-03-22 15:48:55 +0100 |
commit | 71e647782764184e3aab4faffe6d99176758979f (patch) | |
tree | 74dbdd50a61cd5674915c144aca9ebbc00b235b8 /user_guide/helpers | |
parent | b12fbad77bd69ca0c7624a9094c29b7691ea6107 (diff) |
[ci skip] 3.1.8 release
Diffstat (limited to 'user_guide/helpers')
22 files changed, 16630 insertions, 0 deletions
diff --git a/user_guide/helpers/array_helper.html b/user_guide/helpers/array_helper.html new file mode 100644 index 000000000..50ee13285 --- /dev/null +++ b/user_guide/helpers/array_helper.html @@ -0,0 +1,660 @@ + + +<!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>Array Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="CAPTCHA Helper" href="captcha_helper.html"/> + <link rel="prev" title="Helpers" 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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Array Helper</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="array-helper"> +<h1>Array Helper<a class="headerlink" href="#array-helper" title="Permalink to this headline">¶</a></h1> +<p>The Array Helper file contains functions that assist in working with +arrays.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'array'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="element"> +<code class="descname">element</code><span class="sig-paren">(</span><em>$item</em>, <em>$array</em><span class="optional">[</span>, <em>$default = NULL</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#element" 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>$item</strong> (<em>string</em>) – Item to fetch from the array</li> +<li><strong>$array</strong> (<em>array</em>) – Input array</li> +<li><strong>$default</strong> (<em>bool</em>) – What to return if the array isn’t valid</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">NULL on failure or the array item.</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>Lets you fetch an item from an array. The function tests whether the +array index is set and whether it has a value. If a value exists it is +returned. If a value does not exist it returns NULL, or whatever you’ve +specified as the default value via the third parameter.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$array</span> <span class="o">=</span> <span class="k">array</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="s1">'shape'</span> <span class="o">=></span> <span class="s1">'round'</span><span class="p">,</span> + <span class="s1">'size'</span> <span class="o">=></span> <span class="s1">''</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">element</span><span class="p">(</span><span class="s1">'color'</span><span class="p">,</span> <span class="nv">$array</span><span class="p">);</span> <span class="c1">// returns "red"</span> +<span class="k">echo</span> <span class="nx">element</span><span class="p">(</span><span class="s1">'size'</span><span class="p">,</span> <span class="nv">$array</span><span class="p">,</span> <span class="s1">'foobar'</span><span class="p">);</span> <span class="c1">// returns "foobar"</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="elements"> +<code class="descname">elements</code><span class="sig-paren">(</span><em>$items</em>, <em>$array</em><span class="optional">[</span>, <em>$default = NULL</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#elements" 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>$item</strong> (<em>string</em>) – Item to fetch from the array</li> +<li><strong>$array</strong> (<em>array</em>) – Input array</li> +<li><strong>$default</strong> (<em>bool</em>) – What to return if the array isn’t valid</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">NULL on failure or the array item.</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>Lets you fetch a number of items from an array. The function tests +whether each of the array indices is set. If an index does not exist it +is set to NULL, or whatever you’ve specified as the default value via +the third parameter.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$array</span> <span class="o">=</span> <span class="k">array</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="s1">'shape'</span> <span class="o">=></span> <span class="s1">'round'</span><span class="p">,</span> + <span class="s1">'radius'</span> <span class="o">=></span> <span class="s1">'10'</span><span class="p">,</span> + <span class="s1">'diameter'</span> <span class="o">=></span> <span class="s1">'20'</span> +<span class="p">);</span> + +<span class="nv">$my_shape</span> <span class="o">=</span> <span class="nx">elements</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">'color'</span><span class="p">,</span> <span class="s1">'shape'</span><span class="p">,</span> <span class="s1">'height'</span><span class="p">),</span> <span class="nv">$array</span><span class="p">);</span> +</pre></div> +</div> +<p>The above will return the following array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">array</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="s1">'shape'</span> <span class="o">=></span> <span class="s1">'round'</span><span class="p">,</span> + <span class="s1">'height'</span> <span class="o">=></span> <span class="k">NULL</span> +<span class="p">);</span> +</pre></div> +</div> +<p>You can set the third parameter to any default value you like.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$my_shape</span> <span class="o">=</span> <span class="nx">elements</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">'color'</span><span class="p">,</span> <span class="s1">'shape'</span><span class="p">,</span> <span class="s1">'height'</span><span class="p">),</span> <span class="nv">$array</span><span class="p">,</span> <span class="s1">'foobar'</span><span class="p">);</span> +</pre></div> +</div> +<p>The above will return the following array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">array</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="s1">'shape'</span> <span class="o">=></span> <span class="s1">'round'</span><span class="p">,</span> + <span class="s1">'height'</span> <span class="o">=></span> <span class="s1">'foobar'</span> +<span class="p">);</span> +</pre></div> +</div> +<p>This is useful when sending the <code class="docutils literal"><span class="pre">$_POST</span></code> array to one of your Models. +This prevents users from sending additional POST data to be entered into +your tables.</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">'post_model'</span><span class="p">);</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">post_model</span><span class="o">-></span><span class="na">update</span><span class="p">(</span> + <span class="nx">elements</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">'id'</span><span class="p">,</span> <span class="s1">'title'</span><span class="p">,</span> <span class="s1">'content'</span><span class="p">),</span> <span class="nv">$_POST</span><span class="p">)</span> +<span class="p">);</span> +</pre></div> +</div> +<p>This ensures that only the id, title and content fields are sent to be +updated.</p> +</dd></dl> + +<dl class="function"> +<dt id="random_element"> +<code class="descname">random_element</code><span class="sig-paren">(</span><em>$array</em><span class="sig-paren">)</span><a class="headerlink" href="#random_element" 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>) – Input array</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A random element from the array</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>Takes an array as input and returns a random element from it.</p> +<p>Usage example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$quotes</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s2">"I find that the harder I work, the more luck I seem to have. - Thomas Jefferson"</span><span class="p">,</span> + <span class="s2">"Don't stay in bed, unless you can make money in bed. - George Burns"</span><span class="p">,</span> + <span class="s2">"We didn't lose the game; we just ran out of time. - Vince Lombardi"</span><span class="p">,</span> + <span class="s2">"If everything seems under control, you're not going fast enough. - Mario Andretti"</span><span class="p">,</span> + <span class="s2">"Reality is merely an illusion, albeit a very persistent one. - Albert Einstein"</span><span class="p">,</span> + <span class="s2">"Chance favors the prepared mind - Louis Pasteur"</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">random_element</span><span class="p">(</span><span class="nv">$quotes</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="captcha_helper.html" class="btn btn-neutral float-right" title="CAPTCHA Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="index.html" class="btn btn-neutral" title="Helpers"><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 Mar 22, 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.8', + 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/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html new file mode 100644 index 000000000..2869accd5 --- /dev/null +++ b/user_guide/helpers/captcha_helper.html @@ -0,0 +1,676 @@ + + +<!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>CAPTCHA Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Cookie Helper" href="cookie_helper.html"/> + <link rel="prev" title="Array Helper" href="array_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>CAPTCHA Helper</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="captcha-helper"> +<h1>CAPTCHA Helper<a class="headerlink" href="#captcha-helper" title="Permalink to this headline">¶</a></h1> +<p>The CAPTCHA Helper file contains functions that assist in creating +CAPTCHA images.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#using-the-captcha-helper" id="id2">Using the CAPTCHA helper</a><ul> +<li><a class="reference internal" href="#adding-a-database" id="id3">Adding a Database</a></li> +</ul> +</li> +<li><a class="reference internal" href="#available-functions" id="id4">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'captcha'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="using-the-captcha-helper"> +<h2><a class="toc-backref" href="#id2">Using the CAPTCHA helper</a><a class="headerlink" href="#using-the-captcha-helper" title="Permalink to this headline">¶</a></h2> +<p>Once loaded you can generate a CAPTCHA like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$vals</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'word'</span> <span class="o">=></span> <span class="s1">'Random word'</span><span class="p">,</span> + <span class="s1">'img_path'</span> <span class="o">=></span> <span class="s1">'./captcha/'</span><span class="p">,</span> + <span class="s1">'img_url'</span> <span class="o">=></span> <span class="s1">'http://example.com/captcha/'</span><span class="p">,</span> + <span class="s1">'font_path'</span> <span class="o">=></span> <span class="s1">'./path/to/fonts/texb.ttf'</span><span class="p">,</span> + <span class="s1">'img_width'</span> <span class="o">=></span> <span class="s1">'150'</span><span class="p">,</span> + <span class="s1">'img_height'</span> <span class="o">=></span> <span class="mi">30</span><span class="p">,</span> + <span class="s1">'expiration'</span> <span class="o">=></span> <span class="mi">7200</span><span class="p">,</span> + <span class="s1">'word_length'</span> <span class="o">=></span> <span class="mi">8</span><span class="p">,</span> + <span class="s1">'font_size'</span> <span class="o">=></span> <span class="mi">16</span><span class="p">,</span> + <span class="s1">'img_id'</span> <span class="o">=></span> <span class="s1">'Imageid'</span><span class="p">,</span> + <span class="s1">'pool'</span> <span class="o">=></span> <span class="s1">'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'</span><span class="p">,</span> + + <span class="c1">// White background and border, black text and red grid</span> + <span class="s1">'colors'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'background'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">),</span> + <span class="s1">'border'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">,</span> <span class="mi">255</span><span class="p">),</span> + <span class="s1">'text'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> + <span class="s1">'grid'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span><span class="mi">255</span><span class="p">,</span> <span class="mi">40</span><span class="p">,</span> <span class="mi">40</span><span class="p">)</span> + <span class="p">)</span> +<span class="p">);</span> + +<span class="nv">$cap</span> <span class="o">=</span> <span class="nx">create_captcha</span><span class="p">(</span><span class="nv">$vals</span><span class="p">);</span> +<span class="k">echo</span> <span class="nv">$cap</span><span class="p">[</span><span class="s1">'image'</span><span class="p">];</span> +</pre></div> +</div> +<ul class="simple"> +<li>The captcha function requires the GD image library.</li> +<li>Only the <strong>img_path</strong> and <strong>img_url</strong> are required.</li> +<li>If a <strong>word</strong> is not supplied, the function will generate a random +ASCII string. You might put together your own word library that you +can draw randomly from.</li> +<li>If you do not specify a path to a TRUE TYPE font, the native ugly GD +font will be used.</li> +<li>The “captcha” directory must be writable</li> +<li>The <strong>expiration</strong> (in seconds) signifies how long an image will remain +in the captcha folder before it will be deleted. The default is two +hours.</li> +<li><strong>word_length</strong> defaults to 8, <strong>pool</strong> defaults to ‘0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’</li> +<li><strong>font_size</strong> defaults to 16, the native GD font has a size limit. Specify a “true type” font for bigger sizes.</li> +<li>The <strong>img_id</strong> will be set as the “id” of the captcha image.</li> +<li>If any of the <strong>colors</strong> values is missing, it will be replaced by the default.</li> +</ul> +<div class="section" id="adding-a-database"> +<h3><a class="toc-backref" href="#id3">Adding a Database</a><a class="headerlink" href="#adding-a-database" title="Permalink to this headline">¶</a></h3> +<p>In order for the captcha function to prevent someone from submitting, +you will need to add the information returned from <code class="docutils literal"><span class="pre">create_captcha()</span></code> +to your database. Then, when the data from the form is submitted by +the user you will need to verify that the data exists in the database +and has not expired.</p> +<p>Here is a table prototype:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">CREATE</span> <span class="nx">TABLE</span> <span class="nx">captcha</span> <span class="p">(</span> + <span class="nx">captcha_id</span> <span class="nx">bigint</span><span class="p">(</span><span class="mi">13</span><span class="p">)</span> <span class="nx">unsigned</span> <span class="k">NOT</span> <span class="k">NULL</span> <span class="nx">auto_increment</span><span class="p">,</span> + <span class="nx">captcha_time</span> <span class="nx">int</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="nx">unsigned</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span> + <span class="nx">ip_address</span> <span class="nx">varchar</span><span class="p">(</span><span class="mi">45</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span> + <span class="nx">word</span> <span class="nx">varchar</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span> <span class="k">NOT</span> <span class="k">NULL</span><span class="p">,</span> + <span class="nx">PRIMARY</span> <span class="nx">KEY</span> <span class="sb">`captcha_id`</span> <span class="p">(</span><span class="sb">`captcha_id`</span><span class="p">),</span> + <span class="nx">KEY</span> <span class="sb">`word`</span> <span class="p">(</span><span class="sb">`word`</span><span class="p">)</span> +<span class="p">);</span> +</pre></div> +</div> +<p>Here is an example of usage with a database. On the page where the +CAPTCHA will be shown you’ll have something 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="s1">'captcha'</span><span class="p">);</span> +<span class="nv">$vals</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'img_path'</span> <span class="o">=></span> <span class="s1">'./captcha/'</span><span class="p">,</span> + <span class="s1">'img_url'</span> <span class="o">=></span> <span class="s1">'http://example.com/captcha/'</span> +<span class="p">);</span> + +<span class="nv">$cap</span> <span class="o">=</span> <span class="nx">create_captcha</span><span class="p">(</span><span class="nv">$vals</span><span class="p">);</span> +<span class="nv">$data</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'captcha_time'</span> <span class="o">=></span> <span class="nv">$cap</span><span class="p">[</span><span class="s1">'time'</span><span class="p">],</span> + <span class="s1">'ip_address'</span> <span class="o">=></span> <span class="nv">$this</span><span class="o">-></span><span class="na">input</span><span class="o">-></span><span class="na">ip_address</span><span class="p">(),</span> + <span class="s1">'word'</span> <span class="o">=></span> <span class="nv">$cap</span><span class="p">[</span><span class="s1">'word'</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">insert_string</span><span class="p">(</span><span class="s1">'captcha'</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">db</span><span class="o">-></span><span class="na">query</span><span class="p">(</span><span class="nv">$query</span><span class="p">);</span> + +<span class="k">echo</span> <span class="s1">'Submit the word you see below:'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nv">$cap</span><span class="p">[</span><span class="s1">'image'</span><span class="p">];</span> +<span class="k">echo</span> <span class="s1">'<input type="text" name="captcha" value="" />'</span><span class="p">;</span> +</pre></div> +</div> +<p>Then, on the page that accepts the submission you’ll have something like +this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// First, delete old captchas</span> +<span class="nv">$expiration</span> <span class="o">=</span> <span class="nb">time</span><span class="p">()</span> <span class="o">-</span> <span class="mi">7200</span><span class="p">;</span> <span class="c1">// Two hour limit</span> +<span class="nv">$this</span><span class="o">-></span><span class="na">db</span><span class="o">-></span><span class="na">where</span><span class="p">(</span><span class="s1">'captcha_time < '</span><span class="p">,</span> <span class="nv">$expiration</span><span class="p">)</span> + <span class="o">-></span><span class="na">delete</span><span class="p">(</span><span class="s1">'captcha'</span><span class="p">);</span> + +<span class="c1">// Then see if a captcha exists:</span> +<span class="nv">$sql</span> <span class="o">=</span> <span class="s1">'SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?'</span><span class="p">;</span> +<span class="nv">$binds</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">'captcha'</span><span class="p">],</span> <span class="nv">$this</span><span class="o">-></span><span class="na">input</span><span class="o">-></span><span class="na">ip_address</span><span class="p">(),</span> <span class="nv">$expiration</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">query</span><span class="p">(</span><span class="nv">$sql</span><span class="p">,</span> <span class="nv">$binds</span><span class="p">);</span> +<span class="nv">$row</span> <span class="o">=</span> <span class="nv">$query</span><span class="o">-></span><span class="na">row</span><span class="p">();</span> + +<span class="k">if</span> <span class="p">(</span><span class="nv">$row</span><span class="o">-></span><span class="na">count</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="s1">'You must submit the word that appears in the image.'</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id4">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="create_captcha"> +<code class="descname">create_captcha</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$img_path = ''</em><span class="optional">[</span>, <em>$img_url = ''</em><span class="optional">[</span>, <em>$font_path = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#create_captcha" 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>) – Array of data for the CAPTCHA</li> +<li><strong>$img_path</strong> (<em>string</em>) – Path to create the image in (DEPRECATED)</li> +<li><strong>$img_url</strong> (<em>string</em>) – URL to the CAPTCHA image folder (DEPRECATED)</li> +<li><strong>$font_path</strong> (<em>string</em>) – Server path to font (DEPRECATED)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">array(‘word’ => $word, ‘time’ => $now, ‘image’ => $img)</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>Takes an array of information to generate the CAPTCHA as input and +creates the image to your specifications, returning an array of +associative data about the image.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">array</span><span class="p">(</span> + <span class="s1">'image'</span> <span class="o">=></span> <span class="nx">IMAGE</span> <span class="nx">TAG</span> + <span class="s1">'time'</span> <span class="o">=></span> <span class="nx">TIMESTAMP</span> <span class="p">(</span><span class="nx">in</span> <span class="nb">microtime</span><span class="p">)</span> + <span class="s1">'word'</span> <span class="o">=></span> <span class="nx">CAPTCHA</span> <span class="nx">WORD</span> +<span class="p">)</span> +</pre></div> +</div> +<p>The <strong>image</strong> is the actual image tag:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">img</span> <span class="nx">src</span><span class="o">=</span><span class="s2">"http://example.com/captcha/12345.jpg"</span> <span class="nx">width</span><span class="o">=</span><span class="s2">"140"</span> <span class="nx">height</span><span class="o">=</span><span class="s2">"50"</span> <span class="o">/></span> +</pre></div> +</div> +<p>The <strong>time</strong> is the micro timestamp used as the image name without the +file extension. It will be a number like this: 1139612155.3422</p> +<p>The <strong>word</strong> is the word that appears in the captcha image, which if not +supplied to the function, will be a random string.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Usage of the <code class="docutils literal"><span class="pre">$img_path</span></code>, <code class="docutils literal"><span class="pre">$img_url</span></code> and <code class="docutils literal"><span class="pre">$font_path</span></code> +parameters is DEPRECATED. Provide them in the <code class="docutils literal"><span class="pre">$data</span></code> array +instead.</p> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="cookie_helper.html" class="btn btn-neutral float-right" title="Cookie Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="array_helper.html" class="btn btn-neutral" title="Array Helper"><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 Mar 22, 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.8', + 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/helpers/cookie_helper.html b/user_guide/helpers/cookie_helper.html new file mode 100644 index 000000000..c342f0b48 --- /dev/null +++ b/user_guide/helpers/cookie_helper.html @@ -0,0 +1,608 @@ + + +<!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>Cookie Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Date Helper" href="date_helper.html"/> + <link rel="prev" title="CAPTCHA Helper" href="captcha_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Cookie Helper</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="cookie-helper"> +<h1>Cookie Helper<a class="headerlink" href="#cookie-helper" title="Permalink to this headline">¶</a></h1> +<p>The Cookie Helper file contains functions that assist in working with +cookies.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'cookie'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="set_cookie"> +<code class="descname">set_cookie</code><span class="sig-paren">(</span><em>$name</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$expire = ''</em><span class="optional">[</span>, <em>$domain = ''</em><span class="optional">[</span>, <em>$path = '/'</em><span class="optional">[</span>, <em>$prefix = ''</em><span class="optional">[</span>, <em>$secure = NULL</em><span class="optional">[</span>, <em>$httponly = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_cookie" 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>$name</strong> (<em>mixed</em>) – Cookie name <em>or</em> associative array of all of the parameters available to this function</li> +<li><strong>$value</strong> (<em>string</em>) – Cookie value</li> +<li><strong>$expire</strong> (<em>int</em>) – Number of seconds until expiration</li> +<li><strong>$domain</strong> (<em>string</em>) – Cookie domain (usually: .yourdomain.com)</li> +<li><strong>$path</strong> (<em>string</em>) – Cookie path</li> +<li><strong>$prefix</strong> (<em>string</em>) – Cookie name prefix</li> +<li><strong>$secure</strong> (<em>bool</em>) – Whether to only send the cookie through HTTPS</li> +<li><strong>$httponly</strong> (<em>bool</em>) – Whether to hide the cookie from JavaScript</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 helper function gives you friendlier syntax to set browser +cookies. Refer to the <a class="reference internal" href="../libraries/input.html"><span class="doc">Input Library</span></a> for +a description of its use, as this function is an alias for +<code class="docutils literal"><span class="pre">CI_Input::set_cookie()</span></code>.</p> +</dd></dl> + +<dl class="function"> +<dt id="get_cookie"> +<code class="descname">get_cookie</code><span class="sig-paren">(</span><em>$index</em><span class="optional">[</span>, <em>$xss_clean = NULL</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#get_cookie" 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>$index</strong> (<em>string</em>) – Cookie name</li> +<li><strong>$xss_clean</strong> (<em>bool</em>) – Whether to apply XSS filtering to the returned value</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The cookie 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>This helper function gives you friendlier syntax to get browser +cookies. Refer to the <a class="reference internal" href="../libraries/input.html"><span class="doc">Input Library</span></a> for +detailed description of its use, as this function acts very +similarly to <code class="docutils literal"><span class="pre">CI_Input::cookie()</span></code>, except it will also prepend +the <code class="docutils literal"><span class="pre">$config['cookie_prefix']</span></code> that you might’ve set in your +<em>application/config/config.php</em> file.</p> +</dd></dl> + +<dl class="function"> +<dt id="delete_cookie"> +<code class="descname">delete_cookie</code><span class="sig-paren">(</span><em>$name</em><span class="optional">[</span>, <em>$domain = ''</em><span class="optional">[</span>, <em>$path = '/'</em><span class="optional">[</span>, <em>$prefix = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#delete_cookie" 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>$name</strong> (<em>string</em>) – Cookie name</li> +<li><strong>$domain</strong> (<em>string</em>) – Cookie domain (usually: .yourdomain.com)</li> +<li><strong>$path</strong> (<em>string</em>) – Cookie path</li> +<li><strong>$prefix</strong> (<em>string</em>) – Cookie name prefix</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>Lets you delete a cookie. Unless you’ve set a custom path or other +values, only the name of the cookie is needed.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">delete_cookie</span><span class="p">(</span><span class="s1">'name'</span><span class="p">);</span> +</pre></div> +</div> +<p>This function is otherwise identical to <code class="docutils literal"><span class="pre">set_cookie()</span></code>, except that it +does not have the value and expiration parameters. You can submit an +array of values in the first parameter or you can set discrete +parameters.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">delete_cookie</span><span class="p">(</span><span class="nv">$name</span><span class="p">,</span> <span class="nv">$domain</span><span class="p">,</span> <span class="nv">$path</span><span class="p">,</span> <span class="nv">$prefix</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="date_helper.html" class="btn btn-neutral float-right" title="Date Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="captcha_helper.html" class="btn btn-neutral" title="CAPTCHA Helper"><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 Mar 22, 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.8', + 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/helpers/date_helper.html b/user_guide/helpers/date_helper.html new file mode 100644 index 000000000..c6a95170c --- /dev/null +++ b/user_guide/helpers/date_helper.html @@ -0,0 +1,1256 @@ + + +<!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>Date Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Directory Helper" href="directory_helper.html"/> + <link rel="prev" title="Cookie Helper" href="cookie_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Date Helper</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="date-helper"> +<h1>Date Helper<a class="headerlink" href="#date-helper" title="Permalink to this headline">¶</a></h1> +<p>The Date Helper file contains functions that help you work with dates.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +<li><a class="reference internal" href="#timezone-reference" id="id3">Timezone Reference</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'date'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="now"> +<code class="descname">now</code><span class="sig-paren">(</span><span class="optional">[</span><em>$timezone = NULL</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#now" 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>$timezone</strong> (<em>string</em>) – Timezone</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">UNIX timestamp</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> +</td> +</tr> +</tbody> +</table> +<p>Returns the current time as a UNIX timestamp, referenced either to your server’s +local time or any PHP supported timezone, based on the “time reference” setting +in your config file. If you do not intend to set your master time reference to +any other PHP supported timezone (which you’ll typically do if you run a site +that lets each user set their own timezone settings) there is no benefit to using +this function over PHP’s <code class="docutils literal"><span class="pre">time()</span></code> function.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">now</span><span class="p">(</span><span class="s1">'Australia/Victoria'</span><span class="p">);</span> +</pre></div> +</div> +<p>If a timezone is not provided, it will return <code class="docutils literal"><span class="pre">time()</span></code> based on the +<strong>time_reference</strong> setting.</p> +</dd></dl> + +<dl class="function"> +<dt id="mdate"> +<code class="descname">mdate</code><span class="sig-paren">(</span><span class="optional">[</span><em>$datestr = ''</em><span class="optional">[</span>, <em>$time = ''</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#mdate" 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>$datestr</strong> (<em>string</em>) – Date string</li> +<li><strong>$time</strong> (<em>int</em>) – UNIX timestamp</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">MySQL-formatted date</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 is identical to PHP’s <a class="reference external" href="http://php.net/manual/en/function.date.php">date()</a> +function, except that it lets you use MySQL style date codes, where each +code letter is preceded with a percent sign, e.g. <cite>%Y %m %d</cite></p> +<p>The benefit of doing dates this way is that you don’t have to worry +about escaping any characters that are not date codes, as you would +normally have to do with the <code class="docutils literal"><span class="pre">date()</span></code> function.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$datestring</span> <span class="o">=</span> <span class="s1">'Year: %Y Month: %m Day: %d - %h:%i %a'</span><span class="p">;</span> +<span class="nv">$time</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> +<span class="k">echo</span> <span class="nx">mdate</span><span class="p">(</span><span class="nv">$datestring</span><span class="p">,</span> <span class="nv">$time</span><span class="p">);</span> +</pre></div> +</div> +<p>If a timestamp is not included in the second parameter the current time +will be used.</p> +</dd></dl> + +<dl class="function"> +<dt id="standard_date"> +<code class="descname">standard_date</code><span class="sig-paren">(</span><span class="optional">[</span><em>$fmt = 'DATE_RFC822'</em><span class="optional">[</span>, <em>$time = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#standard_date" 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>$fmt</strong> (<em>string</em>) – Date format</li> +<li><strong>$time</strong> (<em>int</em>) – UNIX timestamp</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formatted date or FALSE on invalid format</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>Lets you generate a date string in one of several standardized formats.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$format</span> <span class="o">=</span> <span class="s1">'DATE_RFC822'</span><span class="p">;</span> +<span class="nv">$time</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> +<span class="k">echo</span> <span class="nx">standard_date</span><span class="p">(</span><span class="nv">$format</span><span class="p">,</span> <span class="nv">$time</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">date()</span></code> combined with +<a class="reference external" href="https://secure.php.net/manual/en/class.datetime.php#datetime.constants.types">DateTime’s format constants</a> +instead:</p> +<div class="last highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nb">date</span><span class="p">(</span><span class="nx">DATE_RFC822</span><span class="p">,</span> <span class="nb">time</span><span class="p">());</span> +</pre></div> +</div> +</div> +<p><strong>Supported formats:</strong></p> +<table border="1" class="docutils"> +<colgroup> +<col width="20%" /> +<col width="30%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Constant</th> +<th class="head">Description</th> +<th class="head">Example</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td>DATE_ATOM</td> +<td>Atom</td> +<td>2005-08-15T16:13:03+0000</td> +</tr> +<tr class="row-odd"><td>DATE_COOKIE</td> +<td>HTTP Cookies</td> +<td>Sun, 14 Aug 2005 16:13:03 UTC</td> +</tr> +<tr class="row-even"><td>DATE_ISO8601</td> +<td>ISO-8601</td> +<td>2005-08-14T16:13:03+00:00</td> +</tr> +<tr class="row-odd"><td>DATE_RFC822</td> +<td>RFC 822</td> +<td>Sun, 14 Aug 05 16:13:03 UTC</td> +</tr> +<tr class="row-even"><td>DATE_RFC850</td> +<td>RFC 850</td> +<td>Sunday, 14-Aug-05 16:13:03 UTC</td> +</tr> +<tr class="row-odd"><td>DATE_RFC1036</td> +<td>RFC 1036</td> +<td>Sunday, 14-Aug-05 16:13:03 UTC</td> +</tr> +<tr class="row-even"><td>DATE_RFC1123</td> +<td>RFC 1123</td> +<td>Sun, 14 Aug 2005 16:13:03 UTC</td> +</tr> +<tr class="row-odd"><td>DATE_RFC2822</td> +<td>RFC 2822</td> +<td>Sun, 14 Aug 2005 16:13:03 +0000</td> +</tr> +<tr class="row-even"><td>DATE_RSS</td> +<td>RSS</td> +<td>Sun, 14 Aug 2005 16:13:03 UTC</td> +</tr> +<tr class="row-odd"><td>DATE_W3C</td> +<td>W3C</td> +<td>2005-08-14T16:13:03+0000</td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="local_to_gmt"> +<code class="descname">local_to_gmt</code><span class="sig-paren">(</span><span class="optional">[</span><em>$time = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#local_to_gmt" 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>$time</strong> (<em>int</em>) – UNIX timestamp</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">UNIX timestamp</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> +</td> +</tr> +</tbody> +</table> +<p>Takes a UNIX timestamp as input and returns it as GMT.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$gmt</span> <span class="o">=</span> <span class="nx">local_to_gmt</span><span class="p">(</span><span class="nb">time</span><span class="p">());</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="gmt_to_local"> +<code class="descname">gmt_to_local</code><span class="sig-paren">(</span><span class="optional">[</span><em>$time = ''</em><span class="optional">[</span>, <em>$timezone = 'UTC'</em><span class="optional">[</span>, <em>$dst = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#gmt_to_local" 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>$time</strong> (<em>int</em>) – UNIX timestamp</li> +<li><strong>$timezone</strong> (<em>string</em>) – Timezone</li> +<li><strong>$dst</strong> (<em>bool</em>) – Whether DST is active</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">UNIX timestamp</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> +</td> +</tr> +</tbody> +</table> +<p>Takes a UNIX timestamp (referenced to GMT) as input, and converts it to +a localized timestamp based on the timezone and Daylight Saving Time +submitted.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$timestamp</span> <span class="o">=</span> <span class="mi">1140153693</span><span class="p">;</span> +<span class="nv">$timezone</span> <span class="o">=</span> <span class="s1">'UM8'</span><span class="p">;</span> +<span class="nv">$daylight_saving</span> <span class="o">=</span> <span class="k">TRUE</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">gmt_to_local</span><span class="p">(</span><span class="nv">$timestamp</span><span class="p">,</span> <span class="nv">$timezone</span><span class="p">,</span> <span class="nv">$daylight_saving</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For a list of timezones see the reference at the bottom of this page.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="mysql_to_unix"> +<code class="descname">mysql_to_unix</code><span class="sig-paren">(</span><span class="optional">[</span><em>$time = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#mysql_to_unix" 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>$time</strong> (<em>string</em>) – MySQL timestamp</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">UNIX timestamp</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> +</td> +</tr> +</tbody> +</table> +<p>Takes a MySQL Timestamp as input and returns it as a UNIX timestamp.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$unix</span> <span class="o">=</span> <span class="nx">mysql_to_unix</span><span class="p">(</span><span class="s1">'20061124092345'</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="unix_to_human"> +<code class="descname">unix_to_human</code><span class="sig-paren">(</span><span class="optional">[</span><em>$time = ''</em><span class="optional">[</span>, <em>$seconds = FALSE</em><span class="optional">[</span>, <em>$fmt = 'us'</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#unix_to_human" 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>$time</strong> (<em>int</em>) – UNIX timestamp</li> +<li><strong>$seconds</strong> (<em>bool</em>) – Whether to show seconds</li> +<li><strong>$fmt</strong> (<em>string</em>) – format (us or euro)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formatted date</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>Takes a UNIX timestamp as input and returns it in a human readable +format with this prototype:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">YYYY</span><span class="o">-</span><span class="nx">MM</span><span class="o">-</span><span class="nx">DD</span> <span class="nx">HH</span><span class="o">:</span><span class="nx">MM</span><span class="o">:</span><span class="nx">SS</span> <span class="nx">AM</span><span class="o">/</span><span class="nx">PM</span> +</pre></div> +</div> +<p>This can be useful if you need to display a date in a form field for +submission.</p> +<p>The time can be formatted with or without seconds, and it can be set to +European or US format. If only the timestamp is submitted it will return +the time without seconds formatted for the U.S.</p> +<p>Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$now</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> +<span class="k">echo</span> <span class="nx">unix_to_human</span><span class="p">(</span><span class="nv">$now</span><span class="p">);</span> <span class="c1">// U.S. time, no seconds</span> +<span class="k">echo</span> <span class="nx">unix_to_human</span><span class="p">(</span><span class="nv">$now</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">,</span> <span class="s1">'us'</span><span class="p">);</span> <span class="c1">// U.S. time with seconds</span> +<span class="k">echo</span> <span class="nx">unix_to_human</span><span class="p">(</span><span class="nv">$now</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">,</span> <span class="s1">'eu'</span><span class="p">);</span> <span class="c1">// Euro time with seconds</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="human_to_unix"> +<code class="descname">human_to_unix</code><span class="sig-paren">(</span><span class="optional">[</span><em>$datestr = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#human_to_unix" 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>$datestr</strong> (<em>int</em>) – Date string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">UNIX timestamp 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">int</p> +</td> +</tr> +</tbody> +</table> +<p>The opposite of the <code class="xref php php-func docutils literal"><span class="pre">unix_to_time()</span></code> function. Takes a “human” +time as input and returns it as a UNIX timestamp. This is useful if you +accept “human” formatted dates submitted via a form. Returns boolean FALSE +date string passed to it is not formatted as indicated above.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$now</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> +<span class="nv">$human</span> <span class="o">=</span> <span class="nx">unix_to_human</span><span class="p">(</span><span class="nv">$now</span><span class="p">);</span> +<span class="nv">$unix</span> <span class="o">=</span> <span class="nx">human_to_unix</span><span class="p">(</span><span class="nv">$human</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="nice_date"> +<code class="descname">nice_date</code><span class="sig-paren">(</span><span class="optional">[</span><em>$bad_date = ''</em><span class="optional">[</span>, <em>$format = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#nice_date" 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>$bad_date</strong> (<em>int</em>) – The terribly formatted date-like string</li> +<li><strong>$format</strong> (<em>string</em>) – Date format to return (same as PHP’s <code class="docutils literal"><span class="pre">date()</span></code> function)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formatted date</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 can take a number poorly-formed date formats and convert +them into something useful. It also accepts well-formed dates.</p> +<p>The function will return a UNIX timestamp by default. You can, optionally, +pass a format string (the same type as the PHP <code class="docutils literal"><span class="pre">date()</span></code> function accepts) +as the second parameter.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$bad_date</span> <span class="o">=</span> <span class="s1">'199605'</span><span class="p">;</span> +<span class="c1">// Should Produce: 1996-05-01</span> +<span class="nv">$better_date</span> <span class="o">=</span> <span class="nx">nice_date</span><span class="p">(</span><span class="nv">$bad_date</span><span class="p">,</span> <span class="s1">'Y-m-d'</span><span class="p">);</span> + +<span class="nv">$bad_date</span> <span class="o">=</span> <span class="s1">'9-11-2001'</span><span class="p">;</span> +<span class="c1">// Should Produce: 2001-09-11</span> +<span class="nv">$better_date</span> <span class="o">=</span> <span class="nx">nice_date</span><span class="p">(</span><span class="nv">$bad_date</span><span class="p">,</span> <span class="s1">'Y-m-d'</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use PHP’s native <a class="reference external" href="https://secure.php.net/datetime">DateTime class</a> instead.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="timespan"> +<code class="descname">timespan</code><span class="sig-paren">(</span><span class="optional">[</span><em>$seconds = 1</em><span class="optional">[</span>, <em>$time = ''</em><span class="optional">[</span>, <em>$units = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#timespan" 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>$seconds</strong> (<em>int</em>) – Number of seconds</li> +<li><strong>$time</strong> (<em>string</em>) – UNIX timestamp</li> +<li><strong>$units</strong> (<em>int</em>) – Number of time units to display</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formatted time difference</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>Formats a UNIX timestamp so that is appears similar to this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="mi">1</span> <span class="nx">Year</span><span class="p">,</span> <span class="mi">10</span> <span class="nx">Months</span><span class="p">,</span> <span class="mi">2</span> <span class="nx">Weeks</span><span class="p">,</span> <span class="mi">5</span> <span class="nx">Days</span><span class="p">,</span> <span class="mi">10</span> <span class="nx">Hours</span><span class="p">,</span> <span class="mi">16</span> <span class="nx">Minutes</span> +</pre></div> +</div> +<p>The first parameter must contain a UNIX timestamp. +The second parameter must contain a timestamp that is greater that the +first timestamp. +The thirdparameter is optional and limits the number of time units to display.</p> +<p>If the second parameter empty, the current time will be used.</p> +<p>The most common purpose for this function is to show how much time has +elapsed from some point in time in the past to now.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$post_date</span> <span class="o">=</span> <span class="s1">'1079621429'</span><span class="p">;</span> +<span class="nv">$now</span> <span class="o">=</span> <span class="nb">time</span><span class="p">();</span> +<span class="nv">$units</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">timespan</span><span class="p">(</span><span class="nv">$post_date</span><span class="p">,</span> <span class="nv">$now</span><span class="p">,</span> <span class="nv">$units</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The text generated by this function is found in the following language +file: <cite>language/<your_lang>/date_lang.php</cite></p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="days_in_month"> +<code class="descname">days_in_month</code><span class="sig-paren">(</span><span class="optional">[</span><em>$month = 0</em><span class="optional">[</span>, <em>$year = ''</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#days_in_month" 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>$month</strong> (<em>int</em>) – a numeric month</li> +<li><strong>$year</strong> (<em>int</em>) – a numeric year</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Count of days in the specified month</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> +</td> +</tr> +</tbody> +</table> +<p>Returns the number of days in a given month/year. Takes leap years into +account.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">days_in_month</span><span class="p">(</span><span class="mo">06</span><span class="p">,</span> <span class="mi">2005</span><span class="p">);</span> +</pre></div> +</div> +<p>If the second parameter is empty, the current year will be used.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function will alias the native <code class="docutils literal"><span class="pre">cal_days_in_month()</span></code>, if +it is available.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="date_range"> +<code class="descname">date_range</code><span class="sig-paren">(</span><span class="optional">[</span><em>$unix_start = ''</em><span class="optional">[</span>, <em>$mixed = ''</em><span class="optional">[</span>, <em>$is_unix = TRUE</em><span class="optional">[</span>, <em>$format = 'Y-m-d'</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#date_range" 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>$unix_start</strong> (<em>int</em>) – UNIX timestamp of the range start date</li> +<li><strong>$mixed</strong> (<em>int</em>) – UNIX timestamp of the range end date or interval in days</li> +<li><strong>$is_unix</strong> (<em>bool</em>) – set to FALSE if $mixed is not a timestamp</li> +<li><strong>$format</strong> (<em>string</em>) – Output date format, same as in <code class="docutils literal"><span class="pre">date()</span></code></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 dates</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>Returns a list of dates within a specified period.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$range</span> <span class="o">=</span> <span class="nx">date_range</span><span class="p">(</span><span class="s1">'2012-01-01'</span><span class="p">,</span> <span class="s1">'2012-01-15'</span><span class="p">);</span> +<span class="k">echo</span> <span class="s2">"First 15 days of 2012:"</span><span class="p">;</span> +<span class="k">foreach</span> <span class="p">(</span><span class="nv">$range</span> <span class="k">as</span> <span class="nv">$date</span><span class="p">)</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="nv">$date</span><span class="o">.</span><span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="timezones"> +<code class="descname">timezones</code><span class="sig-paren">(</span><span class="optional">[</span><em>$tz = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#timezones" 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>$tz</strong> (<em>string</em>) – A numeric timezone</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Hour difference from UTC</p> +</td> +</tr> +<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">int</p> +</td> +</tr> +</tbody> +</table> +<p>Takes a timezone reference (for a list of valid timezones, see the +“Timezone Reference” below) and returns the number of hours offset from +UTC.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">timezones</span><span class="p">(</span><span class="s1">'UM5'</span><span class="p">);</span> +</pre></div> +</div> +<p>This function is useful when used with <a class="reference internal" href="#timezone_menu" title="timezone_menu"><code class="xref php php-func docutils literal"><span class="pre">timezone_menu()</span></code></a>.</p> +</dd></dl> + +<dl class="function"> +<dt id="timezone_menu"> +<code class="descname">timezone_menu</code><span class="sig-paren">(</span><span class="optional">[</span><em>$default = 'UTC'</em><span class="optional">[</span>, <em>$class = ''</em><span class="optional">[</span>, <em>$name = 'timezones'</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#timezone_menu" 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>$default</strong> (<em>string</em>) – Timezone</li> +<li><strong>$class</strong> (<em>string</em>) – Class name</li> +<li><strong>$name</strong> (<em>string</em>) – Menu name</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML drop down menu with time zones</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>Generates a pull-down menu of timezones, like this one:</p> +<form action="#"> + <select name="timezones"> + <option value='UM12'>(UTC -12:00) Baker/Howland Island</option> + <option value='UM11'>(UTC -11:00) Samoa Time Zone, Niue</option> + <option value='UM10'>(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti</option> + <option value='UM95'>(UTC -9:30) Marquesas Islands</option> + <option value='UM9'>(UTC -9:00) Alaska Standard Time, Gambier Islands</option> + <option value='UM8'>(UTC -8:00) Pacific Standard Time, Clipperton Island</option> + <option value='UM7'>(UTC -7:00) Mountain Standard Time</option> + <option value='UM6'>(UTC -6:00) Central Standard Time</option> + <option value='UM5'>(UTC -5:00) Eastern Standard Time, Western Caribbean Standard Time</option> + <option value='UM45'>(UTC -4:30) Venezuelan Standard Time</option> + <option value='UM4'>(UTC -4:00) Atlantic Standard Time, Eastern Caribbean Standard Time</option> + <option value='UM35'>(UTC -3:30) Newfoundland Standard Time</option> + <option value='UM3'>(UTC -3:00) Argentina, Brazil, French Guiana, Uruguay</option> + <option value='UM2'>(UTC -2:00) South Georgia/South Sandwich Islands</option> + <option value='UM1'>(UTC -1:00) Azores, Cape Verde Islands</option> + <option value='UTC' selected='selected'>(UTC) Greenwich Mean Time, Western European Time</option> + <option value='UP1'>(UTC +1:00) Central European Time, West Africa Time</option> + <option value='UP2'>(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time</option> + <option value='UP3'>(UTC +3:00) Moscow Time, East Africa Time</option> + <option value='UP35'>(UTC +3:30) Iran Standard Time</option> + <option value='UP4'>(UTC +4:00) Azerbaijan Standard Time, Samara Time</option> + <option value='UP45'>(UTC +4:30) Afghanistan</option> + <option value='UP5'>(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time</option> + <option value='UP55'>(UTC +5:30) Indian Standard Time, Sri Lanka Time</option> + <option value='UP575'>(UTC +5:45) Nepal Time</option> + <option value='UP6'>(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time</option> + <option value='UP65'>(UTC +6:30) Cocos Islands, Myanmar</option> + <option value='UP7'>(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam</option> + <option value='UP8'>(UTC +8:00) Australian Western Standard Time, Beijing Time, Irkutsk Time</option> + <option value='UP875'>(UTC +8:45) Australian Central Western Standard Time</option> + <option value='UP9'>(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk Time</option> + <option value='UP95'>(UTC +9:30) Australian Central Standard Time</option> + <option value='UP10'>(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time</option> + <option value='UP105'>(UTC +10:30) Lord Howe Island</option> + <option value='UP11'>(UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu</option> + <option value='UP115'>(UTC +11:30) Norfolk Island</option> + <option value='UP12'>(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time</option> + <option value='UP1275'>(UTC +12:45) Chatham Islands Standard Time</option> + <option value='UP13'>(UTC +13:00) Phoenix Islands Time, Tonga</option> + <option value='UP14'>(UTC +14:00) Line Islands</option> + </select> +</form><p>This menu is useful if you run a membership site in which your users are +allowed to set their local timezone value.</p> +<p>The first parameter lets you set the “selected” state of the menu. For +example, to set Pacific time as the default you will do this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">timezone_menu</span><span class="p">(</span><span class="s1">'UM8'</span><span class="p">);</span> +</pre></div> +</div> +<p>Please see the timezone reference below to see the values of this menu.</p> +<p>The second parameter lets you set a CSS class name for the menu.</p> +<p>The fourth parameter lets you set one or more attributes on the generated select tag.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The text contained in the menu is found in the following +language file: <cite>language/<your_lang>/date_lang.php</cite></p> +</div> +</dd></dl> + +</div> +<div class="section" id="timezone-reference"> +<h2><a class="toc-backref" href="#id3">Timezone Reference</a><a class="headerlink" href="#timezone-reference" title="Permalink to this headline">¶</a></h2> +<p>The following table indicates each timezone and its location.</p> +<p>Note some of the location lists have been abridged for clarity and formatting.</p> +<table border="1" class="docutils"> +<colgroup> +<col width="14%" /> +<col width="86%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Time Zone</th> +<th class="head">Location</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td>UM12</td> +<td>(UTC - 12:00) Baker/Howland Island</td> +</tr> +<tr class="row-odd"><td>UM11</td> +<td>(UTC - 11:00) Samoa Time Zone, Niue</td> +</tr> +<tr class="row-even"><td>UM10</td> +<td>(UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands</td> +</tr> +<tr class="row-odd"><td>UM95</td> +<td>(UTC - 09:30) Marquesas Islands</td> +</tr> +<tr class="row-even"><td>UM9</td> +<td>(UTC - 09:00) Alaska Standard Time, Gambier Islands</td> +</tr> +<tr class="row-odd"><td>UM8</td> +<td>(UTC - 08:00) Pacific Standard Time, Clipperton Island</td> +</tr> +<tr class="row-even"><td>UM7</td> +<td>(UTC - 07:00) Mountain Standard Time</td> +</tr> +<tr class="row-odd"><td>UM6</td> +<td>(UTC - 06:00) Central Standard Time</td> +</tr> +<tr class="row-even"><td>UM5</td> +<td>(UTC - 05:00) Eastern Standard Time, Western Caribbean</td> +</tr> +<tr class="row-odd"><td>UM45</td> +<td>(UTC - 04:30) Venezuelan Standard Time</td> +</tr> +<tr class="row-even"><td>UM4</td> +<td>(UTC - 04:00) Atlantic Standard Time, Eastern Caribbean</td> +</tr> +<tr class="row-odd"><td>UM35</td> +<td>(UTC - 03:30) Newfoundland Standard Time</td> +</tr> +<tr class="row-even"><td>UM3</td> +<td>(UTC - 03:00) Argentina, Brazil, French Guiana, Uruguay</td> +</tr> +<tr class="row-odd"><td>UM2</td> +<td>(UTC - 02:00) South Georgia/South Sandwich Islands</td> +</tr> +<tr class="row-even"><td>UM1</td> +<td>(UTC -1:00) Azores, Cape Verde Islands</td> +</tr> +<tr class="row-odd"><td>UTC</td> +<td>(UTC) Greenwich Mean Time, Western European Time</td> +</tr> +<tr class="row-even"><td>UP1</td> +<td>(UTC +1:00) Central European Time, West Africa Time</td> +</tr> +<tr class="row-odd"><td>UP2</td> +<td>(UTC +2:00) Central Africa Time, Eastern European Time</td> +</tr> +<tr class="row-even"><td>UP3</td> +<td>(UTC +3:00) Moscow Time, East Africa Time</td> +</tr> +<tr class="row-odd"><td>UP35</td> +<td>(UTC +3:30) Iran Standard Time</td> +</tr> +<tr class="row-even"><td>UP4</td> +<td>(UTC +4:00) Azerbaijan Standard Time, Samara Time</td> +</tr> +<tr class="row-odd"><td>UP45</td> +<td>(UTC +4:30) Afghanistan</td> +</tr> +<tr class="row-even"><td>UP5</td> +<td>(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time</td> +</tr> +<tr class="row-odd"><td>UP55</td> +<td>(UTC +5:30) Indian Standard Time, Sri Lanka Time</td> +</tr> +<tr class="row-even"><td>UP575</td> +<td>(UTC +5:45) Nepal Time</td> +</tr> +<tr class="row-odd"><td>UP6</td> +<td>(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time</td> +</tr> +<tr class="row-even"><td>UP65</td> +<td>(UTC +6:30) Cocos Islands, Myanmar</td> +</tr> +<tr class="row-odd"><td>UP7</td> +<td>(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam</td> +</tr> +<tr class="row-even"><td>UP8</td> +<td>(UTC +8:00) Australian Western Standard Time, Beijing Time</td> +</tr> +<tr class="row-odd"><td>UP875</td> +<td>(UTC +8:45) Australian Central Western Standard Time</td> +</tr> +<tr class="row-even"><td>UP9</td> +<td>(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk</td> +</tr> +<tr class="row-odd"><td>UP95</td> +<td>(UTC +9:30) Australian Central Standard Time</td> +</tr> +<tr class="row-even"><td>UP10</td> +<td>(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time</td> +</tr> +<tr class="row-odd"><td>UP105</td> +<td>(UTC +10:30) Lord Howe Island</td> +</tr> +<tr class="row-even"><td>UP11</td> +<td>(UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu</td> +</tr> +<tr class="row-odd"><td>UP115</td> +<td>(UTC +11:30) Norfolk Island</td> +</tr> +<tr class="row-even"><td>UP12</td> +<td>(UTC +12:00) Fiji, Gilbert Islands, Kamchatka, New Zealand</td> +</tr> +<tr class="row-odd"><td>UP1275</td> +<td>(UTC +12:45) Chatham Islands Standard Time</td> +</tr> +<tr class="row-even"><td>UP13</td> +<td>(UTC +13:00) Phoenix Islands Time, Tonga</td> +</tr> +<tr class="row-odd"><td>UP14</td> +<td>(UTC +14:00) Line Islands</td> +</tr> +</tbody> +</table> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="directory_helper.html" class="btn btn-neutral float-right" title="Directory Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="cookie_helper.html" class="btn btn-neutral" title="Cookie Helper"><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 Mar 22, 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.8', + 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/helpers/directory_helper.html b/user_guide/helpers/directory_helper.html new file mode 100644 index 000000000..5dc681d1c --- /dev/null +++ b/user_guide/helpers/directory_helper.html @@ -0,0 +1,587 @@ + + +<!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>Directory Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Download Helper" href="download_helper.html"/> + <link rel="prev" title="Date Helper" href="date_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Directory Helper</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="directory-helper"> +<h1>Directory Helper<a class="headerlink" href="#directory-helper" title="Permalink to this headline">¶</a></h1> +<p>The Directory Helper file contains functions that assist in working with +directories.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'directory'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="directory_map"> +<code class="descname">directory_map</code><span class="sig-paren">(</span><em>$source_dir</em><span class="optional">[</span>, <em>$directory_depth = 0</em><span class="optional">[</span>, <em>$hidden = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#directory_map" 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>$source_dir</strong> (<em>string</em>) – Path to the source directory</li> +<li><strong>$directory_depth</strong> (<em>int</em>) – Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc)</li> +<li><strong>$hidden</strong> (<em>bool</em>) – Whether to include hidden directories</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 files</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>Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$map</span> <span class="o">=</span> <span class="nx">directory_map</span><span class="p">(</span><span class="s1">'./mydirectory/'</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Paths are almost always relative to your main index.php file.</p> +</div> +<p>Sub-folders contained within the directory will be mapped as well. If +you wish to control the recursion depth, you can do so using the second +parameter (integer). A depth of 1 will only map the top level directory:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$map</span> <span class="o">=</span> <span class="nx">directory_map</span><span class="p">(</span><span class="s1">'./mydirectory/'</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span> +</pre></div> +</div> +<p>By default, hidden files will not be included in the returned array. To +override this behavior, you may set a third parameter to true (boolean):</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$map</span> <span class="o">=</span> <span class="nx">directory_map</span><span class="p">(</span><span class="s1">'./mydirectory/'</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +</pre></div> +</div> +<p>Each folder name will be an array index, while its contained files will +be numerically indexed. Here is an example of a typical array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">Array</span> <span class="p">(</span> + <span class="p">[</span><span class="nx">libraries</span><span class="p">]</span> <span class="o">=></span> <span class="k">Array</span> + <span class="p">(</span> + <span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=></span> <span class="nx">benchmark</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=></span> <span class="nx">config</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="s2">"database/"</span><span class="p">]</span> <span class="o">=></span> <span class="k">Array</span> + <span class="p">(</span> + <span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=></span> <span class="nx">query_builder</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=></span> <span class="nx">binds</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=></span> <span class="nx">configuration</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=></span> <span class="nx">connecting</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="o">=></span> <span class="nx">examples</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">5</span><span class="p">]</span> <span class="o">=></span> <span class="nx">fields</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">6</span><span class="p">]</span> <span class="o">=></span> <span class="nx">index</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">7</span><span class="p">]</span> <span class="o">=></span> <span class="nx">queries</span><span class="o">.</span><span class="nx">html</span> + <span class="p">)</span> + <span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=></span> <span class="nx">email</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=></span> <span class="nx">file_uploading</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">4</span><span class="p">]</span> <span class="o">=></span> <span class="nx">image_lib</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">5</span><span class="p">]</span> <span class="o">=></span> <span class="nx">input</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">6</span><span class="p">]</span> <span class="o">=></span> <span class="nx">language</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">7</span><span class="p">]</span> <span class="o">=></span> <span class="nx">loader</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">8</span><span class="p">]</span> <span class="o">=></span> <span class="nx">pagination</span><span class="o">.</span><span class="nx">html</span> + <span class="p">[</span><span class="mi">9</span><span class="p">]</span> <span class="o">=></span> <span class="nx">uri</span><span class="o">.</span><span class="nx">html</span> + <span class="p">)</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="download_helper.html" class="btn btn-neutral float-right" title="Download Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="date_helper.html" class="btn btn-neutral" title="Date Helper"><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 Mar 22, 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.8', + 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/helpers/download_helper.html b/user_guide/helpers/download_helper.html new file mode 100644 index 000000000..65c648a9b --- /dev/null +++ b/user_guide/helpers/download_helper.html @@ -0,0 +1,556 @@ + + +<!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>Download Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Email Helper" href="email_helper.html"/> + <link rel="prev" title="Directory Helper" href="directory_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Download Helper</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="download-helper"> +<h1>Download Helper<a class="headerlink" href="#download-helper" title="Permalink to this headline">¶</a></h1> +<p>The Download Helper lets you download data to your desktop.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'download'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="force_download"> +<code class="descname">force_download</code><span class="sig-paren">(</span><span class="optional">[</span><em>$filename = ''</em><span class="optional">[</span>, <em>$data = ''</em><span class="optional">[</span>, <em>$set_mime = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#force_download" 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>$filename</strong> (<em>string</em>) – Filename</li> +<li><strong>$data</strong> (<em>mixed</em>) – File contents</li> +<li><strong>$set_mime</strong> (<em>bool</em>) – Whether to try to send the actual MIME type</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>Generates server headers which force data to be downloaded to your +desktop. Useful with file downloads. The first parameter is the <strong>name +you want the downloaded file to be named</strong>, the second parameter is the +file data.</p> +<p>If you set the second parameter to NULL and <code class="docutils literal"><span class="pre">$filename</span></code> is an existing, readable +file path, then its content will be read instead.</p> +<p>If you set the third parameter to boolean TRUE, then the actual file MIME type +(based on the filename extension) will be sent, so that if your browser has a +handler for that type - it can use it.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$data</span> <span class="o">=</span> <span class="s1">'Here is some text!'</span><span class="p">;</span> +<span class="nv">$name</span> <span class="o">=</span> <span class="s1">'mytext.txt'</span><span class="p">;</span> +<span class="nx">force_download</span><span class="p">(</span><span class="nv">$name</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> +</pre></div> +</div> +<p>If you want to download an existing file from your server you’ll need to +do the following:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Contents of photo.jpg will be automatically read</span> +<span class="nx">force_download</span><span class="p">(</span><span class="s1">'/path/to/photo.jpg'</span><span class="p">,</span> <span class="k">NULL</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="email_helper.html" class="btn btn-neutral float-right" title="Email Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="directory_helper.html" class="btn btn-neutral" title="Directory Helper"><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 Mar 22, 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.8', + 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/helpers/email_helper.html b/user_guide/helpers/email_helper.html new file mode 100644 index 000000000..868b9b54e --- /dev/null +++ b/user_guide/helpers/email_helper.html @@ -0,0 +1,598 @@ + + +<!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>Email Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="File Helper" href="file_helper.html"/> + <link rel="prev" title="Download Helper" href="download_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Email Helper</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="email-helper"> +<h1>Email Helper<a class="headerlink" href="#email-helper" title="Permalink to this headline">¶</a></h1> +<p>The Email Helper provides some assistive functions for working with +Email. For a more robust email solution, see CodeIgniter’s <a class="reference internal" href="../libraries/email.html"><span class="doc">Email +Class</span></a>.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">The Email helper is DEPRECATED and is currently +only kept for backwards compatibility.</p> +</div> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'email'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="valid_email"> +<code class="descname">valid_email</code><span class="sig-paren">(</span><em>$email</em><span class="sig-paren">)</span><a class="headerlink" href="#valid_email" 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>$email</strong> (<em>string</em>) – E-mail address</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE if a valid email is supplied, 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>Checks if the input is a correctly formatted e-mail address. Note that is +doesn’t actually prove that the address will be able recieve mail, but +simply that it is a validly formed address.</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">valid_email</span><span class="p">(</span><span class="s1">'email@somesite.com'</span><span class="p">))</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="s1">'email is valid'</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="s1">'email is not valid'</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>All that this function does is to use PHP’s native <code class="docutils literal"><span class="pre">filter_var()</span></code>:</p> +<div class="last highlight-ci"><div class="highlight"><pre><span></span><span class="p">(</span><span class="nx">bool</span><span class="p">)</span> <span class="nb">filter_var</span><span class="p">(</span><span class="nv">$email</span><span class="p">,</span> <span class="nx">FILTER_VALIDATE_EMAIL</span><span class="p">);</span> +</pre></div> +</div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="send_email"> +<code class="descname">send_email</code><span class="sig-paren">(</span><em>$recipient</em>, <em>$subject</em>, <em>$message</em><span class="sig-paren">)</span><a class="headerlink" href="#send_email" 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>$recipient</strong> (<em>string</em>) – E-mail address</li> +<li><strong>$subject</strong> (<em>string</em>) – Mail subject</li> +<li><strong>$message</strong> (<em>string</em>) – Message body</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 mail was successfully sent, FALSE in case of an error</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>Sends an email using PHP’s native <a class="reference external" href="http://php.net/function.mail">mail()</a> +function.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>All that this function does is to use PHP’s native <code class="docutils literal"><span class="pre">mail</span></code></p> +<div class="last highlight-ci"><div class="highlight"><pre><span></span><span class="nb">mail</span><span class="p">(</span><span class="nv">$recipient</span><span class="p">,</span> <span class="nv">$subject</span><span class="p">,</span> <span class="nv">$message</span><span class="p">);</span> +</pre></div> +</div> +</div> +<p>For a more robust email solution, see CodeIgniter’s <a class="reference internal" href="../libraries/email.html"><span class="doc">Email Library</span></a>.</p> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="file_helper.html" class="btn btn-neutral float-right" title="File Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="download_helper.html" class="btn btn-neutral" title="Download Helper"><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 Mar 22, 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.8', + 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/helpers/file_helper.html b/user_guide/helpers/file_helper.html new file mode 100644 index 000000000..a3d13d3ac --- /dev/null +++ b/user_guide/helpers/file_helper.html @@ -0,0 +1,829 @@ + + +<!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>File Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Form Helper" href="form_helper.html"/> + <link rel="prev" title="Email Helper" href="email_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>File Helper</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="file-helper"> +<h1>File Helper<a class="headerlink" href="#file-helper" title="Permalink to this headline">¶</a></h1> +<p>The File Helper file contains functions that assist in working with files.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'file'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="read_file"> +<code class="descname">read_file</code><span class="sig-paren">(</span><em>$file</em><span class="sig-paren">)</span><a class="headerlink" href="#read_file" 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">File contents 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>Returns the data contained in the file specified in the path.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">read_file</span><span class="p">(</span><span class="s1">'./path/to/file.php'</span><span class="p">);</span> +</pre></div> +</div> +<p>The path can be a relative or full server path. Returns FALSE (boolean) on failure.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The path is relative to your main site index.php file, NOT your +controller or view files. CodeIgniter uses a front controller so paths +are always relative to the main site index.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">file_get_contents()</span></code> +instead.</p> +</div> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">If your server is running an <strong>open_basedir</strong> restriction this +function might not work if you are trying to access a file above the +calling script.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="write_file"> +<code class="descname">write_file</code><span class="sig-paren">(</span><em>$path</em>, <em>$data</em><span class="optional">[</span>, <em>$mode = 'wb'</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#write_file" 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>$path</strong> (<em>string</em>) – File path</li> +<li><strong>$data</strong> (<em>string</em>) – Data to write to file</li> +<li><strong>$mode</strong> (<em>string</em>) – <code class="docutils literal"><span class="pre">fopen()</span></code> mode</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 write was successful, FALSE in case of an error</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>Writes data to the file specified in the path. If the file does not exist then the +function will create it.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$data</span> <span class="o">=</span> <span class="s1">'Some file data'</span><span class="p">;</span> +<span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nx">write_file</span><span class="p">(</span><span class="s1">'./path/to/file.php'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">))</span> +<span class="p">{</span> + <span class="k">echo</span> <span class="s1">'Unable to write the file'</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="s1">'File written!'</span><span class="p">;</span> +<span class="p">}</span> +</pre></div> +</div> +<p>You can optionally set the write mode via the third parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">write_file</span><span class="p">(</span><span class="s1">'./path/to/file.php'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">,</span> <span class="s1">'r+'</span><span class="p">);</span> +</pre></div> +</div> +<p>The default mode is ‘wb’. Please see the <a class="reference external" href="http://php.net/manual/en/function.fopen.php">PHP user guide</a> +for mode options.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The path is relative to your main site index.php file, NOT your +controller or view files. CodeIgniter uses a front controller so paths +are always relative to the main site index.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function acquires an exclusive lock on the file while writing to it.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="delete_files"> +<code class="descname">delete_files</code><span class="sig-paren">(</span><em>$path</em><span class="optional">[</span>, <em>$del_dir = FALSE</em><span class="optional">[</span>, <em>$htdocs = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#delete_files" 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>$path</strong> (<em>string</em>) – Directory path</li> +<li><strong>$del_dir</strong> (<em>bool</em>) – Whether to also delete directories</li> +<li><strong>$htdocs</strong> (<em>bool</em>) – Whether to skip deleting .htaccess and index page files</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE on success, FALSE in case of an error</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>Deletes ALL files contained in the supplied path.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">delete_files</span><span class="p">(</span><span class="s1">'./path/to/directory/'</span><span class="p">);</span> +</pre></div> +</div> +<p>If the second parameter is set to TRUE, any directories contained within the supplied +root path will be deleted as well.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">delete_files</span><span class="p">(</span><span class="s1">'./path/to/directory/'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The files must be writable or owned by the system in order to be deleted.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="get_filenames"> +<code class="descname">get_filenames</code><span class="sig-paren">(</span><em>$source_dir</em><span class="optional">[</span>, <em>$include_path = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#get_filenames" 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>$source_dir</strong> (<em>string</em>) – Directory path</li> +<li><strong>$include_path</strong> (<em>bool</em>) – Whether to include the path as part of the filenames</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 file names</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>Takes a server path as input and returns an array containing the names of all files +contained within it. The file path can optionally be added to the file names by setting +the second parameter to TRUE.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$controllers</span> <span class="o">=</span> <span class="nx">get_filenames</span><span class="p">(</span><span class="nx">APPPATH</span><span class="o">.</span><span class="s1">'controllers/'</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="get_dir_file_info"> +<code class="descname">get_dir_file_info</code><span class="sig-paren">(</span><em>$source_dir</em>, <em>$top_level_only</em><span class="sig-paren">)</span><a class="headerlink" href="#get_dir_file_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>$source_dir</strong> (<em>string</em>) – Directory path</li> +<li><strong>$top_level_only</strong> (<em>bool</em>) – Whether to look only at the specified directory (excluding sub-directories)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An array containing info on the supplied directory’s contents</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>Reads the specified directory and builds an array containing the filenames, filesize, +dates, and permissions. Sub-folders contained within the specified path are only read +if forced by sending the second parameter to FALSE, as this can be an intensive +operation.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$models_info</span> <span class="o">=</span> <span class="nx">get_dir_file_info</span><span class="p">(</span><span class="nx">APPPATH</span><span class="o">.</span><span class="s1">'models/'</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="get_file_info"> +<code class="descname">get_file_info</code><span class="sig-paren">(</span><em>$file</em><span class="optional">[</span>, <em>$returned_values = array('name'</em>, <em>'server_path'</em>, <em>'size'</em>, <em>'date')</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#get_file_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>$file</strong> (<em>string</em>) – File path</li> +<li><strong>$returned_values</strong> (<em>array</em>) – What type of info to return</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An array containing info on the specified file 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">array</p> +</td> +</tr> +</tbody> +</table> +<p>Given a file and path, returns (optionally) the <em>name</em>, <em>path</em>, <em>size</em> and <em>date modified</em> +information attributes for a file. Second parameter allows you to explicitly declare what +information you want returned.</p> +<p>Valid <code class="docutils literal"><span class="pre">$returned_values</span></code> options are: <cite>name</cite>, <cite>size</cite>, <cite>date</cite>, <cite>readable</cite>, <cite>writeable</cite>, +<cite>executable</cite> and <cite>fileperms</cite>.</p> +</dd></dl> + +<dl class="function"> +<dt id="get_mime_by_extension"> +<code class="descname">get_mime_by_extension</code><span class="sig-paren">(</span><em>$filename</em><span class="sig-paren">)</span><a class="headerlink" href="#get_mime_by_extension" 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>$filename</strong> (<em>string</em>) – File name</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">MIME type 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>Translates a filename extension into a MIME type based on <em>config/mimes.php</em>. +Returns FALSE if it can’t determine the type, or read the MIME config file.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$file</span> <span class="o">=</span> <span class="s1">'somefile.png'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nv">$file</span><span class="o">.</span><span class="s1">' is has a mime type of '</span><span class="o">.</span><span class="nx">get_mime_by_extension</span><span class="p">(</span><span class="nv">$file</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This is not an accurate way of determining file MIME types, and +is here strictly for convenience. It should not be used for security +purposes.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="symbolic_permissions"> +<code class="descname">symbolic_permissions</code><span class="sig-paren">(</span><em>$perms</em><span class="sig-paren">)</span><a class="headerlink" href="#symbolic_permissions" 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>$perms</strong> (<em>int</em>) – Permissions</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Symbolic permissions 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>Takes numeric permissions (such as is returned by <code class="docutils literal"><span class="pre">fileperms()</span></code>) and returns +standard symbolic notation of file permissions.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">symbolic_permissions</span><span class="p">(</span><span class="nb">fileperms</span><span class="p">(</span><span class="s1">'./index.php'</span><span class="p">));</span> <span class="c1">// -rw-r--r--</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="octal_permissions"> +<code class="descname">octal_permissions</code><span class="sig-paren">(</span><em>$perms</em><span class="sig-paren">)</span><a class="headerlink" href="#octal_permissions" 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>$perms</strong> (<em>int</em>) – Permissions</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Octal permissions 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>Takes numeric permissions (such as is returned by <code class="docutils literal"><span class="pre">fileperms()</span></code>) and returns +a three character octal notation of file permissions.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">octal_permissions</span><span class="p">(</span><span class="nb">fileperms</span><span class="p">(</span><span class="s1">'./index.php'</span><span class="p">));</span> <span class="c1">// 644</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="form_helper.html" class="btn btn-neutral float-right" title="Form Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="email_helper.html" class="btn btn-neutral" title="Email Helper"><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 Mar 22, 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.8', + 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/helpers/form_helper.html b/user_guide/helpers/form_helper.html new file mode 100644 index 000000000..13cb6a691 --- /dev/null +++ b/user_guide/helpers/form_helper.html @@ -0,0 +1,1598 @@ + + +<!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>Form Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="HTML Helper" href="html_helper.html"/> + <link rel="prev" title="File Helper" href="file_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Form Helper</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="form-helper"> +<h1>Form Helper<a class="headerlink" href="#form-helper" title="Permalink to this headline">¶</a></h1> +<p>The Form Helper file contains functions that assist in working with +forms.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#escaping-field-values" id="id2">Escaping field values</a></li> +<li><a class="reference internal" href="#available-functions" id="id3">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'form'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="escaping-field-values"> +<h2><a class="toc-backref" href="#id2">Escaping field values</a><a class="headerlink" href="#escaping-field-values" title="Permalink to this headline">¶</a></h2> +<p>You may need to use HTML and characters such as quotes within your form +elements. In order to do that safely, you’ll need to use +<a class="reference internal" href="../general/common_functions.html"><span class="doc">common function</span></a> +<code class="xref py py-func docutils literal"><span class="pre">html_escape()</span></code>.</p> +<p>Consider the following example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s1">'Here is a string containing "quoted" text.'</span><span class="p">;</span> + +<span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"text"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"myfield"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"<?php echo </span><span class="si">$string</span><span class="s2">; ?>"</span> <span class="o">/></span> +</pre></div> +</div> +<p>Since the above string contains a set of quotes, it will cause the form +to break. The <a class="reference internal" href="../general/common_functions.html#html_escape" title="html_escape"><code class="xref php php-func docutils literal"><span class="pre">html_escape()</span></code></a> function converts HTML special +characters so that it can be used safely:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"text"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"myfield"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"<?php echo html_escape(</span><span class="si">$string</span><span class="s2">); ?>"</span> <span class="o">/></span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you use any of the form helper functions listed on this page, +the form values will be automatically escaped, so there is no need +to call this function. Use it only if you are creating your own +form elements.</p> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id3">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="form_open"> +<code class="descname">form_open</code><span class="sig-paren">(</span><span class="optional">[</span><em>$action = ''</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">[</span>, <em>$hidden = array()</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_open" 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>$action</strong> (<em>string</em>) – Form action/target URI string</li> +<li><strong>$attributes</strong> (<em>array</em>) – HTML attributes</li> +<li><strong>$hidden</strong> (<em>array</em>) – An array of hidden fields’ definitions</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML form opening tag</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>Creates an opening form tag with a base URL <strong>built from your config preferences</strong>. +It will optionally let you add form attributes and hidden input fields, and +will always add the <cite>accept-charset</cite> attribute based on the charset value in your +config file.</p> +<p>The main benefit of using this tag rather than hard coding your own HTML is that +it permits your site to be more portable in the event your URLs ever change.</p> +<p>Here’s a simple example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_open</span><span class="p">(</span><span class="s1">'email/send'</span><span class="p">);</span> +</pre></div> +</div> +<p>The above example would create a form that points to your base URL plus the +“email/send” URI segments, like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">form</span> <span class="nx">method</span><span class="o">=</span><span class="s2">"post"</span> <span class="nx">accept</span><span class="o">-</span><span class="nx">charset</span><span class="o">=</span><span class="s2">"utf-8"</span> <span class="nx">action</span><span class="o">=</span><span class="s2">"http://example.com/index.php/email/send"</span><span class="o">></span> +</pre></div> +</div> +<p><strong>Adding Attributes</strong></p> +<blockquote> +<div><p>Attributes can be added by passing an associative array to the second +parameter, like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$attributes</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">'email'</span><span class="p">,</span> <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'myform'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">form_open</span><span class="p">(</span><span class="s1">'email/send'</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span> +</pre></div> +</div> +<p>Alternatively, you can specify the second parameter as a string:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_open</span><span class="p">(</span><span class="s1">'email/send'</span><span class="p">,</span> <span class="s1">'class="email" id="myform"'</span><span class="p">);</span> +</pre></div> +</div> +<p>The above examples would create a form similar to this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">form</span> <span class="nx">method</span><span class="o">=</span><span class="s2">"post"</span> <span class="nx">accept</span><span class="o">-</span><span class="nx">charset</span><span class="o">=</span><span class="s2">"utf-8"</span> <span class="nx">action</span><span class="o">=</span><span class="s2">"http://example.com/index.php/email/send"</span> <span class="nx">class</span><span class="o">=</span><span class="s2">"email"</span> <span class="nx">id</span><span class="o">=</span><span class="s2">"myform"</span><span class="o">></span> +</pre></div> +</div> +</div></blockquote> +<p><strong>Adding Hidden Input Fields</strong></p> +<blockquote> +<div><p>Hidden fields can be added by passing an associative array to the +third parameter, like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$hidden</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'username'</span> <span class="o">=></span> <span class="s1">'Joe'</span><span class="p">,</span> <span class="s1">'member_id'</span> <span class="o">=></span> <span class="s1">'234'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">form_open</span><span class="p">(</span><span class="s1">'email/send'</span><span class="p">,</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$hidden</span><span class="p">);</span> +</pre></div> +</div> +<p>You can skip the second parameter by passing any falsy value to it.</p> +<p>The above example would create a form similar to this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">form</span> <span class="nx">method</span><span class="o">=</span><span class="s2">"post"</span> <span class="nx">accept</span><span class="o">-</span><span class="nx">charset</span><span class="o">=</span><span class="s2">"utf-8"</span> <span class="nx">action</span><span class="o">=</span><span class="s2">"http://example.com/index.php/email/send"</span><span class="o">></span> + <span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"hidden"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"username"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"Joe"</span> <span class="o">/></span> + <span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"hidden"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"member_id"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"234"</span> <span class="o">/></span> +</pre></div> +</div> +</div></blockquote> +</dd></dl> + +<dl class="function"> +<dt id="form_open_multipart"> +<code class="descname">form_open_multipart</code><span class="sig-paren">(</span><span class="optional">[</span><em>$action = ''</em><span class="optional">[</span>, <em>$attributes = array()</em><span class="optional">[</span>, <em>$hidden = array()</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_open_multipart" 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>$action</strong> (<em>string</em>) – Form action/target URI string</li> +<li><strong>$attributes</strong> (<em>array</em>) – HTML attributes</li> +<li><strong>$hidden</strong> (<em>array</em>) – An array of hidden fields’ definitions</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML multipart form opening tag</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 is absolutely identical to <a class="reference internal" href="#form_open" title="form_open"><code class="xref php php-func docutils literal"><span class="pre">form_open()</span></code></a> above, +except that it adds a <em>multipart</em> attribute, which is necessary if you +would like to use the form to upload files with.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_hidden"> +<code class="descname">form_hidden</code><span class="sig-paren">(</span><em>$name</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_hidden" 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>$name</strong> (<em>string</em>) – Field name</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML hidden input field tag</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>Lets you generate hidden input fields. You can either submit a +name/value string to create one field:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">form_hidden</span><span class="p">(</span><span class="s1">'username'</span><span class="p">,</span> <span class="s1">'johndoe'</span><span class="p">);</span> +<span class="c1">// Would produce: <input type="hidden" name="username" value="johndoe" /></span> +</pre></div> +</div> +<p>… or you can submit an associative array to create multiple fields:</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">'name'</span> <span class="o">=></span> <span class="s1">'John Doe'</span><span class="p">,</span> + <span class="s1">'email'</span> <span class="o">=></span> <span class="s1">'john@example.com'</span><span class="p">,</span> + <span class="s1">'url'</span> <span class="o">=></span> <span class="s1">'http://example.com'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_hidden</span><span class="p">(</span><span class="nv">$data</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce:</span> +<span class="cm"> <input type="hidden" name="name" value="John Doe" /></span> +<span class="cm"> <input type="hidden" name="email" value="john@example.com" /></span> +<span class="cm"> <input type="hidden" name="url" value="http://example.com" /></span> +<span class="cm">*/</span> +</pre></div> +</div> +<p>You can also pass an associative array to the value field:</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">'name'</span> <span class="o">=></span> <span class="s1">'John Doe'</span><span class="p">,</span> + <span class="s1">'email'</span> <span class="o">=></span> <span class="s1">'john@example.com'</span><span class="p">,</span> + <span class="s1">'url'</span> <span class="o">=></span> <span class="s1">'http://example.com'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_hidden</span><span class="p">(</span><span class="s1">'my_array'</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce:</span> + +<span class="cm"> <input type="hidden" name="my_array[name]" value="John Doe" /></span> +<span class="cm"> <input type="hidden" name="my_array[email]" value="john@example.com" /></span> +<span class="cm"> <input type="hidden" name="my_array[url]" value="http://example.com" /></span> +<span class="cm">*/</span> +</pre></div> +</div> +<p>If you want to create hidden input fields with extra attributes:</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">'type'</span> <span class="o">=></span> <span class="s1">'hidden'</span><span class="p">,</span> + <span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'email'</span><span class="p">,</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'hiddenemail'</span><span class="p">,</span> + <span class="s1">'value'</span> <span class="o">=></span> <span class="s1">'john@example.com'</span><span class="p">,</span> + <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'hiddenemail'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_input</span><span class="p">(</span><span class="nv">$data</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce:</span> + +<span class="cm"> <input type="hidden" name="email" value="john@example.com" id="hiddenemail" class="hiddenemail" /></span> +<span class="cm">*/</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_input"> +<code class="descname">form_input</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_input" 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>) – Field attributes data</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML text input field tag</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>Lets you generate a standard text input field. You can minimally pass +the field name and value in the first and second parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_input</span><span class="p">(</span><span class="s1">'username'</span><span class="p">,</span> <span class="s1">'johndoe'</span><span class="p">);</span> +</pre></div> +</div> +<p>Or you can pass an associative array containing any data you wish your +form to contain:</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">'name'</span> <span class="o">=></span> <span class="s1">'username'</span><span class="p">,</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'username'</span><span class="p">,</span> + <span class="s1">'value'</span> <span class="o">=></span> <span class="s1">'johndoe'</span><span class="p">,</span> + <span class="s1">'maxlength'</span> <span class="o">=></span> <span class="s1">'100'</span><span class="p">,</span> + <span class="s1">'size'</span> <span class="o">=></span> <span class="s1">'50'</span><span class="p">,</span> + <span class="s1">'style'</span> <span class="o">=></span> <span class="s1">'width:50%'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_input</span><span class="p">(</span><span class="nv">$data</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce:</span> + +<span class="cm"> <input type="text" name="username" value="johndoe" id="username" maxlength="100" size="50" style="width:50%" /></span> +<span class="cm">*/</span> +</pre></div> +</div> +<p>If you would like your form to contain some additional data, like +JavaScript, you can pass it as a string in the third parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="s1">'onClick="some_function()"'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_input</span><span class="p">(</span><span class="s1">'username'</span><span class="p">,</span> <span class="s1">'johndoe'</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +<p>Or you can pass it as an array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'onClick'</span> <span class="o">=></span> <span class="s1">'some_function();'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">form_input</span><span class="p">(</span><span class="s1">'username'</span><span class="p">,</span> <span class="s1">'johndoe'</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_password"> +<code class="descname">form_password</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_password" 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>) – Field attributes data</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML password input field tag</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 is identical in all respects to the <a class="reference internal" href="#form_input" title="form_input"><code class="xref php php-func docutils literal"><span class="pre">form_input()</span></code></a> +function above except that it uses the “password” input type.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_upload"> +<code class="descname">form_upload</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_upload" 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>) – Field attributes data</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML file upload input field tag</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 is identical in all respects to the <a class="reference internal" href="#form_input" title="form_input"><code class="xref php php-func docutils literal"><span class="pre">form_input()</span></code></a> +function above except that it uses the “file” input type, allowing it to +be used to upload files.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_textarea"> +<code class="descname">form_textarea</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_textarea" 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>) – Field attributes data</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML textarea tag</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 is identical in all respects to the <a class="reference internal" href="#form_input" title="form_input"><code class="xref php php-func docutils literal"><span class="pre">form_input()</span></code></a> +function above except that it generates a “textarea” type.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Instead of the <em>maxlength</em> and <em>size</em> attributes in the above example, +you will instead specify <em>rows</em> and <em>cols</em>.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_dropdown"> +<code class="descname">form_dropdown</code><span class="sig-paren">(</span><span class="optional">[</span><em>$name = ''</em><span class="optional">[</span>, <em>$options = array()</em><span class="optional">[</span>, <em>$selected = array()</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_dropdown" 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>$name</strong> (<em>string</em>) – Field name</li> +<li><strong>$options</strong> (<em>array</em>) – An associative array of options to be listed</li> +<li><strong>$selected</strong> (<em>array</em>) – List of fields to mark with the <em>selected</em> attribute</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML dropdown select field tag</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>Lets you create a standard drop-down field. The first parameter will +contain the name of the field, the second parameter will contain an +associative array of options, and the third parameter will contain the +value you wish to be selected. You can also pass an array of multiple +items through the third parameter, and CodeIgniter will create a +multiple select for you.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$options</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'small'</span> <span class="o">=></span> <span class="s1">'Small Shirt'</span><span class="p">,</span> + <span class="s1">'med'</span> <span class="o">=></span> <span class="s1">'Medium Shirt'</span><span class="p">,</span> + <span class="s1">'large'</span> <span class="o">=></span> <span class="s1">'Large Shirt'</span><span class="p">,</span> + <span class="s1">'xlarge'</span> <span class="o">=></span> <span class="s1">'Extra Large Shirt'</span><span class="p">,</span> +<span class="p">);</span> + +<span class="nv">$shirts_on_sale</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'small'</span><span class="p">,</span> <span class="s1">'large'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">form_dropdown</span><span class="p">(</span><span class="s1">'shirts'</span><span class="p">,</span> <span class="nv">$options</span><span class="p">,</span> <span class="s1">'large'</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce:</span> + +<span class="cm"> <select name="shirts"></span> +<span class="cm"> <option value="small">Small Shirt</option></span> +<span class="cm"> <option value="med">Medium Shirt</option></span> +<span class="cm"> <option value="large" selected="selected">Large Shirt</option></span> +<span class="cm"> <option value="xlarge">Extra Large Shirt</option></span> +<span class="cm"> </select></span> +<span class="cm">*/</span> + +<span class="k">echo</span> <span class="nx">form_dropdown</span><span class="p">(</span><span class="s1">'shirts'</span><span class="p">,</span> <span class="nv">$options</span><span class="p">,</span> <span class="nv">$shirts_on_sale</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce:</span> + +<span class="cm"> <select name="shirts" multiple="multiple"></span> +<span class="cm"> <option value="small" selected="selected">Small Shirt</option></span> +<span class="cm"> <option value="med">Medium Shirt</option></span> +<span class="cm"> <option value="large" selected="selected">Large Shirt</option></span> +<span class="cm"> <option value="xlarge">Extra Large Shirt</option></span> +<span class="cm"> </select></span> +<span class="cm">*/</span> +</pre></div> +</div> +<p>If you would like the opening <select> to contain additional data, like +an id attribute or JavaScript, you can pass it as a string in the fourth +parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="s1">'id="shirts" onChange="some_function();"'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_dropdown</span><span class="p">(</span><span class="s1">'shirts'</span><span class="p">,</span> <span class="nv">$options</span><span class="p">,</span> <span class="s1">'large'</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +<p>Or you can pass it as an array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'shirts'</span><span class="p">,</span> + <span class="s1">'onChange'</span> <span class="o">=></span> <span class="s1">'some_function();'</span> +<span class="p">);</span> +<span class="k">echo</span> <span class="nx">form_dropdown</span><span class="p">(</span><span class="s1">'shirts'</span><span class="p">,</span> <span class="nv">$options</span><span class="p">,</span> <span class="s1">'large'</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +<p>If the array passed as <code class="docutils literal"><span class="pre">$options</span></code> is a multidimensional array, then +<code class="docutils literal"><span class="pre">form_dropdown()</span></code> will produce an <optgroup> with the array key as the +label.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_multiselect"> +<code class="descname">form_multiselect</code><span class="sig-paren">(</span><span class="optional">[</span><em>$name = ''</em><span class="optional">[</span>, <em>$options = array()</em><span class="optional">[</span>, <em>$selected = array()</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_multiselect" 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>$name</strong> (<em>string</em>) – Field name</li> +<li><strong>$options</strong> (<em>array</em>) – An associative array of options to be listed</li> +<li><strong>$selected</strong> (<em>array</em>) – List of fields to mark with the <em>selected</em> attribute</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML dropdown multiselect field tag</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>Lets you create a standard multiselect field. The first parameter will +contain the name of the field, the second parameter will contain an +associative array of options, and the third parameter will contain the +value or values you wish to be selected.</p> +<p>The parameter usage is identical to using <a class="reference internal" href="#form_dropdown" title="form_dropdown"><code class="xref php php-func docutils literal"><span class="pre">form_dropdown()</span></code></a> above, +except of course that the name of the field will need to use POST array +syntax, e.g. foo[].</p> +</dd></dl> + +<dl class="function"> +<dt id="form_fieldset"> +<code class="descname">form_fieldset</code><span class="sig-paren">(</span><span class="optional">[</span><em>$legend_text = ''</em><span class="optional">[</span>, <em>$attributes = array()</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_fieldset" 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>$legend_text</strong> (<em>string</em>) – Text to put in the <legend> tag</li> +<li><strong>$attributes</strong> (<em>array</em>) – Attributes to be set on the <fieldset> tag</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML fieldset opening tag</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>Lets you generate fieldset/legend fields.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_fieldset</span><span class="p">(</span><span class="s1">'Address Information'</span><span class="p">);</span> +<span class="k">echo</span> <span class="s2">"<p>fieldset content here</p></span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_fieldset_close</span><span class="p">();</span> + +<span class="cm">/*</span> +<span class="cm"> Produces:</span> + +<span class="cm"> <fieldset></span> +<span class="cm"> <legend>Address Information</legend></span> +<span class="cm"> <p>form content here</p></span> +<span class="cm"> </fieldset></span> +<span class="cm">*/</span> +</pre></div> +</div> +<p>Similar to other functions, you can submit an associative array in the +second parameter if you prefer to set additional attributes:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$attributes</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'address_info'</span><span class="p">,</span> + <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'address_info'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_fieldset</span><span class="p">(</span><span class="s1">'Address Information'</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span> +<span class="k">echo</span> <span class="s2">"<p>fieldset content here</p></span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_fieldset_close</span><span class="p">();</span> + +<span class="cm">/*</span> +<span class="cm"> Produces:</span> + +<span class="cm"> <fieldset id="address_info" class="address_info"></span> +<span class="cm"> <legend>Address Information</legend></span> +<span class="cm"> <p>form content here</p></span> +<span class="cm"> </fieldset></span> +<span class="cm">*/</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_fieldset_close"> +<code class="descname">form_fieldset_close</code><span class="sig-paren">(</span><span class="optional">[</span><em>$extra = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_fieldset_close" 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>$extra</strong> (<em>string</em>) – Anything to append after the closing tag, <em>as is</em></li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML fieldset closing tag</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>Produces a closing </fieldset> tag. The only advantage to using this +function is it permits you to pass data to it which will be added below +the tag. For example</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s1">'</div></div>'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_fieldset_close</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +<span class="c1">// Would produce: </fieldset></div></div></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_checkbox"> +<code class="descname">form_checkbox</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$checked = FALSE</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_checkbox" 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>) – Field attributes data</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +<li><strong>$checked</strong> (<em>bool</em>) – Whether to mark the checkbox as being <em>checked</em></li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML checkbox input tag</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>Lets you generate a checkbox field. Simple example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_checkbox</span><span class="p">(</span><span class="s1">'newsletter'</span><span class="p">,</span> <span class="s1">'accept'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +<span class="c1">// Would produce: <input type="checkbox" name="newsletter" value="accept" checked="checked" /></span> +</pre></div> +</div> +<p>The third parameter contains a boolean TRUE/FALSE to determine whether +the box should be checked or not.</p> +<p>Similar to the other form functions in this helper, you can also pass an +array of attributes to the function:</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">'name'</span> <span class="o">=></span> <span class="s1">'newsletter'</span><span class="p">,</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'newsletter'</span><span class="p">,</span> + <span class="s1">'value'</span> <span class="o">=></span> <span class="s1">'accept'</span><span class="p">,</span> + <span class="s1">'checked'</span> <span class="o">=></span> <span class="k">TRUE</span><span class="p">,</span> + <span class="s1">'style'</span> <span class="o">=></span> <span class="s1">'margin:10px'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_checkbox</span><span class="p">(</span><span class="nv">$data</span><span class="p">);</span> +<span class="c1">// Would produce: <input type="checkbox" name="newsletter" id="newsletter" value="accept" checked="checked" style="margin:10px" /></span> +</pre></div> +</div> +<p>Also as with other functions, if you would like the tag to contain +additional data like JavaScript, you can pass it as a string in the +fourth parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="s1">'onClick="some_function()"'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_checkbox</span><span class="p">(</span><span class="s1">'newsletter'</span><span class="p">,</span> <span class="s1">'accept'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +<p>Or you can pass it as an array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'onClick'</span> <span class="o">=></span> <span class="s1">'some_function();'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">form_checkbox</span><span class="p">(</span><span class="s1">'newsletter'</span><span class="p">,</span> <span class="s1">'accept'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_radio"> +<code class="descname">form_radio</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$checked = FALSE</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_radio" 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>) – Field attributes data</li> +<li><strong>$value</strong> (<em>string</em>) – Field value</li> +<li><strong>$checked</strong> (<em>bool</em>) – Whether to mark the radio button as being <em>checked</em></li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML radio input tag</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 is identical in all respects to the <a class="reference internal" href="#form_checkbox" title="form_checkbox"><code class="xref php php-func docutils literal"><span class="pre">form_checkbox()</span></code></a> +function above except that it uses the “radio” input type.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_label"> +<code class="descname">form_label</code><span class="sig-paren">(</span><span class="optional">[</span><em>$label_text = ''</em><span class="optional">[</span>, <em>$id = ''</em><span class="optional">[</span>, <em>$attributes = array()</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_label" 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>$label_text</strong> (<em>string</em>) – Text to put in the <label> tag</li> +<li><strong>$id</strong> (<em>string</em>) – ID of the form element that we’re making a label for</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML field label tag</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>Lets you generate a <label>. Simple example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_label</span><span class="p">(</span><span class="s1">'What is your Name'</span><span class="p">,</span> <span class="s1">'username'</span><span class="p">);</span> +<span class="c1">// Would produce: <label for="username">What is your Name</label></span> +</pre></div> +</div> +<p>Similar to other functions, you can submit an associative array in the +third parameter if you prefer to set additional attributes.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$attributes</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">'mycustomclass'</span><span class="p">,</span> + <span class="s1">'style'</span> <span class="o">=></span> <span class="s1">'color: #000;'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_label</span><span class="p">(</span><span class="s1">'What is your Name'</span><span class="p">,</span> <span class="s1">'username'</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span> +<span class="c1">// Would produce: <label for="username" class="mycustomclass" style="color: #000;">What is your Name</label></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_submit"> +<code class="descname">form_submit</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_submit" 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>string</em>) – Button name</li> +<li><strong>$value</strong> (<em>string</em>) – Button value</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML input submit tag</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>Lets you generate a standard submit button. Simple example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_submit</span><span class="p">(</span><span class="s1">'mysubmit'</span><span class="p">,</span> <span class="s1">'Submit Post!'</span><span class="p">);</span> +<span class="c1">// Would produce: <input type="submit" name="mysubmit" value="Submit Post!" /></span> +</pre></div> +</div> +<p>Similar to other functions, you can submit an associative array in the +first parameter if you prefer to set your own attributes. The third +parameter lets you add extra data to your form, like JavaScript.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_reset"> +<code class="descname">form_reset</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_reset" 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>string</em>) – Button name</li> +<li><strong>$value</strong> (<em>string</em>) – Button value</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML input reset button tag</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>Lets you generate a standard reset button. Use is identical to +<code class="xref py py-func docutils literal"><span class="pre">form_submit()</span></code>.</p> +</dd></dl> + +<dl class="function"> +<dt id="form_button"> +<code class="descname">form_button</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$content = ''</em><span class="optional">[</span>, <em>$extra = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_button" 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>string</em>) – Button name</li> +<li><strong>$content</strong> (<em>string</em>) – Button label</li> +<li><strong>$extra</strong> (<em>mixed</em>) – Extra attributes to be added to the tag either as an array or a literal string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML button tag</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>Lets you generate a standard button element. You can minimally pass the +button name and content in the first and second parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">form_button</span><span class="p">(</span><span class="s1">'name'</span><span class="p">,</span><span class="s1">'content'</span><span class="p">);</span> +<span class="c1">// Would produce: <button name="name" type="button">Content</button></span> +</pre></div> +</div> +<p>Or you can pass an associative array containing any data you wish your +form to contain:</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">'name'</span> <span class="o">=></span> <span class="s1">'button'</span><span class="p">,</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'button'</span><span class="p">,</span> + <span class="s1">'value'</span> <span class="o">=></span> <span class="s1">'true'</span><span class="p">,</span> + <span class="s1">'type'</span> <span class="o">=></span> <span class="s1">'reset'</span><span class="p">,</span> + <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'Reset'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">form_button</span><span class="p">(</span><span class="nv">$data</span><span class="p">);</span> +<span class="c1">// Would produce: <button name="button" id="button" value="true" type="reset">Reset</button></span> +</pre></div> +</div> +<p>If you would like your form to contain some additional data, like +JavaScript, you can pass it as a string in the third parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$js</span> <span class="o">=</span> <span class="s1">'onClick="some_function()"'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_button</span><span class="p">(</span><span class="s1">'mybutton'</span><span class="p">,</span> <span class="s1">'Click Me'</span><span class="p">,</span> <span class="nv">$js</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_close"> +<code class="descname">form_close</code><span class="sig-paren">(</span><span class="optional">[</span><em>$extra = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_close" 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>$extra</strong> (<em>string</em>) – Anything to append after the closing tag, <em>as is</em></li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An HTML form closing tag</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>Produces a closing </form> tag. The only advantage to using this +function is it permits you to pass data to it which will be added below +the tag. For example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s1">'</div></div>'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">form_close</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +<span class="c1">// Would produce: </form> </div></div></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="set_value"> +<code class="descname">set_value</code><span class="sig-paren">(</span><em>$field</em><span class="optional">[</span>, <em>$default = ''</em><span class="optional">[</span>, <em>$html_escape = TRUE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_value" 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>$field</strong> (<em>string</em>) – Field name</li> +<li><strong>$default</strong> (<em>string</em>) – Default value</li> +<li><strong>$html_escape</strong> (<em>bool</em>) – Whether to turn off HTML escaping of the value</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Field value</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>Permits you to set the value of an input form or textarea. You must +supply the field name via the first parameter of the function. The +second (optional) parameter allows you to set a default value for the +form. The third (optional) parameter allows you to turn off HTML escaping +of the value, in case you need to use this function in combination with +i.e. <a class="reference internal" href="#form_input" title="form_input"><code class="xref php php-func docutils literal"><span class="pre">form_input()</span></code></a> and avoid double-escaping.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"text"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"quantity"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"<?php echo set_value('quantity', '0'); ?>"</span> <span class="nx">size</span><span class="o">=</span><span class="s2">"50"</span> <span class="o">/></span> +</pre></div> +</div> +<p>The above form will show “0” when loaded for the first time.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you’ve loaded the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a> and +have set a validation rule for the field name in use with this helper, then it will +forward the call to the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a>’s +own <code class="docutils literal"><span class="pre">set_value()</span></code> method. Otherwise, this function looks in <code class="docutils literal"><span class="pre">$_POST</span></code> for the +field value.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="set_select"> +<code class="descname">set_select</code><span class="sig-paren">(</span><em>$field</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$default = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_select" 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>$field</strong> (<em>string</em>) – Field name</li> +<li><strong>$value</strong> (<em>string</em>) – Value to check for</li> +<li><strong>$default</strong> (<em>string</em>) – Whether the value is also a default one</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">‘selected’ attribute or an empty 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>If you use a <select> menu, this function permits you to display the +menu item that was selected.</p> +<p>The first parameter must contain the name of the select menu, the second +parameter must contain the value of each item, and the third (optional) +parameter lets you set an item as the default (use boolean TRUE/FALSE).</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">select</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"myselect"</span><span class="o">></span> + <span class="o"><</span><span class="nx">option</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"one"</span> <span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nx">set_select</span><span class="p">(</span><span class="s1">'myselect'</span><span class="p">,</span> <span class="s1">'one'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="cp">?></span> >One<span class="p"></</span><span class="nt">option</span><span class="p">></span> + <span class="p"><</span><span class="nt">option</span> <span class="na">value</span><span class="o">=</span><span class="s">"two"</span> <span class="cp"><?php</span> <span class="k">echo</span> <span class="nx">set_select</span><span class="p">(</span><span class="s1">'myselect'</span><span class="p">,</span> <span class="s1">'two'</span><span class="p">);</span> <span class="cp">?></span> <span class="p">></span>Two<span class="p"></</span><span class="nt">option</span><span class="p">></span> + <span class="p"><</span><span class="nt">option</span> <span class="na">value</span><span class="o">=</span><span class="s">"three"</span> <span class="cp"><?php</span> <span class="k">echo</span> <span class="nx">set_select</span><span class="p">(</span><span class="s1">'myselect'</span><span class="p">,</span> <span class="s1">'three'</span><span class="p">);</span> <span class="cp">?></span> <span class="p">></span>Three<span class="p"></</span><span class="nt">option</span><span class="p">></span> +<span class="p"></</span><span class="nt">select</span><span class="p">></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="set_checkbox"> +<code class="descname">set_checkbox</code><span class="sig-paren">(</span><em>$field</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$default = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_checkbox" 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>$field</strong> (<em>string</em>) – Field name</li> +<li><strong>$value</strong> (<em>string</em>) – Value to check for</li> +<li><strong>$default</strong> (<em>string</em>) – Whether the value is also a default one</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">‘checked’ attribute or an empty 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>Permits you to display a checkbox in the state it was submitted.</p> +<p>The first parameter must contain the name of the checkbox, the second +parameter must contain its value, and the third (optional) parameter +lets you set an item as the default (use boolean TRUE/FALSE).</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"checkbox"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"mycheck"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"1"</span> <span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nx">set_checkbox</span><span class="p">(</span><span class="s1">'mycheck'</span><span class="p">,</span> <span class="s1">'1'</span><span class="p">);</span> <span class="cp">?></span> /> +<span class="p"><</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">"checkbox"</span> <span class="na">name</span><span class="o">=</span><span class="s">"mycheck"</span> <span class="na">value</span><span class="o">=</span><span class="s">"2"</span> <span class="cp"><?php</span> <span class="k">echo</span> <span class="nx">set_checkbox</span><span class="p">(</span><span class="s1">'mycheck'</span><span class="p">,</span> <span class="s1">'2'</span><span class="p">);</span> <span class="cp">?></span> <span class="p">/></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="set_radio"> +<code class="descname">set_radio</code><span class="sig-paren">(</span><em>$field</em><span class="optional">[</span>, <em>$value = ''</em><span class="optional">[</span>, <em>$default = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_radio" 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>$field</strong> (<em>string</em>) – Field name</li> +<li><strong>$value</strong> (<em>string</em>) – Value to check for</li> +<li><strong>$default</strong> (<em>string</em>) – Whether the value is also a default one</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">‘checked’ attribute or an empty 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>Permits you to display radio buttons in the state they were submitted. +This function is identical to the <a class="reference internal" href="#set_checkbox" title="set_checkbox"><code class="xref php php-func docutils literal"><span class="pre">set_checkbox()</span></code></a> function above.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o"><</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s2">"radio"</span> <span class="nx">name</span><span class="o">=</span><span class="s2">"myradio"</span> <span class="nx">value</span><span class="o">=</span><span class="s2">"1"</span> <span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nx">set_radio</span><span class="p">(</span><span class="s1">'myradio'</span><span class="p">,</span> <span class="s1">'1'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="cp">?></span> /> +<span class="p"><</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">"radio"</span> <span class="na">name</span><span class="o">=</span><span class="s">"myradio"</span> <span class="na">value</span><span class="o">=</span><span class="s">"2"</span> <span class="cp"><?php</span> <span class="k">echo</span> <span class="nx">set_radio</span><span class="p">(</span><span class="s1">'myradio'</span><span class="p">,</span> <span class="s1">'2'</span><span class="p">);</span> <span class="cp">?></span> <span class="p">/></span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you are using the Form Validation class, you must always specify +a rule for your field, even if empty, in order for the <code class="docutils literal"><span class="pre">set_*()</span></code> +functions to work. This is because if a Form Validation object is +defined, the control for <code class="docutils literal"><span class="pre">set_*()</span></code> is handed over to a method of the +class instead of the generic helper function.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_error"> +<code class="descname">form_error</code><span class="sig-paren">(</span><span class="optional">[</span><em>$field = ''</em><span class="optional">[</span>, <em>$prefix = ''</em><span class="optional">[</span>, <em>$suffix = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#form_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>$field</strong> (<em>string</em>) – Field name</li> +<li><strong>$prefix</strong> (<em>string</em>) – Error opening tag</li> +<li><strong>$suffix</strong> (<em>string</em>) – Error closing tag</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML-formatted form validation error message(s)</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>Returns a validation error message from the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a>, associated with the specified field name. +You can optionally specify opening and closing tag(s) to put around the error +message.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Assuming that the 'username' field value was incorrect:</span> +<span class="k">echo</span> <span class="nx">form_error</span><span class="p">(</span><span class="s1">'myfield'</span><span class="p">,</span> <span class="s1">'<div class="error">'</span><span class="p">,</span> <span class="s1">'</div>'</span><span class="p">);</span> + +<span class="c1">// Would produce: <div class="error">Error message associated with the "username" field.</div></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="validation_errors"> +<code class="descname">validation_errors</code><span class="sig-paren">(</span><span class="optional">[</span><em>$prefix = ''</em><span class="optional">[</span>, <em>$suffix = ''</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#validation_errors" 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>$prefix</strong> (<em>string</em>) – Error opening tag</li> +<li><strong>$suffix</strong> (<em>string</em>) – Error closing tag</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML-formatted form validation error message(s)</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>Similarly to the <a class="reference internal" href="#form_error" title="form_error"><code class="xref php php-func docutils literal"><span class="pre">form_error()</span></code></a> function, returns all validation +error messages produced by the <a class="reference internal" href="../libraries/form_validation.html"><span class="doc">Form Validation Library</span></a>, with optional opening and closing tags +around each of the messages.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">validation_errors</span><span class="p">(</span><span class="s1">'<span class="error">'</span><span class="p">,</span> <span class="s1">'</span>'</span><span class="p">);</span> + +<span class="cm">/*</span> +<span class="cm"> Would produce, e.g.:</span> + +<span class="cm"> <span class="error">The "email" field doesn't contain a valid e-mail address!</span></span> +<span class="cm"> <span class="error">The "password" field doesn't match the "repeat_password" field!</span></span> + +<span class="cm"> */</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="form_prep"> +<code class="descname">form_prep</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#form_prep" 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>) – Value to escape</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Escaped value</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>Allows you to safely use HTML and characters such as quotes within form +elements without breaking out of the form.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you use any of the form helper functions listed in this page the form +values will be prepped automatically, so there is no need to call this +function. Use it only if you are creating your own form elements.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED and is just an alias for +<a class="reference internal" href="../general/common_functions.html"><span class="doc">common function</span></a> +<code class="xref py py-func docutils literal"><span class="pre">html_escape()</span></code> - please use that instead.</p> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="html_helper.html" class="btn btn-neutral float-right" title="HTML Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="file_helper.html" class="btn btn-neutral" title="File Helper"><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 Mar 22, 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.8', + 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/helpers/html_helper.html b/user_guide/helpers/html_helper.html new file mode 100644 index 000000000..c505e0889 --- /dev/null +++ b/user_guide/helpers/html_helper.html @@ -0,0 +1,1091 @@ + + +<!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>HTML Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Inflector Helper" href="inflector_helper.html"/> + <link rel="prev" title="Form Helper" href="form_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>HTML Helper</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="html-helper"> +<h1>HTML Helper<a class="headerlink" href="#html-helper" title="Permalink to this headline">¶</a></h1> +<p>The HTML Helper file contains functions that assist in working with +HTML.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'html'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="heading"> +<code class="descname">heading</code><span class="sig-paren">(</span><span class="optional">[</span><em>$data = ''</em><span class="optional">[</span>, <em>$h = '1'</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#heading" 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>string</em>) – Content</li> +<li><strong>$h</strong> (<em>string</em>) – Heading level</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML heading tag</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>Lets you create HTML heading tags. The first parameter will contain the +data, the second the size of the heading. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">heading</span><span class="p">(</span><span class="s1">'Welcome!'</span><span class="p">,</span> <span class="mi">3</span><span class="p">);</span> +</pre></div> +</div> +<p>The above would produce: <h3>Welcome!</h3></p> +<p>Additionally, in order to add attributes to the heading tag such as HTML +classes, ids or inline styles, a third parameter accepts either a string +or an array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">heading</span><span class="p">(</span><span class="s1">'Welcome!'</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="s1">'class="pink"'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">heading</span><span class="p">(</span><span class="s1">'How are you?'</span><span class="p">,</span> <span class="mi">4</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="s1">'question'</span><span class="p">,</span> <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'green'</span><span class="p">));</span> +</pre></div> +</div> +<p>The above code produces:</p> +<div class="highlight-html"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">h3</span> <span class="na">class</span><span class="o">=</span><span class="s">"pink"</span><span class="p">></span>Welcome!<span class="p"><</span><span class="nt">h3</span><span class="p">></span> +<span class="p"><</span><span class="nt">h4</span> <span class="na">id</span><span class="o">=</span><span class="s">"question"</span> <span class="na">class</span><span class="o">=</span><span class="s">"green"</span><span class="p">></span>How are you?<span class="p"></</span><span class="nt">h4</span><span class="p">></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="img"> +<code class="descname">img</code><span class="sig-paren">(</span><span class="optional">[</span><em>$src = ''</em><span class="optional">[</span>, <em>$index_page = FALSE</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#img" 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>$src</strong> (<em>string</em>) – Image source data</li> +<li><strong>$index_page</strong> (<em>bool</em>) – Whether to treat $src as a routed URI string</li> +<li><strong>$attributes</strong> (<em>array</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML image tag</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>Lets you create HTML <img /> tags. The first parameter contains the +image source. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">img</span><span class="p">(</span><span class="s1">'images/picture.jpg'</span><span class="p">);</span> <span class="c1">// gives <img src="http://site.com/images/picture.jpg" /></span> +</pre></div> +</div> +<p>There is an optional second parameter that is a TRUE/FALSE value that +specifics if the <em>src</em> should have the page specified by +<code class="docutils literal"><span class="pre">$config['index_page']</span></code> added to the address it creates. +Presumably, this would be if you were using a media controller:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">img</span><span class="p">(</span><span class="s1">'images/picture.jpg'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="c1">// gives <img src="http://site.com/index.php/images/picture.jpg" alt="" /></span> +</pre></div> +</div> +<p>Additionally, an associative array can be passed to the <code class="docutils literal"><span class="pre">img()</span></code> function +for complete control over all attributes and values. If an <em>alt</em> attribute +is not provided, CodeIgniter will generate an empty string.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$image_properties</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'src'</span> <span class="o">=></span> <span class="s1">'images/picture.jpg'</span><span class="p">,</span> + <span class="s1">'alt'</span> <span class="o">=></span> <span class="s1">'Me, demonstrating how to eat 4 slices of pizza at one time'</span><span class="p">,</span> + <span class="s1">'class'</span> <span class="o">=></span> <span class="s1">'post_images'</span><span class="p">,</span> + <span class="s1">'width'</span> <span class="o">=></span> <span class="s1">'200'</span><span class="p">,</span> + <span class="s1">'height'</span><span class="o">=></span> <span class="s1">'200'</span><span class="p">,</span> + <span class="s1">'title'</span> <span class="o">=></span> <span class="s1">'That was quite a night'</span><span class="p">,</span> + <span class="s1">'rel'</span> <span class="o">=></span> <span class="s1">'lightbox'</span> +<span class="p">);</span> + +<span class="nx">img</span><span class="p">(</span><span class="nv">$image_properties</span><span class="p">);</span> +<span class="c1">// <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" /></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="link_tag"> +<code class="descname">link_tag</code><span class="sig-paren">(</span><span class="optional">[</span><em>$href = ''</em><span class="optional">[</span>, <em>$rel = 'stylesheet'</em><span class="optional">[</span>, <em>$type = 'text/css'</em><span class="optional">[</span>, <em>$title = ''</em><span class="optional">[</span>, <em>$media = ''</em><span class="optional">[</span>, <em>$index_page = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#link_tag" 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>$href</strong> (<em>string</em>) – What are we linking to</li> +<li><strong>$rel</strong> (<em>string</em>) – Relation type</li> +<li><strong>$type</strong> (<em>string</em>) – Type of the related document</li> +<li><strong>$title</strong> (<em>string</em>) – Link title</li> +<li><strong>$media</strong> (<em>string</em>) – Media type</li> +<li><strong>$index_page</strong> (<em>bool</em>) – Whether to treat $src as a routed URI string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML link tag</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>Lets you create HTML <link /> tags. This is useful for stylesheet links, +as well as other links. The parameters are <em>href</em>, with optional <em>rel</em>, +<em>type</em>, <em>title</em>, <em>media</em> and <em>index_page</em>.</p> +<p><em>index_page</em> is a boolean value that specifies if the <em>href</em> should have +the page specified by <code class="docutils literal"><span class="pre">$config['index_page']</span></code> added to the address it creates.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="s1">'css/mystyles.css'</span><span class="p">);</span> +<span class="c1">// gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" /></span> +</pre></div> +</div> +<p>Further examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="s1">'favicon.ico'</span><span class="p">,</span> <span class="s1">'shortcut icon'</span><span class="p">,</span> <span class="s1">'image/ico'</span><span class="p">);</span> +<span class="c1">// <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /></span> + +<span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="s1">'feed'</span><span class="p">,</span> <span class="s1">'alternate'</span><span class="p">,</span> <span class="s1">'application/rss+xml'</span><span class="p">,</span> <span class="s1">'My RSS Feed'</span><span class="p">);</span> +<span class="c1">// <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" /></span> +</pre></div> +</div> +<p>Additionally, an associative array can be passed to the <code class="docutils literal"><span class="pre">link()</span></code> function +for complete control over all attributes and values:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$link</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'href'</span> <span class="o">=></span> <span class="s1">'css/printer.css'</span><span class="p">,</span> + <span class="s1">'rel'</span> <span class="o">=></span> <span class="s1">'stylesheet'</span><span class="p">,</span> + <span class="s1">'type'</span> <span class="o">=></span> <span class="s1">'text/css'</span><span class="p">,</span> + <span class="s1">'media'</span> <span class="o">=></span> <span class="s1">'print'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">link_tag</span><span class="p">(</span><span class="nv">$link</span><span class="p">);</span> +<span class="c1">// <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" /></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="ul"> +<code class="descname">ul</code><span class="sig-paren">(</span><em>$list</em><span class="optional">[</span>, <em>$attributes = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#ul" 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>$list</strong> (<em>array</em>) – List entries</li> +<li><strong>$attributes</strong> (<em>array</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML-formatted unordered list</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>Permits you to generate unordered HTML lists from simple or +multi-dimensional arrays. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$list</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">'blue'</span><span class="p">,</span> + <span class="s1">'green'</span><span class="p">,</span> + <span class="s1">'yellow'</span> +<span class="p">);</span> + +<span class="nv">$attributes</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">'boldlist'</span><span class="p">,</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'mylist'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">ul</span><span class="p">(</span><span class="nv">$list</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span> +</pre></div> +</div> +<p>The above code will produce this:</p> +<div class="highlight-html"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">ul</span> <span class="na">class</span><span class="o">=</span><span class="s">"boldlist"</span> <span class="na">id</span><span class="o">=</span><span class="s">"mylist"</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>red<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>blue<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>green<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>yellow<span class="p"></</span><span class="nt">li</span><span class="p">></span> +<span class="p"></</span><span class="nt">ul</span><span class="p">></span> +</pre></div> +</div> +<p>Here is a more complex example, using a multi-dimensional array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$attributes</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">'boldlist'</span><span class="p">,</span> + <span class="s1">'id'</span> <span class="o">=></span> <span class="s1">'mylist'</span> +<span class="p">);</span> + +<span class="nv">$list</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'colors'</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">'blue'</span><span class="p">,</span> + <span class="s1">'green'</span> + <span class="p">),</span> + <span class="s1">'shapes'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'round'</span><span class="p">,</span> + <span class="s1">'square'</span><span class="p">,</span> + <span class="s1">'circles'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'ellipse'</span><span class="p">,</span> + <span class="s1">'oval'</span><span class="p">,</span> + <span class="s1">'sphere'</span> + <span class="p">)</span> + <span class="p">),</span> + <span class="s1">'moods'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'happy'</span><span class="p">,</span> + <span class="s1">'upset'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'defeated'</span> <span class="o">=></span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'dejected'</span><span class="p">,</span> + <span class="s1">'disheartened'</span><span class="p">,</span> + <span class="s1">'depressed'</span> + <span class="p">),</span> + <span class="s1">'annoyed'</span><span class="p">,</span> + <span class="s1">'cross'</span><span class="p">,</span> + <span class="s1">'angry'</span> + <span class="p">)</span> + <span class="p">)</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">ul</span><span class="p">(</span><span class="nv">$list</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span> +</pre></div> +</div> +<p>The above code will produce this:</p> +<div class="highlight-html"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">ul</span> <span class="na">class</span><span class="o">=</span><span class="s">"boldlist"</span> <span class="na">id</span><span class="o">=</span><span class="s">"mylist"</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>colors + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>red<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>blue<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>green<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + <span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>shapes + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>round<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>suare<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>circles + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>elipse<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>oval<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>sphere<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + <span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + <span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>moods + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>happy<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>upset + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>defeated + <span class="p"><</span><span class="nt">ul</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>dejected<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>disheartened<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>depressed<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + <span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>annoyed<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>cross<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"><</span><span class="nt">li</span><span class="p">></span>angry<span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + <span class="p"></</span><span class="nt">li</span><span class="p">></span> + <span class="p"></</span><span class="nt">ul</span><span class="p">></span> + <span class="p"></</span><span class="nt">li</span><span class="p">></span> +<span class="p"></</span><span class="nt">ul</span><span class="p">></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="ol"> +<code class="descname">ol</code><span class="sig-paren">(</span><em>$list</em>, <em>$attributes = ''</em><span class="sig-paren">)</span><a class="headerlink" href="#ol" 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>$list</strong> (<em>array</em>) – List entries</li> +<li><strong>$attributes</strong> (<em>array</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML-formatted ordered list</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>Identical to <a class="reference internal" href="#ul" title="ul"><code class="xref php php-func docutils literal"><span class="pre">ul()</span></code></a>, only it produces the <ol> tag for +ordered lists instead of <ul>.</p> +</dd></dl> + +<dl class="function"> +<dt id="meta"> +<code class="descname">meta</code><span class="sig-paren">(</span><span class="optional">[</span><em>$name = ''</em><span class="optional">[</span>, <em>$content = ''</em><span class="optional">[</span>, <em>$type = 'name'</em><span class="optional">[</span>, <em>$newline = "n"</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#meta" 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>$name</strong> (<em>string</em>) – Meta name</li> +<li><strong>$content</strong> (<em>string</em>) – Meta content</li> +<li><strong>$type</strong> (<em>string</em>) – Meta type</li> +<li><strong>$newline</strong> (<em>string</em>) – Newline character</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML meta tag</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>Helps you generate meta tags. You can pass strings to the function, or +simple arrays, or multidimensional ones.</p> +<p>Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="s1">'description'</span><span class="p">,</span> <span class="s1">'My Great site'</span><span class="p">);</span> +<span class="c1">// Generates: <meta name="description" content="My Great Site" /></span> + +<span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="s1">'Content-type'</span><span class="p">,</span> <span class="s1">'text/html; charset=utf-8'</span><span class="p">,</span> <span class="s1">'equiv'</span><span class="p">);</span> +<span class="c1">// Note the third parameter. Can be "equiv" or "name"</span> +<span class="c1">// Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" /></span> + +<span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'robots'</span><span class="p">,</span> <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'no-cache'</span><span class="p">));</span> +<span class="c1">// Generates: <meta name="robots" content="no-cache" /></span> + +<span class="nv">$meta</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="k">array</span><span class="p">(</span> + <span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'robots'</span><span class="p">,</span> + <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'no-cache'</span> + <span class="p">),</span> + <span class="k">array</span><span class="p">(</span> + <span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'description'</span><span class="p">,</span> + <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'My Great Site'</span> + <span class="p">),</span> + <span class="k">array</span><span class="p">(</span> + <span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'keywords'</span><span class="p">,</span> + <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'love, passion, intrigue, deception'</span> + <span class="p">),</span> + <span class="k">array</span><span class="p">(</span> + <span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'robots'</span><span class="p">,</span> + <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'no-cache'</span> + <span class="p">),</span> + <span class="k">array</span><span class="p">(</span> + <span class="s1">'name'</span> <span class="o">=></span> <span class="s1">'Content-type'</span><span class="p">,</span> + <span class="s1">'content'</span> <span class="o">=></span> <span class="s1">'text/html; charset=utf-8'</span><span class="p">,</span> <span class="s1">'type'</span> <span class="o">=></span> <span class="s1">'equiv'</span> + <span class="p">)</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">meta</span><span class="p">(</span><span class="nv">$meta</span><span class="p">);</span> +<span class="c1">// Generates:</span> +<span class="c1">// <meta name="robots" content="no-cache" /></span> +<span class="c1">// <meta name="description" content="My Great Site" /></span> +<span class="c1">// <meta name="keywords" content="love, passion, intrigue, deception" /></span> +<span class="c1">// <meta name="robots" content="no-cache" /></span> +<span class="c1">// <meta http-equiv="Content-type" content="text/html; charset=utf-8" /></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="doctype"> +<code class="descname">doctype</code><span class="sig-paren">(</span><span class="optional">[</span><em>$type = 'xhtml1-strict'</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#doctype" 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>$type</strong> (<em>string</em>) – Doctype name</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML DocType tag</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>Helps you generate document type declarations, or DTD’s. XHTML 1.0 +Strict is used by default, but many doctypes are available.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">doctype</span><span class="p">();</span> <span class="c1">// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></span> + +<span class="k">echo</span> <span class="nx">doctype</span><span class="p">(</span><span class="s1">'html4-trans'</span><span class="p">);</span> <span class="c1">// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"></span> +</pre></div> +</div> +<p>The following is a list of doctype choices. These are configurable, and +pulled from application/config/doctypes.php</p> +<table border="1" class="docutils"> +<colgroup> +<col width="16%" /> +<col width="10%" /> +<col width="74%" /> +</colgroup> +<thead valign="bottom"> +<tr class="row-odd"><th class="head">Document type</th> +<th class="head">Option</th> +<th class="head">Result</th> +</tr> +</thead> +<tbody valign="top"> +<tr class="row-even"><td>XHTML 1.1</td> +<td>xhtml11</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “<a class="reference external" href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>XHTML 1.0 Strict</td> +<td>xhtml1-strict</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “<a class="reference external" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>”></td> +</tr> +<tr class="row-even"><td>XHTML 1.0 Transitional</td> +<td>xhtml1-trans</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “<a class="reference external" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>XHTML 1.0 Frameset</td> +<td>xhtml1-frame</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN” “<a class="reference external" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</a>”></td> +</tr> +<tr class="row-even"><td>XHTML Basic 1.1</td> +<td>xhtml-basic11</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML Basic 1.1//EN” “<a class="reference external" href="http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>HTML 5</td> +<td>html5</td> +<td><!DOCTYPE html></td> +</tr> +<tr class="row-even"><td>HTML 4 Strict</td> +<td>html4-strict</td> +<td><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “<a class="reference external" href="http://www.w3.org/TR/html4/strict.dtd">http://www.w3.org/TR/html4/strict.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>HTML 4 Transitional</td> +<td>html4-trans</td> +<td><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “<a class="reference external" href="http://www.w3.org/TR/html4/loose.dtd">http://www.w3.org/TR/html4/loose.dtd</a>”></td> +</tr> +<tr class="row-even"><td>HTML 4 Frameset</td> +<td>html4-frame</td> +<td><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN” “<a class="reference external" href="http://www.w3.org/TR/html4/frameset.dtd">http://www.w3.org/TR/html4/frameset.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>MathML 1.01</td> +<td>mathml1</td> +<td><!DOCTYPE math SYSTEM “<a class="reference external" href="http://www.w3.org/Math/DTD/mathml1/mathml.dtd">http://www.w3.org/Math/DTD/mathml1/mathml.dtd</a>”></td> +</tr> +<tr class="row-even"><td>MathML 2.0</td> +<td>mathml2</td> +<td><!DOCTYPE math PUBLIC “-//W3C//DTD MathML 2.0//EN” “<a class="reference external" href="http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">http://www.w3.org/Math/DTD/mathml2/mathml2.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>SVG 1.0</td> +<td>svg10</td> +<td><!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.0//EN” “<a class="reference external" href="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd</a>”></td> +</tr> +<tr class="row-even"><td>SVG 1.1 Full</td> +<td>svg11</td> +<td><!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1//EN” “<a class="reference external" href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>SVG 1.1 Basic</td> +<td>svg11-basic</td> +<td><!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1 Basic//EN” “<a class="reference external" href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd</a>”></td> +</tr> +<tr class="row-even"><td>SVG 1.1 Tiny</td> +<td>svg11-tiny</td> +<td><!DOCTYPE svg PUBLIC “-//W3C//DTD SVG 1.1 Tiny//EN” “<a class="reference external" href="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd</a>”></td> +</tr> +<tr class="row-odd"><td>XHTML+MathML+SVG (XHTML host)</td> +<td>xhtml-math-svg-xh</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN” “<a class="reference external" href="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd</a>”></td> +</tr> +<tr class="row-even"><td>XHTML+MathML+SVG (SVG host)</td> +<td>xhtml-math-svg-sh</td> +<td><!DOCTYPE svg:svg PUBLIC “-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN” “http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd”></td> +</tr> +<tr class="row-odd"><td>XHTML+RDFa 1.0</td> +<td>xhtml-rdfa-1</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML+RDFa 1.0//EN” “<a class="reference external" href="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd</a>”></td> +</tr> +<tr class="row-even"><td>XHTML+RDFa 1.1</td> +<td>xhtml-rdfa-2</td> +<td><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML+RDFa 1.1//EN” “<a class="reference external" href="http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd</a>”></td> +</tr> +</tbody> +</table> +</dd></dl> + +<dl class="function"> +<dt id="br"> +<code class="descname">br</code><span class="sig-paren">(</span><span class="optional">[</span><em>$count = 1</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#br" 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>$count</strong> (<em>int</em>) – Number of times to repeat the tag</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML line break tag</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>Generates line break tags (<br />) based on the number you submit. +Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">br</span><span class="p">(</span><span class="mi">3</span><span class="p">);</span> +</pre></div> +</div> +<p>The above would produce:</p> +<div class="highlight-html"><div class="highlight"><pre><span></span><span class="p"><</span><span class="nt">br</span> <span class="p">/><</span><span class="nt">br</span> <span class="p">/><</span><span class="nt">br</span> <span class="p">/></span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">str_repeat()</span></code> +in combination with <code class="docutils literal"><span class="pre"><br</span> <span class="pre">/></span></code> instead.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="nbs"> +<code class="descname">nbs</code><span class="sig-paren">(</span><span class="optional">[</span><em>$num = 1</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#nbs" 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>$num</strong> (<em>int</em>) – Number of space entities to produce</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A sequence of non-breaking space HTML entities</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>Generates non-breaking spaces (&nbsp;) based on the number you submit. +Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">nbs</span><span class="p">(</span><span class="mi">3</span><span class="p">);</span> +</pre></div> +</div> +<p>The above would produce:</p> +<div class="highlight-html"><div class="highlight"><pre><span></span><span class="ni">&nbsp;&nbsp;&nbsp;</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">str_repeat()</span></code> +in combination with <code class="docutils literal"><span class="pre">&nbsp;</span></code> instead.</p> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="inflector_helper.html" class="btn btn-neutral float-right" title="Inflector Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="form_helper.html" class="btn btn-neutral" title="Form Helper"><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 Mar 22, 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.8', + 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/helpers/index.html b/user_guide/helpers/index.html new file mode 100644 index 000000000..76e892698 --- /dev/null +++ b/user_guide/helpers/index.html @@ -0,0 +1,518 @@ + + +<!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>Helpers — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="next" title="Array Helper" href="array_helper.html"/> + <link rel="prev" title="DB Driver Reference" href="../database/db_driver_reference.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="current reference internal" href="#">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="current reference internal" href="#">Helpers</a><ul> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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>Helpers</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="helpers"> +<h1>Helpers<a class="headerlink" href="#helpers" title="Permalink to this headline">¶</a></h1> +<div class="toctree-wrapper compound"> +<ul> +<li class="toctree-l1"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l1"><a class="reference internal" href="xml_helper.html">XML Helper</a></li> +</ul> +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="array_helper.html" class="btn btn-neutral float-right" title="Array Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="../database/db_driver_reference.html" class="btn btn-neutral" title="DB Driver Reference"><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 Mar 22, 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.8', + 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/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html new file mode 100644 index 000000000..4623d7f2b --- /dev/null +++ b/user_guide/helpers/inflector_helper.html @@ -0,0 +1,680 @@ + + +<!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>Inflector Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Language Helper" href="language_helper.html"/> + <link rel="prev" title="HTML Helper" href="html_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Inflector Helper</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="inflector-helper"> +<h1>Inflector Helper<a class="headerlink" href="#inflector-helper" title="Permalink to this headline">¶</a></h1> +<p>The Inflector Helper file contains functions that permits you to change +<strong>English</strong> words to plural, singular, camel case, etc.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'inflector'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="singular"> +<code class="descname">singular</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#singular" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A singular word</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>Changes a plural word to singular. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">singular</span><span class="p">(</span><span class="s1">'dogs'</span><span class="p">);</span> <span class="c1">// Prints 'dog'</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="plural"> +<code class="descname">plural</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#plural" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A plural word</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>Changes a singular word to plural. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">plural</span><span class="p">(</span><span class="s1">'dog'</span><span class="p">);</span> <span class="c1">// Prints 'dogs'</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="camelize"> +<code class="descname">camelize</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#camelize" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Camelized 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>Changes a string of words separated by spaces or underscores to camel +case. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">camelize</span><span class="p">(</span><span class="s1">'my_dog_spot'</span><span class="p">);</span> <span class="c1">// Prints 'myDogSpot'</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="underscore"> +<code class="descname">underscore</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#underscore" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String containing underscores instead of spaces</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>Takes multiple words separated by spaces and underscores them. +Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">underscore</span><span class="p">(</span><span class="s1">'my dog spot'</span><span class="p">);</span> <span class="c1">// Prints 'my_dog_spot'</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="humanize"> +<code class="descname">humanize</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$separator = '_'</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#humanize" 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>$separator</strong> (<em>string</em>) – Input separator</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Humanized 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>Takes multiple words separated by underscores and adds spaces between +them. Each word is capitalized.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">humanize</span><span class="p">(</span><span class="s1">'my_dog_spot'</span><span class="p">);</span> <span class="c1">// Prints 'My Dog Spot'</span> +</pre></div> +</div> +<p>To use dashes instead of underscores:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">humanize</span><span class="p">(</span><span class="s1">'my-dog-spot'</span><span class="p">,</span> <span class="s1">'-'</span><span class="p">);</span> <span class="c1">// Prints 'My Dog Spot'</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="is_countable"> +<code class="descname">is_countable</code><span class="sig-paren">(</span><em>$word</em><span class="sig-paren">)</span><a class="headerlink" href="#is_countable" 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>$word</strong> (<em>string</em>) – Input 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 word is countable 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>Checks if the given word has a plural version. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">is_countable</span><span class="p">(</span><span class="s1">'equipment'</span><span class="p">);</span> <span class="c1">// Returns FALSE</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="language_helper.html" class="btn btn-neutral float-right" title="Language Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="html_helper.html" class="btn btn-neutral" title="HTML Helper"><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 Mar 22, 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.8', + 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/helpers/language_helper.html b/user_guide/helpers/language_helper.html new file mode 100644 index 000000000..3d5a30fd0 --- /dev/null +++ b/user_guide/helpers/language_helper.html @@ -0,0 +1,550 @@ + + +<!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>Language Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Number Helper" href="number_helper.html"/> + <link rel="prev" title="Inflector Helper" href="inflector_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Language Helper</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="language-helper"> +<h1>Language Helper<a class="headerlink" href="#language-helper" title="Permalink to this headline">¶</a></h1> +<p>The Language Helper file contains functions that assist in working with +language files.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'language'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="lang"> +<code class="descname">lang</code><span class="sig-paren">(</span><em>$line</em><span class="optional">[</span>, <em>$for = ''</em><span class="optional">[</span>, <em>$attributes = array()</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#lang" 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>$line</strong> (<em>string</em>) – Language line key</li> +<li><strong>$for</strong> (<em>string</em>) – HTML “for” attribute (ID of the element we’re creating a label for)</li> +<li><strong>$attributes</strong> (<em>array</em>) – Any additional HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The language line; in an HTML label tag, if the <code class="docutils literal"><span class="pre">$for</span></code> parameter is not empty</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 returns a line of text from a loaded language file with +simplified syntax that may be more desirable for view files than +<code class="docutils literal"><span class="pre">CI_Lang::line()</span></code>.</p> +<p>Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">lang</span><span class="p">(</span><span class="s1">'language_key'</span><span class="p">);</span> +<span class="c1">// Outputs: Language line</span> + +<span class="k">echo</span> <span class="nx">lang</span><span class="p">(</span><span class="s1">'language_key'</span><span class="p">,</span> <span class="s1">'form_item_id'</span><span class="p">,</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="c1">// Outputs: <label for="form_item_id" class="myClass">Language line</label></span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="number_helper.html" class="btn btn-neutral float-right" title="Number Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="inflector_helper.html" class="btn btn-neutral" title="Inflector Helper"><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 Mar 22, 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.8', + 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/helpers/number_helper.html b/user_guide/helpers/number_helper.html new file mode 100644 index 000000000..3208ba918 --- /dev/null +++ b/user_guide/helpers/number_helper.html @@ -0,0 +1,559 @@ + + +<!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>Number Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Path Helper" href="path_helper.html"/> + <link rel="prev" title="Language Helper" href="language_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Number Helper</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="number-helper"> +<h1>Number Helper<a class="headerlink" href="#number-helper" title="Permalink to this headline">¶</a></h1> +<p>The Number Helper file contains functions that help you work with +numeric data.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'number'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="byte_format"> +<code class="descname">byte_format</code><span class="sig-paren">(</span><em>$num</em><span class="optional">[</span>, <em>$precision = 1</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#byte_format" 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>$num</strong> (<em>mixed</em>) – Number of bytes</li> +<li><strong>$precision</strong> (<em>int</em>) – Floating point precision</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formatted data size 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>Formats numbers as bytes, based on size, and adds the appropriate +suffix. Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">456</span><span class="p">);</span> <span class="c1">// Returns 456 Bytes</span> +<span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">4567</span><span class="p">);</span> <span class="c1">// Returns 4.5 KB</span> +<span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">45678</span><span class="p">);</span> <span class="c1">// Returns 44.6 KB</span> +<span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">456789</span><span class="p">);</span> <span class="c1">// Returns 447.8 KB</span> +<span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">3456789</span><span class="p">);</span> <span class="c1">// Returns 3.3 MB</span> +<span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">12345678912345</span><span class="p">);</span> <span class="c1">// Returns 1.8 GB</span> +<span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">123456789123456789</span><span class="p">);</span> <span class="c1">// Returns 11,228.3 TB</span> +</pre></div> +</div> +<p>An optional second parameter allows you to set the precision of the +result:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">byte_format</span><span class="p">(</span><span class="mi">45678</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span> <span class="c1">// Returns 44.61 KB</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The text generated by this function is found in the following +language file: <em>language/<your_lang>/number_lang.php</em></p> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="path_helper.html" class="btn btn-neutral float-right" title="Path Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="language_helper.html" class="btn btn-neutral" title="Language Helper"><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 Mar 22, 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.8', + 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/helpers/path_helper.html b/user_guide/helpers/path_helper.html new file mode 100644 index 000000000..7a7d4ac0d --- /dev/null +++ b/user_guide/helpers/path_helper.html @@ -0,0 +1,557 @@ + + +<!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>Path Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Security Helper" href="security_helper.html"/> + <link rel="prev" title="Number Helper" href="number_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Path Helper</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="path-helper"> +<h1>Path Helper<a class="headerlink" href="#path-helper" title="Permalink to this headline">¶</a></h1> +<p>The Path Helper file contains functions that permits you to work with +file paths on the server.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'path'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="set_realpath"> +<code class="descname">set_realpath</code><span class="sig-paren">(</span><em>$path</em><span class="optional">[</span>, <em>$check_existance = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#set_realpath" 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>$path</strong> (<em>string</em>) – Path</li> +<li><strong>$check_existance</strong> (<em>bool</em>) – Whether to check if the path actually exists</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An absolute path</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 will return a server path without symbolic links or +relative directory structures. An optional second argument will +cause an error to be triggered if the path cannot be resolved.</p> +<p>Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$file</span> <span class="o">=</span> <span class="s1">'/etc/php5/apache2/php.ini'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">set_realpath</span><span class="p">(</span><span class="nv">$file</span><span class="p">);</span> <span class="c1">// Prints '/etc/php5/apache2/php.ini'</span> + +<span class="nv">$non_existent_file</span> <span class="o">=</span> <span class="s1">'/path/to/non-exist-file.txt'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">set_realpath</span><span class="p">(</span><span class="nv">$non_existent_file</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="c1">// Shows an error, as the path cannot be resolved</span> +<span class="k">echo</span> <span class="nx">set_realpath</span><span class="p">(</span><span class="nv">$non_existent_file</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">);</span> <span class="c1">// Prints '/path/to/non-exist-file.txt'</span> + +<span class="nv">$directory</span> <span class="o">=</span> <span class="s1">'/etc/php5'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">set_realpath</span><span class="p">(</span><span class="nv">$directory</span><span class="p">);</span> <span class="c1">// Prints '/etc/php5/'</span> + +<span class="nv">$non_existent_directory</span> <span class="o">=</span> <span class="s1">'/path/to/nowhere'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">set_realpath</span><span class="p">(</span><span class="nv">$non_existent_directory</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="c1">// Shows an error, as the path cannot be resolved</span> +<span class="k">echo</span> <span class="nx">set_realpath</span><span class="p">(</span><span class="nv">$non_existent_directory</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">);</span> <span class="c1">// Prints '/path/to/nowhere'</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="security_helper.html" class="btn btn-neutral float-right" title="Security Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="number_helper.html" class="btn btn-neutral" title="Number Helper"><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 Mar 22, 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.8', + 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/helpers/security_helper.html b/user_guide/helpers/security_helper.html new file mode 100644 index 000000000..de6b0fa1a --- /dev/null +++ b/user_guide/helpers/security_helper.html @@ -0,0 +1,669 @@ + + +<!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 Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Smiley Helper" href="smiley_helper.html"/> + <link rel="prev" title="Path Helper" href="path_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Security Helper</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-helper"> +<h1>Security Helper<a class="headerlink" href="#security-helper" title="Permalink to this headline">¶</a></h1> +<p>The Security Helper file contains security related functions.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'security'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="xss_clean"> +<code class="descname">xss_clean</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$is_image = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#xss_clean" 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 data</li> +<li><strong>$is_image</strong> (<em>bool</em>) – Whether we’re dealing with an image</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">XSS-clean 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>Provides Cross Site Script Hack filtering.</p> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Input::xss_clean()</span></code>. For more info, +please see the <a class="reference internal" href="../libraries/input.html"><span class="doc">Input Library</span></a> documentation.</p> +</dd></dl> + +<dl class="function"> +<dt id="sanitize_filename"> +<code class="descname">sanitize_filename</code><span class="sig-paren">(</span><em>$filename</em><span class="sig-paren">)</span><a class="headerlink" href="#sanitize_filename" 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>$filename</strong> (<em>string</em>) – Filename</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Sanitized file name</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>Provides protection against directory traversal.</p> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Security::sanitize_filename()</span></code>. +For more info, please see the <a class="reference internal" href="../libraries/security.html"><span class="doc">Security Library</span></a> +documentation.</p> +</dd></dl> + +<dl class="function"> +<dt id="do_hash"> +<code class="descname">do_hash</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$type = 'sha1'</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#do_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>$str</strong> (<em>string</em>) – Input</li> +<li><strong>$type</strong> (<em>string</em>) – Algorithm</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Hex-formatted hash</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>Permits you to create one way hashes suitable for encrypting +passwords. Will use SHA1 by default.</p> +<p>See <a class="reference external" href="http://php.net/function.hash_algos">hash_algos()</a> +for a full list of supported algorithms.</p> +<p>Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$str</span> <span class="o">=</span> <span class="nx">do_hash</span><span class="p">(</span><span class="nv">$str</span><span class="p">);</span> <span class="c1">// SHA1</span> +<span class="nv">$str</span> <span class="o">=</span> <span class="nx">do_hash</span><span class="p">(</span><span class="nv">$str</span><span class="p">,</span> <span class="s1">'md5'</span><span class="p">);</span> <span class="c1">// MD5</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function was formerly named <code class="docutils literal"><span class="pre">dohash()</span></code>, which has been +removed in favor of <code class="docutils literal"><span class="pre">do_hash()</span></code>.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">hash()</span></code> instead.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="strip_image_tags"> +<code class="descname">strip_image_tags</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#strip_image_tags" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The input string with no image tags</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 is a security function that will strip image tags from a string. +It leaves the image URL as plain text.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">strip_image_tags</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Security::strip_image_tags()</span></code>. For +more info, please see the <a class="reference internal" href="../libraries/security.html"><span class="doc">Security Library</span></a> +documentation.</p> +</dd></dl> + +<dl class="function"> +<dt id="encode_php_tags"> +<code class="descname">encode_php_tags</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#encode_php_tags" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Safely formatted 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 is a security function that converts PHP tags to entities.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last"><a class="reference internal" href="#xss_clean" title="xss_clean"><code class="xref php php-func docutils literal"><span class="pre">xss_clean()</span></code></a> does this automatically, if you use it.</p> +</div> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">encode_php_tags</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="smiley_helper.html" class="btn btn-neutral float-right" title="Smiley Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="path_helper.html" class="btn btn-neutral" title="Path Helper"><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 Mar 22, 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.8', + 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/helpers/smiley_helper.html b/user_guide/helpers/smiley_helper.html new file mode 100644 index 000000000..071c49c04 --- /dev/null +++ b/user_guide/helpers/smiley_helper.html @@ -0,0 +1,708 @@ + + +<!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>Smiley Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="String Helper" href="string_helper.html"/> + <link rel="prev" title="Security Helper" href="security_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Smiley Helper</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="smiley-helper"> +<h1>Smiley Helper<a class="headerlink" href="#smiley-helper" title="Permalink to this headline">¶</a></h1> +<p>The Smiley Helper file contains functions that let you manage smileys +(emoticons).</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">The Smiley helper is DEPRECATED and should not be used. +It is currently only kept for backwards compatibility.</p> +</div> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#overview" id="id2">Overview</a></li> +<li><a class="reference internal" href="#clickable-smileys-tutorial" id="id3">Clickable Smileys Tutorial</a><ul> +<li><a class="reference internal" href="#the-controller" id="id4">The Controller</a></li> +<li><a class="reference internal" href="#field-aliases" id="id5">Field Aliases</a></li> +</ul> +</li> +<li><a class="reference internal" href="#available-functions" id="id6">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'smiley'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="overview"> +<h2><a class="toc-backref" href="#id2">Overview</a><a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2> +<p>The Smiley helper has a renderer that takes plain text smileys, like +:-) and turns them into a image representation, like <img alt="smile!" src="../_images/smile.gif" /></p> +<p>It also lets you display a set of smiley images that when clicked will +be inserted into a form field. For example, if you have a blog that +allows user commenting you can show the smileys next to the comment +form. Your users can click a desired smiley and with the help of some +JavaScript it will be placed into the form field.</p> +</div> +<div class="section" id="clickable-smileys-tutorial"> +<h2><a class="toc-backref" href="#id3">Clickable Smileys Tutorial</a><a class="headerlink" href="#clickable-smileys-tutorial" title="Permalink to this headline">¶</a></h2> +<p>Here is an example demonstrating how you might create a set of clickable +smileys next to a form field. This example requires that you first +download and install the smiley images, then create a controller and the +View as described.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Before you begin, please <a class="reference external" href="https://ellislab.com/asset/ci_download_files/smileys.zip">download the smiley images</a> +and put them in a publicly accessible place on your server. +This helper also assumes you have the smiley replacement array +located at <cite>application/config/smileys.php</cite></p> +</div> +<div class="section" id="the-controller"> +<h3><a class="toc-backref" href="#id4">The Controller</a><a class="headerlink" href="#the-controller" title="Permalink to this headline">¶</a></h3> +<p>In your <strong>application/controllers/</strong> directory, create a file called +Smileys.php and place the code below in it.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Change the URL in the <a class="reference internal" href="#get_clickable_smileys" title="get_clickable_smileys"><code class="xref php php-func docutils literal"><span class="pre">get_clickable_smileys()</span></code></a> +function below so that it points to your smiley folder.</p> +</div> +<p>You’ll notice that in addition to the smiley helper, we are also using +the <a class="reference internal" href="../libraries/table.html"><span class="doc">Table Class</span></a>:</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">Smileys</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">helper</span><span class="p">(</span><span class="s1">'smiley'</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">'table'</span><span class="p">);</span> + + <span class="nv">$image_array</span> <span class="o">=</span> <span class="nx">get_clickable_smileys</span><span class="p">(</span><span class="s1">'http://example.com/images/smileys/'</span><span class="p">,</span> <span class="s1">'comments'</span><span class="p">);</span> + <span class="nv">$col_array</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">table</span><span class="o">-></span><span class="na">make_columns</span><span class="p">(</span><span class="nv">$image_array</span><span class="p">,</span> <span class="mi">8</span><span class="p">);</span> + + <span class="nv">$data</span><span class="p">[</span><span class="s1">'smiley_table'</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">table</span><span class="o">-></span><span class="na">generate</span><span class="p">(</span><span class="nv">$col_array</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">'smiley_view'</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>In your <strong>application/views/</strong> directory, create a file called <strong>smiley_view.php</strong> +and place this code 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">Smileys</span><span class="o"></</span><span class="nx">title</span><span class="o">></span> + <span class="o"><?</span><span class="nx">php</span> <span class="k">echo</span> <span class="nx">smiley_js</span><span class="p">();</span> <span class="cp">?></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">form</span> <span class="na">name</span><span class="o">=</span><span class="s">"blog"</span><span class="p">></span> + <span class="p"><</span><span class="nt">textarea</span> <span class="na">name</span><span class="o">=</span><span class="s">"comments"</span> <span class="na">id</span><span class="o">=</span><span class="s">"comments"</span> <span class="na">cols</span><span class="o">=</span><span class="s">"40"</span> <span class="na">rows</span><span class="o">=</span><span class="s">"4"</span><span class="p">></</span><span class="nt">textarea</span><span class="p">></span> + <span class="p"></</span><span class="nt">form</span><span class="p">></span> + <span class="p"><</span><span class="nt">p</span><span class="p">></span>Click to insert a smiley!<span class="p"></</span><span class="nt">p</span><span class="p">></span> + <span class="cp"><?php</span> <span class="k">echo</span> <span class="nv">$smiley_table</span><span class="p">;</span> <span class="cp">?></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> + When you have created the above controller and view, load it by visiting http://www.example.com/index.php/smileys/ + <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> +<div class="section" id="field-aliases"> +<h3><a class="toc-backref" href="#id5">Field Aliases</a><a class="headerlink" href="#field-aliases" title="Permalink to this headline">¶</a></h3> +<p>When making changes to a view it can be inconvenient to have the field +id in the controller. To work around this, you can give your smiley +links a generic name that will be tied to a specific id in your view.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$image_array</span> <span class="o">=</span> <span class="nx">get_smiley_links</span><span class="p">(</span><span class="s2">"http://example.com/images/smileys/"</span><span class="p">,</span> <span class="s2">"comment_textarea_alias"</span><span class="p">);</span> +</pre></div> +</div> +<p>To map the alias to the field id, pass them both into the +<code class="xref py py-func docutils literal"><span class="pre">smiley_js()</span></code> function:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$image_array</span> <span class="o">=</span> <span class="nx">smiley_js</span><span class="p">(</span><span class="s2">"comment_textarea_alias"</span><span class="p">,</span> <span class="s2">"comments"</span><span class="p">);</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id6">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<dl class="function"> +<dt id="get_clickable_smileys"> +<code class="descname">get_clickable_smileys</code><span class="sig-paren">(</span><em>$image_url</em><span class="optional">[</span>, <em>$alias = ''</em><span class="optional">[</span>, <em>$smileys = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#get_clickable_smileys" 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>$image_url</strong> (<em>string</em>) – URL path to the smileys directory</li> +<li><strong>$alias</strong> (<em>string</em>) – Field alias</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 ready to use smileys</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>Returns an array containing your smiley images wrapped in a clickable +link. You must supply the URL to your smiley folder and a field id or +field alias.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$image_array</span> <span class="o">=</span> <span class="nx">get_clickable_smileys</span><span class="p">(</span><span class="s1">'http://example.com/images/smileys/'</span><span class="p">,</span> <span class="s1">'comment'</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="smiley_js"> +<code class="descname">smiley_js</code><span class="sig-paren">(</span><span class="optional">[</span><em>$alias = ''</em><span class="optional">[</span>, <em>$field_id = ''</em><span class="optional">[</span>, <em>$inline = TRUE</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#smiley_js" 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>$alias</strong> (<em>string</em>) – Field alias</li> +<li><strong>$field_id</strong> (<em>string</em>) – Field ID</li> +<li><strong>$inline</strong> (<em>bool</em>) – Whether we’re inserting an inline smiley</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Smiley-enabling JavaScript code</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>Generates the JavaScript that allows the images to be clicked and +inserted into a form field. If you supplied an alias instead of an id +when generating your smiley links, you need to pass the alias and +corresponding form id into the function. This function is designed to be +placed into the <head> area of your web page.</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">echo</span> <span class="nx">smiley_js</span><span class="p">();</span> <span class="cp">?></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="parse_smileys"> +<code class="descname">parse_smileys</code><span class="sig-paren">(</span><span class="optional">[</span><em>$str = ''</em><span class="optional">[</span>, <em>$image_url = ''</em><span class="optional">[</span>, <em>$smileys = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#parse_smileys" 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>) – Text containing smiley codes</li> +<li><strong>$image_url</strong> (<em>string</em>) – URL path to the smileys directory</li> +<li><strong>$smileys</strong> (<em>array</em>) – An array of smileys</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Parsed smileys</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>Takes a string of text as input and replaces any contained plain text +smileys into the image equivalent. The first parameter must contain your +string, the second must contain the URL to your smiley folder</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$str</span> <span class="o">=</span> <span class="s1">'Here are some smileys: :-) ;-)'</span><span class="p">;</span> +<span class="nv">$str</span> <span class="o">=</span> <span class="nx">parse_smileys</span><span class="p">(</span><span class="nv">$str</span><span class="p">,</span> <span class="s1">'http://example.com/images/smileys/'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nv">$str</span><span class="p">;</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="string_helper.html" class="btn btn-neutral float-right" title="String Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="security_helper.html" class="btn btn-neutral" title="Security Helper"><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 Mar 22, 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.8', + 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/helpers/string_helper.html b/user_guide/helpers/string_helper.html new file mode 100644 index 000000000..d846a44ef --- /dev/null +++ b/user_guide/helpers/string_helper.html @@ -0,0 +1,873 @@ + + +<!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>String Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Text Helper" href="text_helper.html"/> + <link rel="prev" title="Smiley Helper" href="smiley_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>String Helper</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="string-helper"> +<h1>String Helper<a class="headerlink" href="#string-helper" title="Permalink to this headline">¶</a></h1> +<p>The String Helper file contains functions that assist in working with +strings.</p> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">Please note that these functions are NOT intended, nor +suitable to be used for any kind of security-related logic.</p> +</div> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'string'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="random_string"> +<code class="descname">random_string</code><span class="sig-paren">(</span><span class="optional">[</span><em>$type = 'alnum'</em><span class="optional">[</span>, <em>$len = 8</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#random_string" 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>$type</strong> (<em>string</em>) – Randomization type</li> +<li><strong>$len</strong> (<em>int</em>) – Output string length</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A random 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>Generates a random string based on the type and length you specify. +Useful for creating passwords or generating random hashes.</p> +<p>The first parameter specifies the type of string, the second parameter +specifies the length. The following choices are available:</p> +<ul class="simple"> +<li><strong>alpha</strong>: A string with lower and uppercase letters only.</li> +<li><strong>alnum</strong>: Alpha-numeric string with lower and uppercase characters.</li> +<li><strong>basic</strong>: A random number based on <code class="docutils literal"><span class="pre">mt_rand()</span></code>.</li> +<li><strong>numeric</strong>: Numeric string.</li> +<li><strong>nozero</strong>: Numeric string with no zeros.</li> +<li><strong>md5</strong>: An encrypted random number based on <code class="docutils literal"><span class="pre">md5()</span></code> (fixed length of 32).</li> +<li><strong>sha1</strong>: An encrypted random number based on <code class="docutils literal"><span class="pre">sha1()</span></code> (fixed length of 40).</li> +</ul> +<p>Usage example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">random_string</span><span class="p">(</span><span class="s1">'alnum'</span><span class="p">,</span> <span class="mi">16</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Usage of the <em>unique</em> and <em>encrypt</em> types is DEPRECATED. They +are just aliases for <em>md5</em> and <em>sha1</em> respectively.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="increment_string"> +<code class="descname">increment_string</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$separator = '_'</em><span class="optional">[</span>, <em>$first = 1</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#increment_string" 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>$separator</strong> (<em>string</em>) – Separator to append a duplicate number with</li> +<li><strong>$first</strong> (<em>int</em>) – Starting number</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">An incremented 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>Increments a string by appending a number to it or increasing the +number. Useful for creating “copies” or a file or duplicating database +content which has unique titles or slugs.</p> +<p>Usage example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">increment_string</span><span class="p">(</span><span class="s1">'file'</span><span class="p">,</span> <span class="s1">'_'</span><span class="p">);</span> <span class="c1">// "file_1"</span> +<span class="k">echo</span> <span class="nx">increment_string</span><span class="p">(</span><span class="s1">'file'</span><span class="p">,</span> <span class="s1">'-'</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span> <span class="c1">// "file-2"</span> +<span class="k">echo</span> <span class="nx">increment_string</span><span class="p">(</span><span class="s1">'file_4'</span><span class="p">);</span> <span class="c1">// "file_5"</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="alternator"> +<code class="descname">alternator</code><span class="sig-paren">(</span><em>$args</em><span class="sig-paren">)</span><a class="headerlink" href="#alternator" 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>$args</strong> (<em>mixed</em>) – A variable number of arguments</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Alternated 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>Allows two or more items to be alternated between, when cycling through +a loop. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></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">echo</span> <span class="nx">alternator</span><span class="p">(</span><span class="s1">'string one'</span><span class="p">,</span> <span class="s1">'string two'</span><span class="p">);</span> +<span class="p">}</span> +</pre></div> +</div> +<p>You can add as many parameters as you want, and with each iteration of +your loop the next item will be returned.</p> +<div class="highlight-ci"><div class="highlight"><pre><span></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">echo</span> <span class="nx">alternator</span><span class="p">(</span><span class="s1">'one'</span><span class="p">,</span> <span class="s1">'two'</span><span class="p">,</span> <span class="s1">'three'</span><span class="p">,</span> <span class="s1">'four'</span><span class="p">,</span> <span class="s1">'five'</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">To use multiple separate calls to this function simply call the +function with no arguments to re-initialize.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="repeater"> +<code class="descname">repeater</code><span class="sig-paren">(</span><em>$data</em><span class="optional">[</span>, <em>$num = 1</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#repeater" 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>string</em>) – Input</li> +<li><strong>$num</strong> (<em>int</em>) – Number of times to repeat</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Repeated 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>Generates repeating copies of the data you submit. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">repeater</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="mi">30</span><span class="p">);</span> +</pre></div> +</div> +<p>The above would generate 30 newlines.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">str_repeat()</span></code> +instead.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="reduce_double_slashes"> +<code class="descname">reduce_double_slashes</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#reduce_double_slashes" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A string with normalized slashes</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>Converts double slashes in a string to a single slash, except those +found in URL protocol prefixes (e.g. http://).</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"http://example.com//index.php"</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">reduce_double_slashes</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> <span class="c1">// results in "http://example.com/index.php"</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="strip_slashes"> +<code class="descname">strip_slashes</code><span class="sig-paren">(</span><em>$data</em><span class="sig-paren">)</span><a class="headerlink" href="#strip_slashes" 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>mixed</em>) – Input string or an array of strings</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String(s) with stripped slashes</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>Removes any slashes from an array of strings.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$str</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'question'</span><span class="nx"> </span><span class="o">=></span> <span class="s1">'Is your name O\'reilly?'</span><span class="p">,</span> + <span class="s1">'answer'</span> <span class="o">=></span> <span class="s1">'No, my name is O\'connor.'</span> +<span class="p">);</span> + +<span class="nv">$str</span> <span class="o">=</span> <span class="nx">strip_slashes</span><span class="p">(</span><span class="nv">$str</span><span class="p">);</span> +</pre></div> +</div> +<p>The above will return the following array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">array</span><span class="p">(</span> + <span class="s1">'question'</span><span class="nx"> </span><span class="o">=></span> <span class="s2">"Is your name O'reilly?"</span><span class="p">,</span> + <span class="s1">'answer'</span> <span class="o">=></span> <span class="s2">"No, my name is O'connor."</span> +<span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For historical reasons, this function will also accept +and handle string inputs. This however makes it just an +alias for <code class="docutils literal"><span class="pre">stripslashes()</span></code>.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="trim_slashes"> +<code class="descname">trim_slashes</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#trim_slashes" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Slash-trimmed 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>Removes any leading/trailing slashes from a string. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"/this/that/theother/"</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">trim_slashes</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> <span class="c1">// results in this/that/theother</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function is DEPRECATED. Use the native <code class="docutils literal"><span class="pre">trim()</span></code> instead: +| +| trim($str, ‘/’);</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="reduce_multiples"> +<code class="descname">reduce_multiples</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$character = ''</em><span class="optional">[</span>, <em>$trim = FALSE</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#reduce_multiples" 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>) – Text to search in</li> +<li><strong>$character</strong> (<em>string</em>) – Character to reduce</li> +<li><strong>$trim</strong> (<em>bool</em>) – Whether to also trim the specified character</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Reduced 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>Reduces multiple instances of a particular character occurring directly +after each other. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Fred, Bill,, Joe, Jimmy"</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">reduce_multiples</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span><span class="s2">","</span><span class="p">);</span> <span class="c1">//results in "Fred, Bill, Joe, Jimmy"</span> +</pre></div> +</div> +<p>If the third parameter is set to TRUE it will remove occurrences of the +character at the beginning and the end of the string. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">",Fred, Bill,, Joe, Jimmy,"</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">reduce_multiples</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="s2">", "</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> <span class="c1">//results in "Fred, Bill, Joe, Jimmy"</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="quotes_to_entities"> +<code class="descname">quotes_to_entities</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#quotes_to_entities" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String with quotes converted to HTML entities</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>Converts single and double quotes in a string to the corresponding HTML +entities. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Joe's </span><span class="se">\"</span><span class="s2">dinner</span><span class="se">\"</span><span class="s2">"</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">quotes_to_entities</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> <span class="c1">//results in "Joe&#39;s &quot;dinner&quot;"</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="strip_quotes"> +<code class="descname">strip_quotes</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#strip_quotes" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String with quotes stripped</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>Removes single and double quotes from a string. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Joe's </span><span class="se">\"</span><span class="s2">dinner</span><span class="se">\"</span><span class="s2">"</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">strip_quotes</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> <span class="c1">//results in "Joes dinner"</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="text_helper.html" class="btn btn-neutral float-right" title="Text Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="smiley_helper.html" class="btn btn-neutral" title="Smiley Helper"><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 Mar 22, 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.8', + 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/helpers/text_helper.html b/user_guide/helpers/text_helper.html new file mode 100644 index 000000000..5b4875c7b --- /dev/null +++ b/user_guide/helpers/text_helper.html @@ -0,0 +1,847 @@ + + +<!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>Text Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Typography Helper" href="typography_helper.html"/> + <link rel="prev" title="String Helper" href="string_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Text Helper</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="text-helper"> +<h1>Text Helper<a class="headerlink" href="#text-helper" title="Permalink to this headline">¶</a></h1> +<p>The Text Helper file contains functions that assist in working with +text.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'text'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="word_limiter"> +<code class="descname">word_limiter</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$limit = 100</em><span class="optional">[</span>, <em>$end_char = '&#8230;'</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#word_limiter" 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>$limit</strong> (<em>int</em>) – Limit</li> +<li><strong>$end_char</strong> (<em>string</em>) – End character (usually an ellipsis)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Word-limited 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>Truncates a string to the number of <em>words</em> specified. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Here is a nice text string consisting of eleven words."</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">word_limiter</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="mi">4</span><span class="p">);</span> +<span class="c1">// Returns: Here is a nice</span> +</pre></div> +</div> +<p>The third parameter is an optional suffix added to the string. By +default it adds an ellipsis.</p> +</dd></dl> + +<dl class="function"> +<dt id="character_limiter"> +<code class="descname">character_limiter</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$n = 500</em><span class="optional">[</span>, <em>$end_char = '&#8230;'</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#character_limiter" 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>$n</strong> (<em>int</em>) – Number of characters</li> +<li><strong>$end_char</strong> (<em>string</em>) – End character (usually an ellipsis)</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Character-limited 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>Truncates a string to the number of <em>characters</em> specified. It +maintains the integrity of words so the character count may be slightly +more or less than what you specify.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Here is a nice text string consisting of eleven words."</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">character_limiter</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="mi">20</span><span class="p">);</span> +<span class="c1">// Returns: Here is a nice text string</span> +</pre></div> +</div> +<p>The third parameter is an optional suffix added to the string, if +undeclared this helper uses an ellipsis.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you need to truncate to an exact number of characters please +see the <a class="reference internal" href="#ellipsize" title="ellipsize"><code class="xref php php-func docutils literal"><span class="pre">ellipsize()</span></code></a> function below.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="ascii_to_entities"> +<code class="descname">ascii_to_entities</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#ascii_to_entities" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A string with ASCII values converted to entities</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>Converts ASCII values to character entities, including high ASCII and MS +Word characters that can cause problems when used in a web page, so that +they can be shown consistently regardless of browser settings or stored +reliably in a database. There is some dependence on your server’s +supported character sets, so it may not be 100% reliable in all cases, +but for the most part it should correctly identify characters outside +the normal range (like accented characters).</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">ascii_to_entities</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="convert_accented_characters"> +<code class="descname">convert_accented_characters</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#convert_accented_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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A string with accented characters converted</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>Transliterates high ASCII characters to low ASCII equivalents. Useful +when non-English characters need to be used where only standard ASCII +characters are safely used, for instance, in URLs.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">convert_accented_characters</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">This function uses a companion config file +<cite>application/config/foreign_chars.php</cite> to define the to and +from array for transliteration.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="word_censor"> +<code class="descname">word_censor</code><span class="sig-paren">(</span><em>$str</em>, <em>$censored</em><span class="optional">[</span>, <em>$replacement = ''</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#word_censor" 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>$censored</strong> (<em>array</em>) – List of bad words to censor</li> +<li><strong>$replacement</strong> (<em>string</em>) – What to replace bad words with</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Censored 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>Enables you to censor words within a text string. The first parameter +will contain the original string. The second will contain an array of +words which you disallow. The third (optional) parameter can contain +a replacement value for the words. If not specified they are replaced +with pound signs: ####.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$disallowed</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'darn'</span><span class="p">,</span> <span class="s1">'shucks'</span><span class="p">,</span> <span class="s1">'golly'</span><span class="p">,</span> <span class="s1">'phooey'</span><span class="p">);</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">word_censor</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="nv">$disallowed</span><span class="p">,</span> <span class="s1">'Beep!'</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="highlight_code"> +<code class="descname">highlight_code</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#highlight_code" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String with code highlighted via HTML</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>Colorizes a string of code (PHP, HTML, etc.). Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">highlight_code</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +<p>The function uses PHP’s <code class="docutils literal"><span class="pre">highlight_string()</span></code> function, so the +colors used are the ones specified in your php.ini file.</p> +</dd></dl> + +<dl class="function"> +<dt id="highlight_phrase"> +<code class="descname">highlight_phrase</code><span class="sig-paren">(</span><em>$str</em>, <em>$phrase</em><span class="optional">[</span>, <em>$tag_open = '<mark>'</em><span class="optional">[</span>, <em>$tag_close = '</mark>'</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#highlight_phrase" 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>$phrase</strong> (<em>string</em>) – Phrase to highlight</li> +<li><strong>$tag_open</strong> (<em>string</em>) – Opening tag used for the highlight</li> +<li><strong>$tag_close</strong> (<em>string</em>) – Closing tag for the highlight</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String with a phrase highlighted via HTML</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>Will highlight a phrase within a text string. The first parameter will +contain the original string, the second will contain the phrase you wish +to highlight. The third and fourth parameters will contain the +opening/closing HTML tags you would like the phrase wrapped in.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Here is a nice text string about nothing in particular."</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">highlight_phrase</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="s2">"nice text"</span><span class="p">,</span> <span class="s1">'<span style="color:#990000;">'</span><span class="p">,</span> <span class="s1">'</span>'</span><span class="p">);</span> +</pre></div> +</div> +<p>The above code prints:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">Here</span> <span class="nx">is</span> <span class="nx">a</span> <span class="o"><</span><span class="nx">span</span> <span class="nx">style</span><span class="o">=</span><span class="s2">"color:#990000;"</span><span class="o">></span><span class="nx">nice</span> <span class="nx">text</span><span class="o"></</span><span class="nx">span</span><span class="o">></span> <span class="nx">string</span> <span class="nx">about</span> <span class="nx">nothing</span> <span class="nx">in</span> <span class="nx">particular</span><span class="o">.</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p>This function used to use the <code class="docutils literal"><span class="pre"><strong></span></code> tag by default. Older browsers +might not support the new HTML5 mark tag, so it is recommended that you +insert the following CSS code into your stylesheet if you need to support +such browsers:</p> +<div class="last highlight-ci"><div class="highlight"><pre><span></span><span class="nx">mark</span> <span class="p">{</span> + <span class="nx">background</span><span class="o">:</span> <span class="c1">#ff0;</span> + <span class="nx">color</span><span class="o">:</span> <span class="c1">#000;</span> +<span class="p">};</span> +</pre></div> +</div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="word_wrap"> +<code class="descname">word_wrap</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$charlim = 76</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#word_wrap" 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>$charlim</strong> (<em>int</em>) – Character limit</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Word-wrapped 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>Wraps text at the specified <em>character</em> count while maintaining +complete words.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s2">"Here is a simple string of text that will help us demonstrate this function."</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">word_wrap</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="mi">25</span><span class="p">);</span> + +<span class="c1">// Would produce:</span> +<span class="c1">// Here is a simple string</span> +<span class="c1">// of text that will help us</span> +<span class="c1">// demonstrate this</span> +<span class="c1">// function.</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="ellipsize"> +<code class="descname">ellipsize</code><span class="sig-paren">(</span><em>$str</em>, <em>$max_length</em><span class="optional">[</span>, <em>$position = 1</em><span class="optional">[</span>, <em>$ellipsis = '&hellip;'</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#ellipsize" 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>$max_length</strong> (<em>int</em>) – String length limit</li> +<li><strong>$position</strong> (<em>mixed</em>) – Position to split at (int or float)</li> +<li><strong>$ellipsis</strong> (<em>string</em>) – What to use as the ellipsis character</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Ellipsized 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 will strip tags from a string, split it at a defined +maximum length, and insert an ellipsis.</p> +<p>The first parameter is the string to ellipsize, the second is the number +of characters in the final string. The third parameter is where in the +string the ellipsis should appear from 0 - 1, left to right. For +example. a value of 1 will place the ellipsis at the right of the +string, .5 in the middle, and 0 at the left.</p> +<p>An optional forth parameter is the kind of ellipsis. By default, +&hellip; will be inserted.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$str</span> <span class="o">=</span> <span class="s1">'this_string_is_entirely_too_long_and_might_break_my_design.jpg'</span><span class="p">;</span> +<span class="k">echo</span> <span class="nx">ellipsize</span><span class="p">(</span><span class="nv">$str</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="o">.</span><span class="mi">5</span><span class="p">);</span> +</pre></div> +</div> +<p>Produces:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">this_string_is_e</span><span class="o">&</span><span class="nx">hellip</span><span class="p">;</span><span class="nx">ak_my_design</span><span class="o">.</span><span class="nx">jpg</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="typography_helper.html" class="btn btn-neutral float-right" title="Typography Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="string_helper.html" class="btn btn-neutral" title="String Helper"><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 Mar 22, 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.8', + 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/helpers/typography_helper.html b/user_guide/helpers/typography_helper.html new file mode 100644 index 000000000..55971a95c --- /dev/null +++ b/user_guide/helpers/typography_helper.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>Typography Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="URL Helper" href="url_helper.html"/> + <link rel="prev" title="Text Helper" href="text_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>Typography Helper</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="typography-helper"> +<h1>Typography Helper<a class="headerlink" href="#typography-helper" title="Permalink to this headline">¶</a></h1> +<p>The Typography Helper file contains functions that help your format text +in semantically relevant ways.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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">'typography'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="auto_typography"> +<code class="descname">auto_typography</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$reduce_linebreaks = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#auto_typography" 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>$reduce_linebreaks</strong> (<em>bool</em>) – Whether to reduce multiple instances of double newlines to two</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML-formatted typography-safe 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>Formats text so that it is semantically and typographically correct +HTML.</p> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Typography::auto_typography()</span></code>. +For more info, please see the <a class="reference internal" href="../libraries/typography.html"><span class="doc">Typography Library</span></a> documentation.</p> +<p>Usage example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">auto_typography</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Typographic formatting can be processor intensive, particularly if +you have a lot of content being formatted. If you choose to use this +function you may want to consider <a class="reference internal" href="../general/caching.html"><span class="doc">caching</span></a> your +pages.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="nl2br_except_pre"> +<code class="descname">nl2br_except_pre</code><span class="sig-paren">(</span><em>$str</em><span class="sig-paren">)</span><a class="headerlink" href="#nl2br_except_pre" 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> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">String with HTML-formatted line breaks</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>Converts newlines to <br /> tags unless they appear within <pre> tags. +This function is identical to the native PHP <code class="docutils literal"><span class="pre">nl2br()</span></code> function, +except that it ignores <pre> tags.</p> +<p>Usage example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">nl2br_except_pre</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="entity_decode"> +<code class="descname">entity_decode</code><span class="sig-paren">(</span><em>$str</em>, <em>$charset = NULL</em><span class="sig-paren">)</span><a class="headerlink" href="#entity_decode" 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>$charset</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">String with decoded HTML entities</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 is an alias for <code class="docutils literal"><span class="pre">CI_Security::entity_decode()</span></code>. +Fore more info, please see the <a class="reference internal" href="../libraries/security.html"><span class="doc">Security Library</span></a> documentation.</p> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="url_helper.html" class="btn btn-neutral float-right" title="URL Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="text_helper.html" class="btn btn-neutral" title="Text Helper"><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 Mar 22, 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.8', + 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/helpers/url_helper.html b/user_guide/helpers/url_helper.html new file mode 100644 index 000000000..beb0a980d --- /dev/null +++ b/user_guide/helpers/url_helper.html @@ -0,0 +1,1044 @@ + + +<!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>URL Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="XML Helper" href="xml_helper.html"/> + <link rel="prev" title="Typography Helper" href="typography_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">URL Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="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">Helpers</a> »</li> + + <li>URL Helper</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="url-helper"> +<h1>URL Helper<a class="headerlink" href="#url-helper" title="Permalink to this headline">¶</a></h1> +<p>The URL Helper file contains functions that assist in working with URLs.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code:</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> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="site_url"> +<code class="descname">site_url</code><span class="sig-paren">(</span><span class="optional">[</span><em>$uri = ''</em><span class="optional">[</span>, <em>$protocol = NULL</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#site_url" 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>$uri</strong> (<em>string</em>) – URI string</li> +<li><strong>$protocol</strong> (<em>string</em>) – Protocol, e.g. ‘http’ or ‘https’</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Site URL</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>Returns your site URL, as specified in your config file. The index.php +file (or whatever you have set as your site <strong>index_page</strong> in your config +file) will be added to the URL, as will any URI segments you pass to the +function, plus the <strong>url_suffix</strong> as set in your config file.</p> +<p>You are encouraged to use this function any time you need to generate a +local URL so that your pages become more portable in the event your URL +changes.</p> +<p>Segments can be optionally passed to the function as a string or an +array. Here is a string example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">site_url</span><span class="p">(</span><span class="s1">'news/local/123'</span><span class="p">);</span> +</pre></div> +</div> +<p>The above example would return something like: +<em>http://example.com/index.php/news/local/123</em></p> +<p>Here is an example of segments passed as an array:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$segments</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">'news'</span><span class="p">,</span> <span class="s1">'local'</span><span class="p">,</span> <span class="s1">'123'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">site_url</span><span class="p">(</span><span class="nv">$segments</span><span class="p">);</span> +</pre></div> +</div> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Config::site_url()</span></code>. For more info, +please see the <a class="reference internal" href="../libraries/config.html"><span class="doc">Config Library</span></a> documentation.</p> +</dd></dl> + +<dl class="function"> +<dt id="base_url"> +<code class="descname">base_url</code><span class="sig-paren">(</span><em>$uri = ''</em>, <em>$protocol = NULL</em><span class="sig-paren">)</span><a class="headerlink" href="#base_url" 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>$uri</strong> (<em>string</em>) – URI string</li> +<li><strong>$protocol</strong> (<em>string</em>) – Protocol, e.g. ‘http’ or ‘https’</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Base URL</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>Returns your site base URL, as specified in your config file. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">base_url</span><span class="p">();</span> +</pre></div> +</div> +<p>This function returns the same thing as <a class="reference internal" href="#site_url" title="site_url"><code class="xref php php-func docutils literal"><span class="pre">site_url()</span></code></a>, without +the <em>index_page</em> or <em>url_suffix</em> being appended.</p> +<p>Also like <a class="reference internal" href="#site_url" title="site_url"><code class="xref php php-func docutils literal"><span class="pre">site_url()</span></code></a>, you can supply segments as a string or +an array. Here is a string example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">base_url</span><span class="p">(</span><span class="s2">"blog/post/123"</span><span class="p">);</span> +</pre></div> +</div> +<p>The above example would return something like: +<em>http://example.com/blog/post/123</em></p> +<p>This is useful because unlike <a class="reference internal" href="#site_url" title="site_url"><code class="xref php php-func docutils literal"><span class="pre">site_url()</span></code></a>, you can supply a +string to a file, such as an image or stylesheet. For example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">base_url</span><span class="p">(</span><span class="s2">"images/icons/edit.png"</span><span class="p">);</span> +</pre></div> +</div> +<p>This would give you something like: +<em>http://example.com/images/icons/edit.png</em></p> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Config::base_url()</span></code>. For more info, +please see the <a class="reference internal" href="../libraries/config.html"><span class="doc">Config Library</span></a> documentation.</p> +</dd></dl> + +<dl class="function"> +<dt id="current_url"> +<code class="descname">current_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#current_url" 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">The current URL</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td> +</tr> +</tbody> +</table> +<p>Returns the full URL (including segments) of the page being currently +viewed.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Calling this function is the same as doing this: +| +| site_url(uri_string());</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="uri_string"> +<code class="descname">uri_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#uri_string" 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 URI string</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td> +</tr> +</tbody> +</table> +<p>Returns the URI segments of any page that contains this function. +For example, if your URL was this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">http</span><span class="o">://</span><span class="nx">some</span><span class="o">-</span><span class="nx">site</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">blog</span><span class="o">/</span><span class="nx">comments</span><span class="o">/</span><span class="mi">123</span> +</pre></div> +</div> +<p>The function would return:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nx">blog</span><span class="o">/</span><span class="nx">comments</span><span class="o">/</span><span class="mi">123</span> +</pre></div> +</div> +<p>This function is an alias for <code class="docutils literal"><span class="pre">CI_Config::uri_string()</span></code>. For more info, +please see the <a class="reference internal" href="../libraries/config.html"><span class="doc">Config Library</span></a> documentation.</p> +</dd></dl> + +<dl class="function"> +<dt id="index_page"> +<code class="descname">index_page</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#index_page" 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">‘index_page’ value</td> +</tr> +<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">mixed</td> +</tr> +</tbody> +</table> +<p>Returns your site <strong>index_page</strong>, as specified in your config file. +Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">index_page</span><span class="p">();</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="anchor"> +<code class="descname">anchor</code><span class="sig-paren">(</span><em>$uri = ''</em>, <em>$title = ''</em>, <em>$attributes = ''</em><span class="sig-paren">)</span><a class="headerlink" href="#anchor" 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>$uri</strong> (<em>string</em>) – URI string</li> +<li><strong>$title</strong> (<em>string</em>) – Anchor title</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">HTML hyperlink (anchor tag)</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>Creates a standard HTML anchor link based on your local site URL.</p> +<p>The first parameter can contain any segments you wish appended to the +URL. As with the <a class="reference internal" href="#site_url" title="site_url"><code class="xref php php-func docutils literal"><span class="pre">site_url()</span></code></a> function above, segments can +be a string or an array.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">If you are building links that are internal to your application +do not include the base URL (http://…). This will be added +automatically from the information specified in your config file. +Include only the URI segments you wish appended to the URL.</p> +</div> +<p>The second segment is the text you would like the link to say. If you +leave it blank, the URL will be used.</p> +<p>The third parameter can contain a list of attributes you would like +added to the link. The attributes can be a simple string or an +associative array.</p> +<p>Here are some examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">anchor</span><span class="p">(</span><span class="s1">'news/local/123'</span><span class="p">,</span> <span class="s1">'My News'</span><span class="p">,</span> <span class="s1">'title="News title"'</span><span class="p">);</span> +<span class="c1">// Prints: <a href="http://example.com/index.php/news/local/123" title="News title">My News</a></span> + +<span class="k">echo</span> <span class="nx">anchor</span><span class="p">(</span><span class="s1">'news/local/123'</span><span class="p">,</span> <span class="s1">'My News'</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s1">'title'</span> <span class="o">=></span> <span class="s1">'The best news!'</span><span class="p">));</span> +<span class="c1">// Prints: <a href="http://example.com/index.php/news/local/123" title="The best news!">My News</a></span> + +<span class="k">echo</span> <span class="nx">anchor</span><span class="p">(</span><span class="s1">''</span><span class="p">,</span> <span class="s1">'Click here'</span><span class="p">);</span> +<span class="c1">// Prints: <a href="http://example.com">Click Here</a></span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="anchor_popup"> +<code class="descname">anchor_popup</code><span class="sig-paren">(</span><em>$uri = ''</em>, <em>$title = ''</em>, <em>$attributes = FALSE</em><span class="sig-paren">)</span><a class="headerlink" href="#anchor_popup" 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>$uri</strong> (<em>string</em>) – URI string</li> +<li><strong>$title</strong> (<em>string</em>) – Anchor title</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Pop-up hyperlink</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>Nearly identical to the <a class="reference internal" href="#anchor" title="anchor"><code class="xref php php-func docutils literal"><span class="pre">anchor()</span></code></a> function except that it +opens the URL in a new window. You can specify JavaScript window +attributes in the third parameter to control how the window is opened. +If the third parameter is not set it will simply open a new window with +your own browser settings.</p> +<p>Here is an example with attributes:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$atts</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span> + <span class="s1">'width'</span> <span class="o">=></span> <span class="mi">800</span><span class="p">,</span> + <span class="s1">'height'</span> <span class="o">=></span> <span class="mi">600</span><span class="p">,</span> + <span class="s1">'scrollbars'</span> <span class="o">=></span> <span class="s1">'yes'</span><span class="p">,</span> + <span class="s1">'status'</span><span class="nx"> </span> <span class="nx"> </span><span class="o">=></span> <span class="s1">'yes'</span><span class="p">,</span> + <span class="s1">'resizable'</span><span class="nx"> </span> <span class="nx"> </span><span class="o">=></span> <span class="s1">'yes'</span><span class="p">,</span> + <span class="s1">'screenx'</span> <span class="o">=></span> <span class="mi">0</span><span class="p">,</span> + <span class="s1">'screeny'</span> <span class="o">=></span> <span class="mi">0</span><span class="p">,</span> + <span class="s1">'window_name'</span> <span class="o">=></span> <span class="s1">'_blank'</span> +<span class="p">);</span> + +<span class="k">echo</span> <span class="nx">anchor_popup</span><span class="p">(</span><span class="s1">'news/local/123'</span><span class="p">,</span> <span class="s1">'Click Me!'</span><span class="p">,</span> <span class="nv">$atts</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The above attributes are the function defaults so you only need to +set the ones that are different from what you need. If you want the +function to use all of its defaults simply pass an empty array in the +third parameter: +| +| echo anchor_popup(‘news/local/123’, ‘Click Me!’, array());</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">The <strong>window_name</strong> is not really an attribute, but an argument to +the JavaScript <cite>window.open() <http://www.w3schools.com/jsref/met_win_open.asp></cite> +method, which accepts either a window name or a window target.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Any other attribute than the listed above will be parsed as an +HTML attribute to the anchor tag.</p> +</div> +</dd></dl> + +<dl class="function"> +<dt id="mailto"> +<code class="descname">mailto</code><span class="sig-paren">(</span><em>$email</em>, <em>$title = ''</em>, <em>$attributes = ''</em><span class="sig-paren">)</span><a class="headerlink" href="#mailto" 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>$email</strong> (<em>string</em>) – E-mail address</li> +<li><strong>$title</strong> (<em>string</em>) – Anchor title</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A “mail to” hyperlink</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>Creates a standard HTML e-mail link. Usage example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nx">mailto</span><span class="p">(</span><span class="s1">'me@my-site.com'</span><span class="p">,</span> <span class="s1">'Click Here to Contact Me'</span><span class="p">);</span> +</pre></div> +</div> +<p>As with the <a class="reference internal" href="#anchor" title="anchor"><code class="xref php php-func docutils literal"><span class="pre">anchor()</span></code></a> tab above, you can set attributes using the +third parameter:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$attributes</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">'Mail me'</span><span class="p">);</span> +<span class="k">echo</span> <span class="nx">mailto</span><span class="p">(</span><span class="s1">'me@my-site.com'</span><span class="p">,</span> <span class="s1">'Contact Me'</span><span class="p">,</span> <span class="nv">$attributes</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="safe_mailto"> +<code class="descname">safe_mailto</code><span class="sig-paren">(</span><em>$email</em>, <em>$title = ''</em>, <em>$attributes = ''</em><span class="sig-paren">)</span><a class="headerlink" href="#safe_mailto" 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>$email</strong> (<em>string</em>) – E-mail address</li> +<li><strong>$title</strong> (<em>string</em>) – Anchor title</li> +<li><strong>$attributes</strong> (<em>mixed</em>) – HTML attributes</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A spam-safe “mail to” hyperlink</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>Identical to the <a class="reference internal" href="#mailto" title="mailto"><code class="xref php php-func docutils literal"><span class="pre">mailto()</span></code></a> function except it writes an obfuscated +version of the <em>mailto</em> tag using ordinal numbers written with JavaScript to +help prevent the e-mail address from being harvested by spam bots.</p> +</dd></dl> + +<dl class="function"> +<dt id="auto_link"> +<code class="descname">auto_link</code><span class="sig-paren">(</span><em>$str</em>, <em>$type = 'both'</em>, <em>$popup = FALSE</em><span class="sig-paren">)</span><a class="headerlink" href="#auto_link" 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>$type</strong> (<em>string</em>) – Link type (‘email’, ‘url’ or ‘both’)</li> +<li><strong>$popup</strong> (<em>bool</em>) – Whether to create popup links</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Linkified 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>Automatically turns URLs and e-mail addresses contained in a string into +links. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">auto_link</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +</pre></div> +</div> +<p>The second parameter determines whether URLs and e-mails are converted or +just one or the other. Default behavior is both if the parameter is not +specified. E-mail links are encoded as <a class="reference internal" href="#safe_mailto" title="safe_mailto"><code class="xref php php-func docutils literal"><span class="pre">safe_mailto()</span></code></a> as shown +above.</p> +<p>Converts only URLs:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">auto_link</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="s1">'url'</span><span class="p">);</span> +</pre></div> +</div> +<p>Converts only e-mail addresses:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">auto_link</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="s1">'email'</span><span class="p">);</span> +</pre></div> +</div> +<p>The third parameter determines whether links are shown in a new window. +The value can be TRUE or FALSE (boolean):</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="nx">auto_link</span><span class="p">(</span><span class="nv">$string</span><span class="p">,</span> <span class="s1">'both'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="url_title"> +<code class="descname">url_title</code><span class="sig-paren">(</span><em>$str</em>, <em>$separator = '-'</em>, <em>$lowercase = FALSE</em><span class="sig-paren">)</span><a class="headerlink" href="#url_title" 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>$separator</strong> (<em>string</em>) – Word separator</li> +<li><strong>$lowercase</strong> (<em>bool</em>) – Whether to transform the output string to lower-case</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">URL-formatted 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>Takes a string as input and creates a human-friendly URL string. This is +useful if, for example, you have a blog in which you’d like to use the +title of your entries in the URL. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$title</span> <span class="o">=</span> <span class="s2">"What's wrong with CSS?"</span><span class="p">;</span> +<span class="nv">$url_title</span> <span class="o">=</span> <span class="nx">url_title</span><span class="p">(</span><span class="nv">$title</span><span class="p">);</span> +<span class="c1">// Produces: Whats-wrong-with-CSS</span> +</pre></div> +</div> +<p>The second parameter determines the word delimiter. By default dashes +are used. Preferred options are: <strong>-</strong> (dash) or <strong>_</strong> (underscore)</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$title</span> <span class="o">=</span> <span class="s2">"What's wrong with CSS?"</span><span class="p">;</span> +<span class="nv">$url_title</span> <span class="o">=</span> <span class="nx">url_title</span><span class="p">(</span><span class="nv">$title</span><span class="p">,</span> <span class="s1">'underscore'</span><span class="p">);</span> +<span class="c1">// Produces: Whats_wrong_with_CSS</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Old usage of ‘dash’ and ‘underscore’ as the second parameter +is DEPRECATED.</p> +</div> +<p>The third parameter determines whether or not lowercase characters are +forced. By default they are not. Options are boolean TRUE/FALSE.</p> +<p>Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$title</span> <span class="o">=</span> <span class="s2">"What's wrong with CSS?"</span><span class="p">;</span> +<span class="nv">$url_title</span> <span class="o">=</span> <span class="nx">url_title</span><span class="p">(</span><span class="nv">$title</span><span class="p">,</span> <span class="s1">'underscore'</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">);</span> +<span class="c1">// Produces: whats_wrong_with_css</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="prep_url"> +<code class="descname">prep_url</code><span class="sig-paren">(</span><em>$str = ''</em><span class="sig-paren">)</span><a class="headerlink" href="#prep_url" 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>) – URL string</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Protocol-prefixed URL 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 will add http:// in the event that a protocol prefix +is missing from a URL.</p> +<p>Pass the URL string to the function like this:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$url</span> <span class="o">=</span> <span class="nx">prep_url</span><span class="p">(</span><span class="s1">'example.com'</span><span class="p">);</span> +</pre></div> +</div> +</dd></dl> + +<dl class="function"> +<dt id="redirect"> +<code class="descname">redirect</code><span class="sig-paren">(</span><em>$uri = ''</em>, <em>$method = 'auto'</em>, <em>$code = NULL</em><span class="sig-paren">)</span><a class="headerlink" href="#redirect" 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>$uri</strong> (<em>string</em>) – URI string</li> +<li><strong>$method</strong> (<em>string</em>) – Redirect method (‘auto’, ‘location’ or ‘refresh’)</li> +<li><strong>$code</strong> (<em>string</em>) – HTTP Response code (usually 302 or 303)</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>Does a “header redirect” to the URI specified. If you specify the full +site URL that link will be built, but for local links simply providing +the URI segments to the controller you want to direct to will create the +link. The function will build the URL based on your config file values.</p> +<p>The optional second parameter allows you to force a particular redirection +method. The available methods are <strong>auto</strong>, <strong>location</strong> and <strong>refresh</strong>, +with location being faster but less reliable on IIS servers. +The default is <strong>auto</strong>, which will attempt to intelligently choose the +method based on the server environment.</p> +<p>The optional third parameter allows you to send a specific HTTP Response +Code - this could be used for example to create 301 redirects for search +engine purposes. The default Response Code is 302. The third parameter is +<em>only</em> available with <strong>location</strong> redirects, and not <em>refresh</em>. Examples:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nv">$logged_in</span> <span class="o">==</span> <span class="k">FALSE</span><span class="p">)</span> +<span class="p">{</span> + <span class="nx">redirect</span><span class="p">(</span><span class="s1">'/login/form/'</span><span class="p">);</span> +<span class="p">}</span> + +<span class="c1">// with 301 redirect</span> +<span class="nx">redirect</span><span class="p">(</span><span class="s1">'/article/13'</span><span class="p">,</span> <span class="s1">'location'</span><span class="p">,</span> <span class="mi">301</span><span class="p">);</span> +</pre></div> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">In order for this function to work it must be used before anything +is outputted to the browser since it utilizes server headers.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">For very fine grained control over headers, you should use the +<a class="reference internal" href="../libraries/output.html"><span class="doc">Output Library</span></a> <code class="docutils literal"><span class="pre">set_header()</span></code> method.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">To IIS users: if you hide the <cite>Server</cite> HTTP header, the <em>auto</em> +method won’t detect IIS, in that case it is advised you explicitly +use the <strong>refresh</strong> method.</p> +</div> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">When the <strong>location</strong> method is used, an HTTP status code of 303 +will <em>automatically</em> be selected when the page is currently accessed +via POST and HTTP/1.1 is used.</p> +</div> +<div class="admonition important"> +<p class="first admonition-title">Important</p> +<p class="last">This function will terminate script execution.</p> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="xml_helper.html" class="btn btn-neutral float-right" title="XML Helper">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="typography_helper.html" class="btn btn-neutral" title="Typography Helper"><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 Mar 22, 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.8', + 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/helpers/xml_helper.html b/user_guide/helpers/xml_helper.html new file mode 100644 index 000000000..8872ddcd0 --- /dev/null +++ b/user_guide/helpers/xml_helper.html @@ -0,0 +1,559 @@ + + +<!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>XML Helper — CodeIgniter 3.1.8 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.8 documentation" href="../index.html"/> + <link rel="up" title="Helpers" href="index.html"/> + <link rel="next" title="Change Log" href="../changelog.html"/> + <link rel="prev" title="URL Helper" href="url_helper.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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">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="../general/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="../general/index.html">General Topics</a><ul> +<li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> +<li class="toctree-l2"><a class="reference internal" href="../general/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 class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Helpers</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="array_helper.html">Array Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="captcha_helper.html">CAPTCHA Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="cookie_helper.html">Cookie Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="date_helper.html">Date Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="directory_helper.html">Directory Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="download_helper.html">Download Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="email_helper.html">Email Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="file_helper.html">File Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="form_helper.html">Form Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="html_helper.html">HTML Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="inflector_helper.html">Inflector Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="language_helper.html">Language Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="number_helper.html">Number Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="path_helper.html">Path Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="security_helper.html">Security Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="smiley_helper.html">Smiley Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="string_helper.html">String Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="text_helper.html">Text Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="typography_helper.html">Typography Helper</a></li> +<li class="toctree-l2"><a class="reference internal" href="url_helper.html">URL Helper</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">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">Helpers</a> »</li> + + <li>XML Helper</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="xml-helper"> +<h1>XML Helper<a class="headerlink" href="#xml-helper" title="Permalink to this headline">¶</a></h1> +<p>The XML Helper file contains functions that assist in working with XML +data.</p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#loading-this-helper" id="id1">Loading this Helper</a></li> +<li><a class="reference internal" href="#available-functions" id="id2">Available Functions</a></li> +</ul> +</div> +<div class="custom-index container"></div><div class="section" id="loading-this-helper"> +<h2><a class="toc-backref" href="#id1">Loading this Helper</a><a class="headerlink" href="#loading-this-helper" title="Permalink to this headline">¶</a></h2> +<p>This helper is loaded using the following code</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">'xml'</span><span class="p">);</span> +</pre></div> +</div> +</div> +<div class="section" id="available-functions"> +<h2><a class="toc-backref" href="#id2">Available Functions</a><a class="headerlink" href="#available-functions" title="Permalink to this headline">¶</a></h2> +<p>The following functions are available:</p> +<dl class="function"> +<dt id="xml_convert"> +<code class="descname">xml_convert</code><span class="sig-paren">(</span><em>$str</em><span class="optional">[</span>, <em>$protect_all = FALSE</em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#xml_convert" 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>) – the text string to convert</li> +<li><strong>$protect_all</strong> (<em>bool</em>) – Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo;</li> +</ul> +</td> +</tr> +<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">XML-converted 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>Takes a string as input and converts the following reserved XML +characters to entities:</p> +<blockquote> +<div><ul class="simple"> +<li>Ampersands: &</li> +<li>Less than and greater than characters: < ></li> +<li>Single and double quotes: ‘ “</li> +<li>Dashes: -</li> +</ul> +</div></blockquote> +<p>This function ignores ampersands if they are part of existing numbered +character entities, e.g. &#123;. Example:</p> +<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$string</span> <span class="o">=</span> <span class="s1">'<p>Here is a paragraph & an entity (&#123;).</p>'</span><span class="p">;</span> +<span class="nv">$string</span> <span class="o">=</span> <span class="nx">xml_convert</span><span class="p">(</span><span class="nv">$string</span><span class="p">);</span> +<span class="k">echo</span> <span class="nv">$string</span><span class="p">;</span> +</pre></div> +</div> +<p>outputs:</p> +<div class="highlight-html"><div class="highlight"><pre><span></span><span class="ni">&lt;</span>p<span class="ni">&gt;</span>Here is a paragraph <span class="ni">&amp;</span> an entity (<span class="ni">&#123;</span>).<span class="ni">&lt;</span>/p<span class="ni">&gt;</span> +</pre></div> +</div> +</dd></dl> + +</div> +</div> + + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="../changelog.html" class="btn btn-neutral float-right" title="Change Log">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="url_helper.html" class="btn btn-neutral" title="URL Helper"><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 Mar 22, 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.8', + 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 |