├── .gitattributes ├── .gitignore ├── .travis.yml ├── Makefile ├── README.rst ├── cilexer ├── README ├── build │ └── lib.linux-x86_64-2.7 │ │ └── cilexer │ │ ├── __init__.py │ │ └── cilexer.py ├── cilexer │ ├── __init__.py │ └── cilexer.py ├── pycilexer.egg-info │ ├── PKG-INFO │ ├── SOURCES.txt │ ├── dependency_links.txt │ ├── entry_points.txt │ ├── requires.txt │ └── top_level.txt ├── setup.cfg └── setup.py ├── requirements.txt └── source ├── DCO.rst ├── _themes └── sphinx_rtd_theme │ ├── LICENSE │ ├── __init__.py │ ├── breadcrumbs.html │ ├── footer.html │ ├── layout.html │ ├── layout_old.html │ ├── pulldown.html │ ├── search.html │ ├── searchbox.html │ ├── static │ ├── css │ │ ├── badge_only.css │ │ ├── citheme.css │ │ └── theme.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ └── js │ │ ├── oldtheme.js │ │ └── theme.js │ ├── theme.conf │ └── versions.html ├── changelog.rst ├── conf.py ├── contributing └── index.rst ├── database ├── caching.rst ├── call_function.rst ├── configuration.rst ├── connecting.rst ├── db_driver_reference.rst ├── examples.rst ├── forge.rst ├── helpers.rst ├── index.rst ├── metadata.rst ├── queries.rst ├── query_builder.rst ├── results.rst ├── transactions.rst └── utilities.rst ├── documentation └── index.rst ├── general ├── alternative_php.rst ├── ancillary_classes.rst ├── autoloader.rst ├── caching.rst ├── cli.rst ├── common_functions.rst ├── compatibility_functions.rst ├── controllers.rst ├── core_classes.rst ├── creating_drivers.rst ├── creating_libraries.rst ├── credits.rst ├── drivers.rst ├── environments.rst ├── errors.rst ├── helpers.rst ├── hooks.rst ├── index.rst ├── libraries.rst ├── managing_apps.rst ├── models.rst ├── profiling.rst ├── requirements.rst ├── reserved_names.rst ├── routing.rst ├── security.rst ├── styleguide.rst ├── urls.rst ├── views.rst └── welcome.rst ├── helpers ├── array_helper.rst ├── captcha_helper.rst ├── cookie_helper.rst ├── date_helper.rst ├── directory_helper.rst ├── download_helper.rst ├── email_helper.rst ├── file_helper.rst ├── form_helper.rst ├── html_helper.rst ├── index.rst ├── inflector_helper.rst ├── language_helper.rst ├── number_helper.rst ├── path_helper.rst ├── security_helper.rst ├── smiley_helper.rst ├── string_helper.rst ├── text_helper.rst ├── typography_helper.rst ├── url_helper.rst └── xml_helper.rst ├── images ├── appflowchart.gif ├── arrow.gif ├── ci-icon.ico ├── ci_logo.jpg ├── ci_logo_flame.jpg ├── file.gif ├── folder.gif └── smile.gif ├── index.rst ├── installation ├── downloads.rst ├── index.rst ├── troubleshooting.rst ├── upgrade_120.rst ├── upgrade_130.rst ├── upgrade_131.rst ├── upgrade_132.rst ├── upgrade_133.rst ├── upgrade_140.rst ├── upgrade_141.rst ├── upgrade_150.rst ├── upgrade_152.rst ├── upgrade_153.rst ├── upgrade_154.rst ├── upgrade_160.rst ├── upgrade_161.rst ├── upgrade_162.rst ├── upgrade_163.rst ├── upgrade_170.rst ├── upgrade_171.rst ├── upgrade_172.rst ├── upgrade_200.rst ├── upgrade_201.rst ├── upgrade_202.rst ├── upgrade_203.rst ├── upgrade_210.rst ├── upgrade_211.rst ├── upgrade_212.rst ├── upgrade_213.rst ├── upgrade_214.rst ├── upgrade_220.rst ├── upgrade_221.rst ├── upgrade_222.rst ├── upgrade_223.rst ├── upgrade_300.rst ├── upgrade_301.rst ├── upgrade_302.rst ├── upgrade_303.rst ├── upgrade_b11.rst └── upgrading.rst ├── libraries ├── benchmark.rst ├── caching.rst ├── calendar.rst ├── cart.rst ├── config.rst ├── email.rst ├── encrypt.rst ├── encryption.rst ├── file_uploading.rst ├── form_validation.rst ├── ftp.rst ├── image_lib.rst ├── index.rst ├── input.rst ├── javascript.rst ├── language.rst ├── loader.rst ├── migration.rst ├── output.rst ├── pagination.rst ├── parser.rst ├── security.rst ├── sessions.rst ├── table.rst ├── trackback.rst ├── typography.rst ├── unit_testing.rst ├── uri.rst ├── user_agent.rst ├── xmlrpc.rst └── zip.rst ├── license.rst ├── overview ├── appflow.rst ├── at_a_glance.rst ├── features.rst ├── getting_started.rst ├── goals.rst ├── index.rst └── mvc.rst └── tutorial ├── conclusion.rst ├── create_news_items.rst ├── index.rst ├── news_section.rst └── static_pages.rst /.gitattributes: -------------------------------------------------------------------------------- 1 | # Enforce Unix newlines 2 | * text=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generic 2 | # ------------------------ 3 | Thumbs.db 4 | Desktop.ini 5 | Icon? 6 | .DS_Store 7 | .directory 8 | *.cache 9 | *.old 10 | *~ 11 | *.zip 12 | 13 | # Build directory 14 | # ------------------------ 15 | /build/ 16 | 17 | # IDE Files 18 | #------------------------- 19 | nbproject/ 20 | .idea/ 21 | .settings/ 22 | .idea/ 23 | .project 24 | *.sublime-* 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | sudo: false 3 | python: 4 | - "2.7" 5 | cache: 6 | - pip 7 | - apt 8 | matrix: 9 | fast_finish: true 10 | addons: 11 | apt: 12 | packages: 13 | # - pdflatex 14 | # - giflib-tools 15 | - texlive-lang-other 16 | - texlive-latex-recommended 17 | - texlive-fonts-recommended 18 | - texlive-latex-extra 19 | # Pisah tiap build environment 20 | env: 21 | - BUILD=html 22 | # - BUILD=dirhtml 23 | - BUILD=singlehtml 24 | # - BUILD=htmlhelp 25 | - BUILD=epub 26 | - BUILD=latex 27 | # - BUILD=latexpdf # Disable dulu, masih error 28 | # Install semua dependensi 29 | install: 30 | - pip install --upgrade pip 31 | - pip install -q -r requirements.txt 32 | - easy_install cilexer 33 | # Build the things 34 | script: 35 | - make $BUILD 36 | # Buanglah sampah pada tempatnya 37 | after_script: 38 | - export GH_REPO_REV=`git rev-parse --short HEAD` 39 | - if [[ $GH_REPO_TOKEN != '' ]]; then make publish; fi 40 | - make clean 41 | branches: 42 | only: 43 | - master 44 | - /^contrib\/.+$/ 45 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ###################################### 2 | Panduan Pengguna Codeigniter Indonesia 3 | ###################################### 4 | 5 | .. image:: https://img.shields.io/travis/codeigniter-id/user-guide/master.svg?style=flat-square 6 | :target: https://travis-ci.org/codeigniter-id/user-guide 7 | .. image:: https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square 8 | :target: https://gitter.im/codeigniter-id 9 | 10 | ****************** 11 | Panduan Persiapan 12 | ****************** 13 | 14 | Panduan penggunaan Codeigniter menggunakan Sphinx untuk mengelola dokumentasi dan 15 | menghasilkan ke berbagai macam format. Setiap halaman ditulis dalam 16 | `ReStructured Text `_ *human-readable* format. 17 | 18 | ********* 19 | Prasyarat 20 | ********* 21 | 22 | Sphinx membutuhkan Python, yang sudah terinstall jika Anda menggunakan OS X. 23 | Anda dapat mengkonfirmasi di *terminal window* dengan menjalankan perintah ``python`` 24 | tanpa parameter apapun. Jika Python telah terinstall, maka akan muncul versi Python 25 | yang Anda gunakan di `Terminal window`. Jika versi Python Anda bukan 2.7+, maka kunjungi 26 | http://python.org/download/releases/2.7.2/ dan install versi 2.7.2 27 | 28 | ******************** 29 | Instalasi (opsional) 30 | ******************** 31 | 32 | 1. Install `python pip `_ 33 | 2. Masuk ke direktori tempat anda meng-*clone* repositori ini ``cd ci-user-guide-id`` 34 | 3. Jalankan perintah ``pip install --upgrade pip`` untuk update ke versi ``pip`` terbaru (opsional) 35 | 4. Lalu, Jalankan perintah ``pip install -r requirements.txt`` untuk menginstall semua dependensi yang dibutuhkan 36 | 5. Install CI Lexer untuk PHP, HTML, CSS, and JavaScript *syntax highlighting* di contoh (lihat di ``cilexer/README``) atau agar lebih mudah jalankan perintah ``easy_install cilexer`` 37 | 6. Terakhir, jalankan perintah ``make html`` 38 | 39 | **Catatan:** Anda tidak harus meng-*install* semua kebutuhan diatas jika anda hanya ingin berkontribusi alih bahasa saja, 40 | kecuali jika anda juga ingin melihat hasil html dari *compile*. 41 | 42 | ******************************** 43 | Mengubah dan Membuat Dokumentasi 44 | ******************************** 45 | 46 | Semua sumber file berada di dalam folder ``source/`` dan di folder itulah Anda akan menambahkan 47 | dokumentasi baru atau memodifikasi dokumentasi yang ada. Sama seperti dengan mengubah kode, 48 | kami sarankan Anda bekerja dari branch ``feature`` dan membuat ``pull request`` ke repository ini. 49 | 50 | ******************* 51 | Dimanakah HTML nya? 52 | ******************* 53 | 54 | *Generate* file HTML sangat simple. Dari *root directory* repository ini, Anda cukup 55 | menjalankan perintah:: 56 | 57 | make html 58 | 59 | Anda akan melihat proses *compile* yang nanti akan otomatis membuat folder 60 | ``build/html`` dan menyimpan file-file HTML ke folder tersebut. Jika file HTML telah dibuat 61 | dan jika Anda ingin *generate* file HTML yang baru, setiap kali proses *generate* berhasil 62 | hanya *generate* ulang file yang diubah untuk menghemat waktu. 63 | Jika Anda ingin *reset* file HTML Anda, cukup hapus folder ``build`` atau dapat anda lakukan dengan 64 | menjalankan perintah ``make clean`` dan *generate* ulang seperti proses sebelumnya. 65 | 66 | *************** 67 | Panduan Styling 68 | *************** 69 | 70 | Silahkan lihat ``source/documentation/index.rst`` untuk panduan umum tentang 71 | menggunakan Sphinx untuk dokumentasi Codeigniter. 72 | -------------------------------------------------------------------------------- /cilexer/README: -------------------------------------------------------------------------------- 1 | To install the CodeIgniter Lexer to Pygments, run: 2 | 3 | sudo python setup.py install 4 | 5 | Confirm with 6 | 7 | pygmentize -L 8 | 9 | 10 | You should see in the lexer output: 11 | 12 | * ci, codeigniter: 13 | CodeIgniter (filenames *.html, *.css, *.php, *.xml, *.static) 14 | 15 | You will need to run setup.py and install the cilexer package anytime after cilexer/cilexer.py is updated 16 | 17 | NOTE: Depending on how you installed Sphinx and Pygments, 18 | you may be installing to the wrong version. 19 | If you need to install to a different version of python 20 | specify its path when using setup.py, e.g.: 21 | 22 | sudo /usr/bin/python2.5 setup.py install -------------------------------------------------------------------------------- /cilexer/build/lib.linux-x86_64-2.7/cilexer/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cilexer/build/lib.linux-x86_64-2.7/cilexer/cilexer.py: -------------------------------------------------------------------------------- 1 | # CodeIgniter 2 | # http://codeigniter.com 3 | # 4 | # An open source application development framework for PHP 5 | # 6 | # This content is released under the MIT License (MIT) 7 | # 8 | # Copyright (c) 2014 - 2015, British Columbia Institute of Technology 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in 18 | # all copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | # THE SOFTWARE. 27 | # 28 | # Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) 29 | # Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) 30 | # 31 | # http://opensource.org/licenses/MIT MIT License 32 | 33 | import re 34 | import copy 35 | 36 | from pygments.lexer import DelegatingLexer 37 | from pygments.lexers.web import PhpLexer, HtmlLexer 38 | 39 | __all__ = ['CodeIgniterLexer'] 40 | 41 | 42 | class CodeIgniterLexer(DelegatingLexer): 43 | """ 44 | Handles HTML, PHP, JavaScript, and CSS is highlighted 45 | PHP is highlighted with the "startline" option 46 | """ 47 | 48 | name = 'CodeIgniter' 49 | aliases = ['ci', 'codeigniter'] 50 | filenames = ['*.html', '*.css', '*.php', '*.xml', '*.static'] 51 | mimetypes = ['text/html', 'application/xhtml+xml'] 52 | 53 | def __init__(self, **options): 54 | super(CodeIgniterLexer, self).__init__(HtmlLexer, 55 | PhpLexer, 56 | startinline=True) 57 | -------------------------------------------------------------------------------- /cilexer/cilexer/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cilexer/cilexer/cilexer.py: -------------------------------------------------------------------------------- 1 | # CodeIgniter 2 | # http://codeigniter.com 3 | # 4 | # An open source application development framework for PHP 5 | # 6 | # This content is released under the MIT License (MIT) 7 | # 8 | # Copyright (c) 2014 - 2015, British Columbia Institute of Technology 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a copy 11 | # of this software and associated documentation files (the "Software"), to deal 12 | # in the Software without restriction, including without limitation the rights 13 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | # copies of the Software, and to permit persons to whom the Software is 15 | # furnished to do so, subject to the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included in 18 | # all copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | # THE SOFTWARE. 27 | # 28 | # Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) 29 | # Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) 30 | # 31 | # http://opensource.org/licenses/MIT MIT License 32 | 33 | import re 34 | import copy 35 | 36 | from pygments.lexer import DelegatingLexer 37 | from pygments.lexers.web import PhpLexer, HtmlLexer 38 | 39 | __all__ = ['CodeIgniterLexer'] 40 | 41 | 42 | class CodeIgniterLexer(DelegatingLexer): 43 | """ 44 | Handles HTML, PHP, JavaScript, and CSS is highlighted 45 | PHP is highlighted with the "startline" option 46 | """ 47 | 48 | name = 'CodeIgniter' 49 | aliases = ['ci', 'codeigniter'] 50 | filenames = ['*.html', '*.css', '*.php', '*.xml', '*.static'] 51 | mimetypes = ['text/html', 'application/xhtml+xml'] 52 | 53 | def __init__(self, **options): 54 | super(CodeIgniterLexer, self).__init__(HtmlLexer, 55 | PhpLexer, 56 | startinline=True) 57 | -------------------------------------------------------------------------------- /cilexer/pycilexer.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: pycilexer 3 | Version: 0.1 4 | Summary: 5 | Install and setup CodeIgniter highlighting for Pygments. 6 | 7 | Home-page: UNKNOWN 8 | Author: EllisLab, Inc. 9 | Author-email: UNKNOWN 10 | License: UNKNOWN 11 | Description: UNKNOWN 12 | Platform: UNKNOWN 13 | -------------------------------------------------------------------------------- /cilexer/pycilexer.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | README 2 | setup.cfg 3 | setup.py 4 | cilexer/__init__.py 5 | cilexer/cilexer.py 6 | pycilexer.egg-info/PKG-INFO 7 | pycilexer.egg-info/SOURCES.txt 8 | pycilexer.egg-info/dependency_links.txt 9 | pycilexer.egg-info/entry_points.txt 10 | pycilexer.egg-info/requires.txt 11 | pycilexer.egg-info/top_level.txt -------------------------------------------------------------------------------- /cilexer/pycilexer.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cilexer/pycilexer.egg-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | 2 | [pygments.lexers] 3 | cilexer = cilexer.cilexer:CodeIgniterLexer 4 | -------------------------------------------------------------------------------- /cilexer/pycilexer.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | sphinx >= 1.0.7 2 | sphinxcontrib-phpdomain >= 0.1.3-1 3 | -------------------------------------------------------------------------------- /cilexer/pycilexer.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | cilexer 2 | -------------------------------------------------------------------------------- /cilexer/setup.cfg: -------------------------------------------------------------------------------- 1 | [easy_install] 2 | 3 | -------------------------------------------------------------------------------- /cilexer/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | Install and setup CodeIgniter highlighting for Pygments. 3 | """ 4 | 5 | from setuptools import setup 6 | 7 | entry_points = """ 8 | [pygments.lexers] 9 | cilexer = cilexer.cilexer:CodeIgniterLexer 10 | """ 11 | 12 | setup( 13 | name='pycilexer', 14 | version='0.1', 15 | description=__doc__, 16 | author="EllisLab, Inc.", 17 | packages=['cilexer'], 18 | install_requires=( 19 | 'sphinx >= 1.0.7', 20 | 'sphinxcontrib-phpdomain >= 0.1.3-1' 21 | ), 22 | entry_points=entry_points 23 | ) 24 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pygments 2 | sphinx 3 | sphinx-autobuild 4 | sphinxcontrib-phpdomain 5 | sphinxcontrib-manpage -------------------------------------------------------------------------------- /source/DCO.rst: -------------------------------------------------------------------------------- 1 | ##################################### 2 | Developer's Certificate of Origin 1.1 3 | ##################################### 4 | 5 | By making a contribution to this project, I certify that: 6 | 7 | (1) The contribution was created in whole or in part by me and I 8 | have the right to submit it under the open source license 9 | indicated in the file; or 10 | 11 | (2) The contribution is based upon previous work that, to the best 12 | of my knowledge, is covered under an appropriate open source 13 | license and I have the right under that license to submit that 14 | work with modifications, whether created in whole or in part 15 | by me, under the same open source license (unless I am 16 | permitted to submit under a different license), as indicated 17 | in the file; or 18 | 19 | (3) The contribution was provided directly to me by some other 20 | person who certified (1), (2) or (3) and I have not modified 21 | it. 22 | 23 | (4) I understand and agree that this project and the contribution 24 | are public and that a record of the contribution (including all 25 | personal information I submit with it, including my sign-off) is 26 | maintained indefinitely and may be redistributed consistent with 27 | this project or the open source license(s) involved. 28 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Dave Snider 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | """Sphinx ReadTheDocs theme. 2 | 3 | From https://github.com/ryan-roemer/sphinx-bootstrap-theme. 4 | 5 | """ 6 | import os 7 | 8 | VERSION = (0, 1, 5) 9 | 10 | __version__ = ".".join(str(v) for v in VERSION) 11 | __version_full__ = __version__ 12 | 13 | 14 | def get_html_theme_path(): 15 | """Return list of HTML theme paths.""" 16 | cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 17 | return cur_dir 18 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/breadcrumbs.html: -------------------------------------------------------------------------------- 1 |
2 | 21 |
22 |
23 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/footer.html: -------------------------------------------------------------------------------- 1 |
2 | {% if next or prev %} 3 | 11 | {% endif %} 12 | 13 |
14 | 15 |
16 |

17 | {%- if show_copyright %} 18 | {%- if hasdoc('copyright') %} 19 | {% trans path=pathto('copyright'), copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} 20 | {%- else %} 21 | {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} 22 | {%- endif %} 23 | {%- endif %} 24 | 25 | {%- if last_updated %} 26 | {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} 27 | {%- endif %} 28 |

29 |
30 | 31 | {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. 32 | 33 |
34 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/pulldown.html: -------------------------------------------------------------------------------- 1 | 13 | 18 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/search.html: -------------------------------------------------------------------------------- 1 | {# 2 | basic/search.html 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | Template for the search page. 6 | 7 | :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | #} 10 | {%- extends "layout.html" %} 11 | {% set title = _('Search') %} 12 | {% set script_files = script_files + ['_static/searchtools.js'] %} 13 | {% block footer %} 14 | 17 | {# this is used when loading the search index using $.ajax fails, 18 | such as on Chrome for documents on localhost #} 19 | 20 | {{ super() }} 21 | {% endblock %} 22 | {% block body %} 23 | 31 | 32 | {% if search_performed %} 33 |

{{ _('Search Results') }}

34 | {% if not search_results %} 35 |

{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}

36 | {% endif %} 37 | {% endif %} 38 |
39 | {% if search_results %} 40 |
    41 | {% for href, caption, context in search_results %} 42 |
  • 43 | {{ caption }} 44 |

    {{ context|e }}

    45 |
  • 46 | {% endfor %} 47 |
48 | {% endif %} 49 |
50 | {% endblock %} 51 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if builder != 'singlehtml' %} 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | {%- endif %} 10 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}} 2 | /*# sourceMappingURL=badge_only.css.map */ 3 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/css/citheme.css: -------------------------------------------------------------------------------- 1 | @import 'theme.css'; 2 | 3 | .highlighted { 4 | padding: 0px !important; 5 | font-weight: inherit !important; 6 | background-color: #f1d40f !important; 7 | } 8 | 9 | #nav { 10 | background-color: #494949; 11 | margin: 0; 12 | padding: 0; 13 | display: none; 14 | } 15 | 16 | #nav2 { 17 | background: url(data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAAAf/bAIQABAMDAwMDBAMDBAYEAwQGBwUEBAUHCAYGBwYGCAoICQkJCQgKCgwMDAwMCgwMDQ0MDBERERERFBQUFBQUFBQUFAEEBQUIBwgPCgoPFA4ODhQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgAMgAzAwERAAIRAQMRAf/EAFkAAQADAQAAAAAAAAAAAAAAAAABBQcIAQEAAAAAAAAAAAAAAAAAAAAAEAABAgYDAAAAAAAAAAAAAAAAAVERAtMEFJRVBxgRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AMRAAAAAAAA7a87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wHnbrLgV272uA87dZcCu3e1wN/wJGAYEjAMCRgGBIwDAkYBgSMAwJGAsoIwCCMAgjAIIwCCMAgjAIIwEgAAAAAAAAAAAAAAAAAAAAAAAH//2Q==) repeat-x scroll left top transparent; 18 | margin: 0; 19 | padding: 0 310px 0 0; 20 | text-align: right; 21 | display: none; 22 | } 23 | 24 | #nav_inner { 25 | background-color: transparent; 26 | font-family: Lucida Grande,Verdana,Geneva,sans-serif; 27 | font-size: 11px; 28 | margin: 0; 29 | padding: 8px 12px 0 20px; 30 | } 31 | 32 | div#pulldown-menu { 33 | -moz-column-count: 5; 34 | -moz-column-gap: 20px; 35 | -webkit-column-count: 5; 36 | -webkit-column-gap: 20px; 37 | column-count: 5; 38 | column-gap: 20px; 39 | -webkit-column-rule: 1px groove #b8b8b8; 40 | -moz-column-rule: 1px groove #b8b8b8; 41 | column-rule: 1px groove #b8b8b8; 42 | } 43 | 44 | #pulldown-menu > ul { 45 | padding-top: 10px; 46 | padding-bottom: 10px; 47 | -webkit-column-break-inside: avoid; /*Chrome, Safari*/ 48 | display: table; /*Firefox*/ 49 | break-inside: avoid; /*IE 10+ theoretically*/ 50 | } 51 | 52 | #pulldown-menu ul li.toctree-l2 { 53 | font-size: 0.82em; 54 | margin-left: 20px; 55 | list-style-image: url(data:image/gif;base64,R0lGODlhCwAJALMJAO7u7uTk5PLy8unp6fb29t7e3vj4+Li4uIWFheTk5AAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAAALAAkAAAQoMJ1JqTQ4Z3SI98jHCWSJkByArCyiHkMsIzEX3DeCc0Xv+4hEa5iIAAA7); 56 | } 57 | 58 | #pulldown-menu ul li.toctree-l1 a { 59 | color: #ffffff; 60 | text-decoration: none; 61 | font-size: 12px; 62 | font-family: "Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif; 63 | font-weight: 700; 64 | } 65 | 66 | #pulldown-menu ul li.toctree-l2 a { 67 | text-decoration: none; 68 | font-size: 11px; 69 | line-height: 1.4em; 70 | font-weight: 300; 71 | font-family: Lucida Grande,Verdana,Geneva,sans-serif; 72 | color: #aaaaaa; 73 | } -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/js/oldtheme.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | // Shift nav in mobile when clicking the menu. 3 | $(document).on('click', "[data-toggle='wy-nav-top']", function() { 4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift"); 5 | $("[data-toggle='rst-versions']").toggleClass("shift"); 6 | }); 7 | // Close menu when you click a link. 8 | $(document).on('click', ".wy-menu-vertical .current ul li a", function() { 9 | $("[data-toggle='wy-nav-shift']").removeClass("shift"); 10 | $("[data-toggle='rst-versions']").toggleClass("shift"); 11 | }); 12 | $(document).on('click', "[data-toggle='rst-current-version']", function() { 13 | $("[data-toggle='rst-versions']").toggleClass("shift-up"); 14 | }); 15 | // Make tables responsive 16 | $("table.docutils:not(.field-list)").wrap("
"); 17 | }); 18 | 19 | window.SphinxRtdTheme = (function (jquery) { 20 | var stickyNav = (function () { 21 | var navBar, 22 | win, 23 | stickyNavCssClass = 'stickynav', 24 | applyStickNav = function () { 25 | if (navBar.height() <= win.height()) { 26 | navBar.addClass(stickyNavCssClass); 27 | } else { 28 | navBar.removeClass(stickyNavCssClass); 29 | } 30 | }, 31 | enable = function () { 32 | applyStickNav(); 33 | win.on('resize', applyStickNav); 34 | }, 35 | init = function () { 36 | navBar = jquery('nav.wy-nav-side:first'); 37 | win = jquery(window); 38 | }; 39 | jquery(init); 40 | return { 41 | enable : enable 42 | }; 43 | }()); 44 | return { 45 | StickyNav : stickyNav 46 | }; 47 | }($)); 48 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/static/js/theme.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | // Shift nav in mobile when clicking the menu. 3 | $(document).on('click', "[data-toggle='wy-nav-top']", function () { 4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift"); 5 | $("[data-toggle='rst-versions']").toggleClass("shift"); 6 | }); 7 | // Close menu when you click a link. 8 | $(document).on('click', ".wy-menu-vertical .current ul li a", function () { 9 | $("[data-toggle='wy-nav-shift']").removeClass("shift"); 10 | $("[data-toggle='rst-versions']").toggleClass("shift"); 11 | }); 12 | $(document).on('click', "[data-toggle='rst-current-version']", function () { 13 | $("[data-toggle='rst-versions']").toggleClass("shift-up"); 14 | }); 15 | // Make tables responsive 16 | $("table.docutils:not(.field-list)").wrap("
"); 17 | // --- 18 | // START DOC MODIFICATION BY RUFNEX 19 | // v1.0 04.02.2015 20 | // Add ToogleButton to get FullWidth-View by Johannes Gamperl codeigniter.de 21 | 22 | $('#openToc').click(function () { 23 | $('#nav').slideToggle(); 24 | }); 25 | $('#closeMe').toggle( 26 | function () 27 | { 28 | setCookie('ciNav', true, 365); 29 | $('#nav2').show(); 30 | $('#topMenu').remove(); 31 | $('body').css({background: 'none'}); 32 | $('.wy-nav-content-wrap').css({background: 'none', 'margin-left': 0}); 33 | $('.wy-breadcrumbs').append('
' + $('.wy-form').parent().html() + '
'); 34 | $('.wy-nav-side').toggle(); 35 | }, 36 | function () 37 | { 38 | setCookie('ciNav', false, 365); 39 | $('#topMenu').remove(); 40 | $('#nav').hide(); 41 | $('#nav2').hide(); 42 | $('body').css({background: '#edf0f2;'}); 43 | $('.wy-nav-content-wrap').css({background: 'none repeat scroll 0 0 #fcfcfc;', 'margin-left': '300px'}); 44 | $('.wy-nav-side').show(); 45 | } 46 | ); 47 | if (getCookie('ciNav') == 'true') 48 | { 49 | $('#closeMe').trigger('click'); 50 | //$('#nav').slideToggle(); 51 | } 52 | // END MODIFICATION --- 53 | }); 54 | 55 | // Rufnex Cookie functions 56 | function setCookie(cname, cvalue, exdays) { 57 | var d = new Date(); 58 | d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 59 | var expires = "expires=" + d.toGMTString(); 60 | document.cookie = cname + "=" + cvalue + "; " + expires; 61 | } 62 | function getCookie(cname) { 63 | var name = cname + "="; 64 | var ca = document.cookie.split(';'); 65 | for (var i = 0; i < ca.length; i++) { 66 | var c = ca[i]; 67 | while (c.charAt(0) == ' ') 68 | c = c.substring(1); 69 | if (c.indexOf(name) == 0) { 70 | return c.substring(name.length, c.length); 71 | } 72 | } 73 | return false; 74 | } 75 | // End 76 | 77 | window.SphinxRtdTheme = (function (jquery) { 78 | var stickyNav = (function () { 79 | var navBar, 80 | win, 81 | stickyNavCssClass = 'stickynav', 82 | applyStickNav = function () { 83 | if (navBar.height() <= win.height()) { 84 | navBar.addClass(stickyNavCssClass); 85 | } else { 86 | navBar.removeClass(stickyNavCssClass); 87 | } 88 | }, 89 | enable = function () { 90 | applyStickNav(); 91 | win.on('resize', applyStickNav); 92 | }, 93 | init = function () { 94 | navBar = jquery('nav.wy-nav-side:first'); 95 | win = jquery(window); 96 | }; 97 | jquery(init); 98 | return { 99 | enable: enable 100 | }; 101 | }()); 102 | return { 103 | StickyNav: stickyNav 104 | }; 105 | }($)); 106 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = css/citheme.css 4 | 5 | [options] 6 | typekit_id = hiw1hhg 7 | analytics_id = 8 | sticky_navigation = False 9 | -------------------------------------------------------------------------------- /source/_themes/sphinx_rtd_theme/versions.html: -------------------------------------------------------------------------------- 1 | {% if READTHEDOCS %} 2 | {# Add rst-badge after rst-versions for small badge style. #} 3 |
4 | 5 | Read the Docs 6 | v: {{ current_version }} 7 | 8 | 9 |
10 |
11 |
Versions
12 | {% for slug, url in versions %} 13 |
{{ slug }}
14 | {% endfor %} 15 |
16 |
17 |
Downloads
18 | {% for type, url in downloads %} 19 |
{{ type }}
20 | {% endfor %} 21 |
22 |
23 |
On Read the Docs
24 |
25 | Project Home 26 |
27 |
28 | Builds 29 |
30 |
31 |
32 | Free document hosting provided by Read the Docs. 33 | 34 |
35 |
36 | {% endif %} 37 | 38 | -------------------------------------------------------------------------------- /source/database/call_function.rst: -------------------------------------------------------------------------------- 1 | ##################### 2 | Custom Function Calls 3 | ##################### 4 | 5 | $this->db->call_function(); 6 | ============================ 7 | 8 | This function enables you to call PHP database functions that are not 9 | natively included in CodeIgniter, in a platform independent manner. For 10 | example, let's say you want to call the mysql_get_client_info() 11 | function, which is **not** natively supported by CodeIgniter. You could 12 | do so like this:: 13 | 14 | $this->db->call_function('get_client_info'); 15 | 16 | You must supply the name of the function, **without** the mysql\_ 17 | prefix, in the first parameter. The prefix is added automatically based 18 | on which database driver is currently being used. This permits you to 19 | run the same function on different database platforms. Obviously not all 20 | function calls are identical between platforms, so there are limits to 21 | how useful this function can be in terms of portability. 22 | 23 | Any parameters needed by the function you are calling will be added to 24 | the second parameter. 25 | 26 | :: 27 | 28 | $this->db->call_function('some_function', $param1, $param2, etc..); 29 | 30 | Often, you will either need to supply a database connection ID or a 31 | database result ID. The connection ID can be accessed using:: 32 | 33 | $this->db->conn_id; 34 | 35 | The result ID can be accessed from within your result object, like this:: 36 | 37 | $query = $this->db->query("SOME QUERY"); 38 | 39 | $query->result_id; -------------------------------------------------------------------------------- /source/database/connecting.rst: -------------------------------------------------------------------------------- 1 | ################################## 2 | Menghubungkan dengan Database Anda 3 | ################################## 4 | 5 | There are two ways to connect to a database: 6 | 7 | Automatically Connecting 8 | ======================== 9 | 10 | The "auto connect" feature will load and instantiate the database class 11 | with every page load. To enable "auto connecting", add the word database 12 | to the library array, as indicated in the following file: 13 | 14 | application/config/autoload.php 15 | 16 | Manually Connecting 17 | =================== 18 | 19 | If only some of your pages require database connectivity you can 20 | manually connect to your database by adding this line of code in any 21 | function where it is needed, or in your class constructor to make the 22 | database available globally in that class. 23 | 24 | :: 25 | 26 | $this->load->database(); 27 | 28 | If the above function does **not** contain any information in the first 29 | parameter it will connect to the group specified in your database config 30 | file. For most people, this is the preferred method of use. 31 | 32 | Available Parameters 33 | -------------------- 34 | 35 | #. The database connection values, passed either as an array or a DSN 36 | string. 37 | #. TRUE/FALSE (boolean). Whether to return the connection ID (see 38 | Connecting to Multiple Databases below). 39 | #. TRUE/FALSE (boolean). Whether to enable the Query Builder class. Set 40 | to TRUE by default. 41 | 42 | Manually Connecting to a Database 43 | --------------------------------- 44 | 45 | The first parameter of this function can **optionally** be used to 46 | specify a particular database group from your config file, or you can 47 | even submit connection values for a database that is not specified in 48 | your config file. Examples: 49 | 50 | To choose a specific group from your config file you can do this:: 51 | 52 | $this->load->database('group_name'); 53 | 54 | Where group_name is the name of the connection group from your config 55 | file. 56 | 57 | To connect manually to a desired database you can pass an array of 58 | values:: 59 | 60 | $config['hostname'] = 'localhost'; 61 | $config['username'] = 'myusername'; 62 | $config['password'] = 'mypassword'; 63 | $config['database'] = 'mydatabase'; 64 | $config['dbdriver'] = 'mysqli'; 65 | $config['dbprefix'] = ''; 66 | $config['pconnect'] = FALSE; 67 | $config['db_debug'] = TRUE; 68 | $config['cache_on'] = FALSE; 69 | $config['cachedir'] = ''; 70 | $config['char_set'] = 'utf8'; 71 | $config['dbcollat'] = 'utf8_general_ci'; 72 | $this->load->database($config); 73 | 74 | For information on each of these values please see the :doc:`configuration 75 | page `. 76 | 77 | .. note:: For the PDO driver, you should use the $config['dsn'] setting 78 | instead of 'hostname' and 'database': 79 | 80 | | 81 | | $config['dsn'] = 'mysql:host=localhost;dbname=mydatabase'; 82 | 83 | Or you can submit your database values as a Data Source Name. DSNs must 84 | have this prototype:: 85 | 86 | $dsn = 'dbdriver://username:password@hostname/database'; 87 | $this->load->database($dsn); 88 | 89 | To override default config values when connecting with a DSN string, add 90 | the config variables as a query string. 91 | 92 | :: 93 | 94 | $dsn = 'dbdriver://username:password@hostname/database?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=/path/to/cache'; 95 | $this->load->database($dsn); 96 | 97 | Connecting to Multiple Databases 98 | ================================ 99 | 100 | If you need to connect to more than one database simultaneously you can 101 | do so as follows:: 102 | 103 | $DB1 = $this->load->database('group_one', TRUE); 104 | $DB2 = $this->load->database('group_two', TRUE); 105 | 106 | Note: Change the words "group_one" and "group_two" to the specific 107 | group names you are connecting to (or you can pass the connection values 108 | as indicated above). 109 | 110 | By setting the second parameter to TRUE (boolean) the function will 111 | return the database object. 112 | 113 | .. note:: When you connect this way, you will use your object name to issue 114 | commands rather than the syntax used throughout this guide. In other 115 | words, rather than issuing commands with: 116 | 117 | | 118 | | $this->db->query(); 119 | | $this->db->result(); 120 | | etc... 121 | | 122 | | You will instead use: 123 | | 124 | | $DB1->query(); 125 | | $DB1->result(); 126 | | etc... 127 | 128 | .. note:: You don't need to create separate database configurations if you 129 | only need to use a different database on the same connection. You 130 | can switch to a different database when you need to, like this: 131 | 132 | | $this->db->db_select($database2_name); 133 | 134 | Reconnecting / Keeping the Connection Alive 135 | =========================================== 136 | 137 | If the database server's idle timeout is exceeded while you're doing 138 | some heavy PHP lifting (processing an image, for instance), you should 139 | consider pinging the server by using the reconnect() method before 140 | sending further queries, which can gracefully keep the connection alive 141 | or re-establish it. 142 | 143 | :: 144 | 145 | $this->db->reconnect(); 146 | 147 | Manually closing the Connection 148 | =============================== 149 | 150 | While CodeIgniter intelligently takes care of closing your database 151 | connections, you can explicitly close the connection. 152 | 153 | :: 154 | 155 | $this->db->close(); 156 | -------------------------------------------------------------------------------- /source/database/examples.rst: -------------------------------------------------------------------------------- 1 | ################################# 2 | Database Quick Start: Contoh Code 3 | ################################# 4 | 5 | The following page contains example code showing how the database class 6 | is used. For complete details please read the individual pages 7 | describing each function. 8 | 9 | Initializing the Database Class 10 | =============================== 11 | 12 | The following code loads and initializes the database class based on 13 | your :doc:`configuration ` settings:: 14 | 15 | $this->load->database(); 16 | 17 | Once loaded the class is ready to be used as described below. 18 | 19 | Note: If all your pages require database access you can connect 20 | automatically. See the :doc:`connecting ` page for details. 21 | 22 | Standard Query With Multiple Results (Object Version) 23 | ===================================================== 24 | 25 | :: 26 | 27 | $query = $this->db->query('SELECT name, title, email FROM my_table'); 28 | 29 | foreach ($query->result() as $row) 30 | { 31 | echo $row->title; 32 | echo $row->name; 33 | echo $row->email; 34 | } 35 | 36 | echo 'Total Results: ' . $query->num_rows(); 37 | 38 | The above result() function returns an array of **objects**. Example: 39 | $row->title 40 | 41 | Standard Query With Multiple Results (Array Version) 42 | ==================================================== 43 | 44 | :: 45 | 46 | $query = $this->db->query('SELECT name, title, email FROM my_table'); 47 | 48 | foreach ($query->result_array() as $row) 49 | { 50 | echo $row['title']; 51 | echo $row['name']; 52 | echo $row['email']; 53 | } 54 | 55 | The above result_array() function returns an array of standard array 56 | indexes. Example: $row['title'] 57 | 58 | Testing for Results 59 | =================== 60 | 61 | If you run queries that might **not** produce a result, you are 62 | encouraged to test for a result first using the num_rows() function:: 63 | 64 | $query = $this->db->query("YOUR QUERY"); 65 | if ($query->num_rows() > 0) 66 | { 67 | foreach ($query->result() as $row) 68 | { 69 | echo $row->title; 70 | echo $row->name; 71 | echo $row->body; 72 | } 73 | } 74 | 75 | Standard Query With Single Result 76 | ================================= 77 | 78 | :: 79 | 80 | $query = $this->db->query('SELECT name FROM my_table LIMIT 1'); 81 | $row = $query->row(); 82 | echo $row->name; 83 | 84 | The above row() function returns an **object**. Example: $row->name 85 | 86 | Standard Query With Single Result (Array version) 87 | ================================================= 88 | 89 | :: 90 | 91 | $query = $this->db->query('SELECT name FROM my_table LIMIT 1'); 92 | $row = $query->row_array(); 93 | echo $row['name']; 94 | 95 | The above row_array() function returns an **array**. Example: 96 | $row['name'] 97 | 98 | Standard Insert 99 | =============== 100 | 101 | :: 102 | 103 | $sql = "INSERT INTO mytable (title, name) VALUES (".$this->db->escape($title).", ".$this->db->escape($name).")"; 104 | $this->db->query($sql); 105 | echo $this->db->affected_rows(); 106 | 107 | Query Builder Query 108 | =================== 109 | 110 | The :doc:`Query Builder Pattern ` gives you a simplified 111 | means of retrieving data:: 112 | 113 | $query = $this->db->get('table_name'); 114 | 115 | foreach ($query->result() as $row) 116 | { 117 | echo $row->title; 118 | } 119 | 120 | The above get() function retrieves all the results from the supplied 121 | table. The :doc:`Query Builder ` class contains a full 122 | compliment of functions for working with data. 123 | 124 | Query Builder Insert 125 | ==================== 126 | 127 | :: 128 | 129 | $data = array( 130 | 'title' => $title, 131 | 'name' => $name, 132 | 'date' => $date 133 | ); 134 | 135 | $this->db->insert('mytable', $data); // Produces: INSERT INTO mytable (title, name, date) VALUES ('{$title}', '{$name}', '{$date}') 136 | 137 | -------------------------------------------------------------------------------- /source/database/helpers.rst: -------------------------------------------------------------------------------- 1 | #################### 2 | Query Helper Methods 3 | #################### 4 | 5 | Information From Executing a Query 6 | ================================== 7 | 8 | **$this->db->insert_id()** 9 | 10 | The insert ID number when performing database inserts. 11 | 12 | .. note:: If using the PDO driver with PostgreSQL, or using the Interbase 13 | driver, this function requires a $name parameter, which specifies the 14 | appropriate sequence to check for the insert id. 15 | 16 | **$this->db->affected_rows()** 17 | 18 | Displays the number of affected rows, when doing "write" type queries 19 | (insert, update, etc.). 20 | 21 | .. note:: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database 22 | class has a small hack that allows it to return the correct number of 23 | affected rows. By default this hack is enabled but it can be turned off 24 | in the database driver file. 25 | 26 | **$this->db->last_query()** 27 | 28 | Returns the last query that was run (the query string, not the result). 29 | Example:: 30 | 31 | $str = $this->db->last_query(); 32 | 33 | // Produces: SELECT * FROM sometable.... 34 | 35 | 36 | .. note:: Disabling the **save_queries** setting in your database 37 | configuration will render this function useless. 38 | 39 | Information About Your Database 40 | =============================== 41 | 42 | **$this->db->count_all()** 43 | 44 | Permits you to determine the number of rows in a particular table. 45 | Submit the table name in the first parameter. Example:: 46 | 47 | echo $this->db->count_all('my_table'); 48 | 49 | // Produces an integer, like 25 50 | 51 | **$this->db->platform()** 52 | 53 | Outputs the database platform you are running (MySQL, MS SQL, Postgres, 54 | etc...):: 55 | 56 | echo $this->db->platform(); 57 | 58 | **$this->db->version()** 59 | 60 | Outputs the database version you are running:: 61 | 62 | echo $this->db->version(); 63 | 64 | Making Your Queries Easier 65 | ========================== 66 | 67 | **$this->db->insert_string()** 68 | 69 | This function simplifies the process of writing database inserts. It 70 | returns a correctly formatted SQL insert string. Example:: 71 | 72 | $data = array('name' => $name, 'email' => $email, 'url' => $url); 73 | 74 | $str = $this->db->insert_string('table_name', $data); 75 | 76 | The first parameter is the table name, the second is an associative 77 | array with the data to be inserted. The above example produces:: 78 | 79 | INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com') 80 | 81 | .. note:: Values are automatically escaped, producing safer queries. 82 | 83 | **$this->db->update_string()** 84 | 85 | This function simplifies the process of writing database updates. It 86 | returns a correctly formatted SQL update string. Example:: 87 | 88 | $data = array('name' => $name, 'email' => $email, 'url' => $url); 89 | 90 | $where = "author_id = 1 AND status = 'active'"; 91 | 92 | $str = $this->db->update_string('table_name', $data, $where); 93 | 94 | The first parameter is the table name, the second is an associative 95 | array with the data to be updated, and the third parameter is the 96 | "where" clause. The above example produces:: 97 | 98 | UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active' 99 | 100 | .. note:: Values are automatically escaped, producing safer queries. -------------------------------------------------------------------------------- /source/database/index.rst: -------------------------------------------------------------------------------- 1 | ################## 2 | Referensi Database 3 | ################## 4 | 5 | CodeIgniter comes with a full-featured and very fast abstracted database 6 | class that supports both traditional structures and Query Builder 7 | patterns. The database functions offer clear, simple syntax. 8 | 9 | .. toctree:: 10 | :titlesonly: 11 | 12 | Quick Start: Contoh Penggunaan 13 | Konfigurasi Database 14 | Menghubungkan ke Database 15 | Menjalankan Queries 16 | Menampilkan Hasil Query 17 | Fungsi-fungsi Query Helper 18 | Query Builder Class 19 | Transactions 20 | Mendapatkan MetaData 21 | Memanggil Custom Functions 22 | Query Caching 23 | Manipulasi Database dengan Database Forge 24 | Database Utilities Class 25 | Referensi Database Driver 26 | -------------------------------------------------------------------------------- /source/database/metadata.rst: -------------------------------------------------------------------------------- 1 | ################# 2 | Database Metadata 3 | ################# 4 | 5 | ************** 6 | Table MetaData 7 | ************** 8 | 9 | These functions let you fetch table information. 10 | 11 | List the Tables in Your Database 12 | ================================ 13 | 14 | **$this->db->list_tables();** 15 | 16 | Returns an array containing the names of all the tables in the database 17 | you are currently connected to. Example:: 18 | 19 | $tables = $this->db->list_tables(); 20 | 21 | foreach ($tables as $table) 22 | { 23 | echo $table; 24 | } 25 | 26 | 27 | Determine If a Table Exists 28 | =========================== 29 | 30 | **$this->db->table_exists();** 31 | 32 | Sometimes it's helpful to know whether a particular table exists before 33 | running an operation on it. Returns a boolean TRUE/FALSE. Usage example:: 34 | 35 | if ($this->db->table_exists('table_name')) 36 | { 37 | // some code... 38 | } 39 | 40 | .. note:: Replace *table_name* with the name of the table you are looking for. 41 | 42 | 43 | ************** 44 | Field MetaData 45 | ************** 46 | 47 | List the Fields in a Table 48 | ========================== 49 | 50 | **$this->db->list_fields()** 51 | 52 | Returns an array containing the field names. This query can be called 53 | two ways: 54 | 55 | 1. You can supply the table name and call it from the $this->db-> 56 | object:: 57 | 58 | $fields = $this->db->list_fields('table_name'); 59 | 60 | foreach ($fields as $field) 61 | { 62 | echo $field; 63 | } 64 | 65 | 2. You can gather the field names associated with any query you run by 66 | calling the function from your query result object:: 67 | 68 | $query = $this->db->query('SELECT * FROM some_table'); 69 | 70 | foreach ($query->list_fields() as $field) 71 | { 72 | echo $field; 73 | } 74 | 75 | 76 | Determine If a Field is Present in a Table 77 | ========================================== 78 | 79 | **$this->db->field_exists()** 80 | 81 | Sometimes it's helpful to know whether a particular field exists before 82 | performing an action. Returns a boolean TRUE/FALSE. Usage example:: 83 | 84 | if ($this->db->field_exists('field_name', 'table_name')) 85 | { 86 | // some code... 87 | } 88 | 89 | .. note:: Replace *field_name* with the name of the column you are looking 90 | for, and replace *table_name* with the name of the table you are 91 | looking for. 92 | 93 | 94 | Retrieve Field Metadata 95 | ======================= 96 | 97 | **$this->db->field_data()** 98 | 99 | Returns an array of objects containing field information. 100 | 101 | Sometimes it's helpful to gather the field names or other metadata, like 102 | the column type, max length, etc. 103 | 104 | .. note:: Not all databases provide meta-data. 105 | 106 | Usage example:: 107 | 108 | $fields = $this->db->field_data('table_name'); 109 | 110 | foreach ($fields as $field) 111 | { 112 | echo $field->name; 113 | echo $field->type; 114 | echo $field->max_length; 115 | echo $field->primary_key; 116 | } 117 | 118 | If you have run a query already you can use the result object instead of 119 | supplying the table name:: 120 | 121 | $query = $this->db->query("YOUR QUERY"); 122 | $fields = $query->field_data(); 123 | 124 | The following data is available from this function if supported by your 125 | database: 126 | 127 | - name - column name 128 | - max_length - maximum length of the column 129 | - primary_key - 1 if the column is a primary key 130 | - type - the type of the column 131 | -------------------------------------------------------------------------------- /source/database/transactions.rst: -------------------------------------------------------------------------------- 1 | ######### 2 | Transaksi 3 | ######### 4 | 5 | CodeIgniter's database abstraction allows you to use transactions with 6 | databases that support transaction-safe table types. In MySQL, you'll 7 | need to be running InnoDB or BDB table types rather than the more common 8 | MyISAM. Most other database platforms support transactions natively. 9 | 10 | If you are not familiar with transactions we recommend you find a good 11 | online resource to learn about them for your particular database. The 12 | information below assumes you have a basic understanding of 13 | transactions. 14 | 15 | CodeIgniter's Approach to Transactions 16 | ====================================== 17 | 18 | CodeIgniter utilizes an approach to transactions that is very similar to 19 | the process used by the popular database class ADODB. We've chosen that 20 | approach because it greatly simplifies the process of running 21 | transactions. In most cases all that is required are two lines of code. 22 | 23 | Traditionally, transactions have required a fair amount of work to 24 | implement since they demand that you keep track of your queries and 25 | determine whether to commit or rollback based on the success or failure 26 | of your queries. This is particularly cumbersome with nested queries. In 27 | contrast, we've implemented a smart transaction system that does all 28 | this for you automatically (you can also manage your transactions 29 | manually if you choose to, but there's really no benefit). 30 | 31 | Running Transactions 32 | ==================== 33 | 34 | To run your queries using transactions you will use the 35 | $this->db->trans_start() and $this->db->trans_complete() functions as 36 | follows:: 37 | 38 | $this->db->trans_start(); 39 | $this->db->query('AN SQL QUERY...'); 40 | $this->db->query('ANOTHER QUERY...'); 41 | $this->db->query('AND YET ANOTHER QUERY...'); 42 | $this->db->trans_complete(); 43 | 44 | You can run as many queries as you want between the start/complete 45 | functions and they will all be committed or rolled back based on success 46 | or failure of any given query. 47 | 48 | Strict Mode 49 | =========== 50 | 51 | By default CodeIgniter runs all transactions in Strict Mode. When strict 52 | mode is enabled, if you are running multiple groups of transactions, if 53 | one group fails all groups will be rolled back. If strict mode is 54 | disabled, each group is treated independently, meaning a failure of one 55 | group will not affect any others. 56 | 57 | Strict Mode can be disabled as follows:: 58 | 59 | $this->db->trans_strict(FALSE); 60 | 61 | Managing Errors 62 | =============== 63 | 64 | If you have error reporting enabled in your config/database.php file 65 | you'll see a standard error message if the commit was unsuccessful. If 66 | debugging is turned off, you can manage your own errors like this:: 67 | 68 | $this->db->trans_start(); 69 | $this->db->query('AN SQL QUERY...'); 70 | $this->db->query('ANOTHER QUERY...'); 71 | $this->db->trans_complete(); 72 | 73 | if ($this->db->trans_status() === FALSE) 74 | { 75 | // generate an error... or use the log_message() function to log your error 76 | } 77 | 78 | Enabling Transactions 79 | ===================== 80 | 81 | Transactions are enabled automatically the moment you use 82 | $this->db->trans_start(). If you would like to disable transactions you 83 | can do so using $this->db->trans_off():: 84 | 85 | $this->db->trans_off(); 86 | 87 | $this->db->trans_start(); 88 | $this->db->query('AN SQL QUERY...'); 89 | $this->db->trans_complete(); 90 | 91 | When transactions are disabled, your queries will be auto-commited, just 92 | as they are when running queries without transactions. 93 | 94 | Test Mode 95 | ========= 96 | 97 | You can optionally put the transaction system into "test mode", which 98 | will cause your queries to be rolled back -- even if the queries produce 99 | a valid result. To use test mode simply set the first parameter in the 100 | $this->db->trans_start() function to TRUE:: 101 | 102 | $this->db->trans_start(TRUE); // Query will be rolled back 103 | $this->db->query('AN SQL QUERY...'); 104 | $this->db->trans_complete(); 105 | 106 | Running Transactions Manually 107 | ============================= 108 | 109 | If you would like to run transactions manually you can do so as follows:: 110 | 111 | $this->db->trans_begin(); 112 | 113 | $this->db->query('AN SQL QUERY...'); 114 | $this->db->query('ANOTHER QUERY...'); 115 | $this->db->query('AND YET ANOTHER QUERY...'); 116 | 117 | if ($this->db->trans_status() === FALSE) 118 | { 119 | $this->db->trans_rollback(); 120 | } 121 | else 122 | { 123 | $this->db->trans_commit(); 124 | } 125 | 126 | .. note:: Make sure to use $this->db->trans_begin() when running manual 127 | transactions, **NOT** $this->db->trans_start(). 128 | -------------------------------------------------------------------------------- /source/general/alternative_php.rst: -------------------------------------------------------------------------------- 1 | ##################################### 2 | Alternatif Syntax PHP untuk File View 3 | ##################################### 4 | 5 | If you do not utilize CodeIgniter's :doc:`template 6 | engine <../libraries/parser>`, you'll be using pure PHP in your 7 | View files. To minimize the PHP code in these files, and to make it 8 | easier to identify the code blocks it is recommended that you use PHPs 9 | alternative syntax for control structures and short tag echo statements. 10 | If you are not familiar with this syntax, it allows you to eliminate the 11 | braces from your code, and eliminate "echo" statements. 12 | 13 | Automatic Short Tag Support 14 | =========================== 15 | 16 | .. note:: If you find that the syntax described in this page does not 17 | work on your server it might be that "short tags" are disabled in your 18 | PHP ini file. CodeIgniter will optionally rewrite short tags on-the-fly, 19 | allowing you to use that syntax even if your server doesn't support it. 20 | This feature can be enabled in your *config/config.php* file. 21 | 22 | Please note that if you do use this feature, if PHP errors are 23 | encountered in your **view files**, the error message and line number 24 | will not be accurately shown. Instead, all errors will be shown as 25 | ``eval()`` errors. 26 | 27 | Alternative Echos 28 | ================= 29 | 30 | Normally to echo, or print out a variable you would do this:: 31 | 32 | 33 | 34 | With the alternative syntax you can instead do it this way:: 35 | 36 | 37 | 38 | Alternative Control Structures 39 | ============================== 40 | 41 | Controls structures, like if, for, foreach, and while can be written in 42 | a simplified format as well. Here is an example using ``foreach``:: 43 | 44 |
    45 | 46 | 47 | 48 |
  • 49 | 50 | 51 | 52 |
53 | 54 | Notice that there are no braces. Instead, the end brace is replaced with 55 | ``endforeach``. Each of the control structures listed above has a similar 56 | closing syntax: ``endif``, ``endfor``, ``endforeach``, and ``endwhile`` 57 | 58 | Also notice that instead of using a semicolon after each structure 59 | (except the last one), there is a colon. This is important! 60 | 61 | Here is another example, using ``if``/``elseif``/``else``. Notice the colons:: 62 | 63 | 64 | 65 |

Hi Sally

66 | 67 | 68 | 69 |

Hi Joe

70 | 71 | 72 | 73 |

Hi unknown user

74 | 75 | 76 | -------------------------------------------------------------------------------- /source/general/ancillary_classes.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Membuat Class Tambahan 3 | ###################### 4 | 5 | In some cases you may want to develop classes that exist apart from your 6 | controllers but have the ability to utilize all of CodeIgniter's 7 | resources. This is easily possible as you'll see. 8 | 9 | get_instance() 10 | ============== 11 | 12 | .. php:function:: get_instance() 13 | 14 | :returns: Reference to your controller's instance 15 | :rtype: CI_Controller 16 | 17 | **Any class that you instantiate within your controller methods can 18 | access CodeIgniter's native resources** simply by using the 19 | ``get_instance()`` function. This function returns the main 20 | CodeIgniter object. 21 | 22 | Normally, to call any of the available CodeIgniter methods requires 23 | you to use the ``$this`` construct:: 24 | 25 | $this->load->helper('url'); 26 | $this->load->library('session'); 27 | $this->config->item('base_url'); 28 | // etc. 29 | 30 | ``$this``, however, only works within your controllers, your models, 31 | or your views. If you would like to use CodeIgniter's classes from 32 | within your own custom classes you can do so as follows: 33 | 34 | First, assign the CodeIgniter object to a variable:: 35 | 36 | $CI =& get_instance(); 37 | 38 | Once you've assigned the object to a variable, you'll use that variable 39 | *instead* of ``$this``:: 40 | 41 | $CI =& get_instance(); 42 | 43 | $CI->load->helper('url'); 44 | $CI->load->library('session'); 45 | $CI->config->item('base_url'); 46 | // etc. 47 | 48 | If you'll be using ``get_instance()`` inside another class, then it would 49 | be better if you assign it to a property. This way, you won't need to call 50 | ``get_instance()`` in every single method. 51 | 52 | Example:: 53 | 54 | class Example { 55 | 56 | protected $CI; 57 | 58 | // We'll use a constructor, as you can't directly call a function 59 | // from a property definition. 60 | public function __construct() 61 | { 62 | // Assign the CodeIgniter super-object 63 | $this->CI =& get_instance(); 64 | } 65 | 66 | public function foo() 67 | { 68 | $this->CI->load->helper('url'); 69 | redirect(); 70 | } 71 | 72 | public function bar() 73 | { 74 | $this->CI->config->item('base_url'); 75 | } 76 | } 77 | 78 | In the above example, both methods ``foo()`` and ``bar()`` will work 79 | after you instantiate the Example class, without the need to call 80 | ``get_instance()`` in each of them. 81 | -------------------------------------------------------------------------------- /source/general/autoloader.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Auto-loading Resources 3 | ###################### 4 | 5 | CodeIgniter comes with an "Auto-load" feature that permits libraries, 6 | helpers, and models to be initialized automatically every time the 7 | system runs. If you need certain resources globally throughout your 8 | application you should consider auto-loading them for convenience. 9 | 10 | The following items can be loaded automatically: 11 | 12 | - Classes found in the *libraries/* directory 13 | - Helper files found in the *helpers/* directory 14 | - Custom config files found in the *config/* directory 15 | - Language files found in the *system/language/* directory 16 | - Models found in the *models/* folder 17 | 18 | To autoload resources, open the **application/config/autoload.php** 19 | file and add the item you want loaded to the autoload array. You'll 20 | find instructions in that file corresponding to each type of item. 21 | 22 | .. note:: Do not include the file extension (.php) when adding items to 23 | the autoload array. 24 | 25 | Additionally, if you want CodeIgniter to use a `Composer `_ 26 | auto-loader, just set ``$config['composer_autoload']`` to ``TRUE`` or 27 | a custom path in **application/config/config.php**. -------------------------------------------------------------------------------- /source/general/caching.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Web Page Caching 3 | ################ 4 | 5 | CodeIgniter lets you cache your pages in order to achieve maximum 6 | performance. 7 | 8 | Although CodeIgniter is quite fast, the amount of dynamic information 9 | you display in your pages will correlate directly to the server 10 | resources, memory, and processing cycles utilized, which affect your 11 | page load speeds. By caching your pages, since they are saved in their 12 | fully rendered state, you can achieve performance that nears that of 13 | static web pages. 14 | 15 | How Does Caching Work? 16 | ====================== 17 | 18 | Caching can be enabled on a per-page basis, and you can set the length 19 | of time that a page should remain cached before being refreshed. When a 20 | page is loaded for the first time, the cache file will be written to 21 | your application/cache folder. On subsequent page loads the cache file 22 | will be retrieved and sent to the requesting user's browser. If it has 23 | expired, it will be deleted and refreshed before being sent to the 24 | browser. 25 | 26 | .. note: The Benchmark tag is not cached so you can still view your page 27 | load speed when caching is enabled. 28 | 29 | Enabling Caching 30 | ================ 31 | 32 | To enable caching, put the following tag in any of your controller 33 | methods:: 34 | 35 | $this->output->cache($n); 36 | 37 | Where ``$n`` is the number of **minutes** you wish the page to remain 38 | cached between refreshes. 39 | 40 | The above tag can go anywhere within a method. It is not affected by 41 | the order that it appears, so place it wherever it seems most logical to 42 | you. Once the tag is in place, your pages will begin being cached. 43 | 44 | .. important:: Because of the way CodeIgniter stores content for output, 45 | caching will only work if you are generating display for your 46 | controller with a :doc:`view <./views>`. 47 | 48 | .. important:: If you change configuration options that might affect 49 | your output, you have to manually delete your cache files. 50 | 51 | .. note:: Before the cache files can be written you must set the file 52 | permissions on your *application/cache/* directory such that 53 | it is writable. 54 | 55 | Deleting Caches 56 | =============== 57 | 58 | If you no longer wish to cache a file you can remove the caching tag and 59 | it will no longer be refreshed when it expires. 60 | 61 | .. note:: Removing the tag will not delete the cache immediately. It will 62 | have to expire normally. 63 | 64 | If you need to manually delete the cache, you can use the ``delete_cache()`` 65 | method:: 66 | 67 | // Deletes cache for the currently requested URI 68 | $this->output->delete_cache(); 69 | 70 | // Deletes cache for /foo/bar 71 | $this->output->delete_cache('/foo/bar'); -------------------------------------------------------------------------------- /source/general/cli.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Menjalankan dengan CLI 3 | ###################### 4 | 5 | As well as calling an applications :doc:`Controllers <./controllers>` 6 | via the URL in a browser they can also be loaded via the command-line 7 | interface (CLI). 8 | 9 | .. contents:: Page Contents 10 | 11 | What is the CLI? 12 | ================ 13 | 14 | The command-line interface is a text-based method of interacting with 15 | computers. For more information, check the `Wikipedia 16 | article `_. 17 | 18 | Why run via the command-line? 19 | ============================= 20 | 21 | There are many reasons for running CodeIgniter from the command-line, 22 | but they are not always obvious. 23 | 24 | - Run your cron-jobs without needing to use *wget* or *curl* 25 | - Make your cron-jobs inaccessible from being loaded in the URL by 26 | checking the return value of :php:func:`is_cli()`. 27 | - Make interactive "tasks" that can do things like set permissions, 28 | prune cache folders, run backups, etc. 29 | - Integrate with other applications in other languages. For example, a 30 | random C++ script could call one command and run code in your models! 31 | 32 | Let's try it: Hello World! 33 | ========================== 34 | 35 | Let's create a simple controller so you can see it in action. Using your 36 | text editor, create a file called Tools.php, and put the following code 37 | in it:: 38 | 39 | "cmd" 55 | in Windows and navigate to our CodeIgniter project. 56 | 57 | .. code-block:: bash 58 | 59 | $ cd /path/to/project; 60 | $ php index.php tools message 61 | 62 | If you did it right, you should see *Hello World!* printed. 63 | 64 | .. code-block:: bash 65 | 66 | $ php index.php tools message "John Smith" 67 | 68 | Here we are passing it a argument in the same way that URL parameters 69 | work. "John Smith" is passed as a argument and output is:: 70 | 71 | Hello John Smith! 72 | 73 | That's it! 74 | ========== 75 | 76 | That, in a nutshell, is all there is to know about controllers on the 77 | command line. Remember that this is just a normal controller, so routing 78 | and ``_remap()`` works fine. 79 | -------------------------------------------------------------------------------- /source/general/core_classes.rst: -------------------------------------------------------------------------------- 1 | ######################### 2 | Membuat Class Inti Sistem 3 | ######################### 4 | 5 | Every time CodeIgniter runs there are several base classes that are 6 | initialized automatically as part of the core framework. It is possible, 7 | however, to swap any of the core system classes with your own versions 8 | or even extend the core versions. 9 | 10 | **Most users will never have any need to do this, but the option to 11 | replace or extend them does exist for those who would like to 12 | significantly alter the CodeIgniter core.** 13 | 14 | .. note:: Messing with a core system class has a lot of implications, so 15 | make sure you know what you are doing before attempting it. 16 | 17 | System Class List 18 | ================= 19 | 20 | The following is a list of the core system files that are invoked every 21 | time CodeIgniter runs: 22 | 23 | - Benchmark 24 | - Config 25 | - Controller 26 | - Exceptions 27 | - Hooks 28 | - Input 29 | - Language 30 | - Loader 31 | - Log 32 | - Output 33 | - Router 34 | - Security 35 | - URI 36 | - Utf8 37 | 38 | Replacing Core Classes 39 | ====================== 40 | 41 | To use one of your own system classes instead of a default one simply 42 | place your version inside your local *application/core/* directory:: 43 | 44 | application/core/some_class.php 45 | 46 | If this directory does not exist you can create it. 47 | 48 | Any file named identically to one from the list above will be used 49 | instead of the one normally used. 50 | 51 | Please note that your class must use CI as a prefix. For example, if 52 | your file is named Input.php the class will be named:: 53 | 54 | class CI_Input { 55 | 56 | } 57 | 58 | Extending Core Class 59 | ==================== 60 | 61 | If all you need to do is add some functionality to an existing library - 62 | perhaps add a method or two - then it's overkill to replace the entire 63 | library with your version. In this case it's better to simply extend the 64 | class. Extending a class is nearly identical to replacing a class with a 65 | couple exceptions: 66 | 67 | - The class declaration must extend the parent class. 68 | - Your new class name and filename must be prefixed with MY\_ (this 69 | item is configurable. See below.). 70 | 71 | For example, to extend the native Input class you'll create a file named 72 | application/core/MY_Input.php, and declare your class with:: 73 | 74 | class MY_Input extends CI_Input { 75 | 76 | } 77 | 78 | .. note:: If you need to use a constructor in your class make sure you 79 | extend the parent constructor:: 80 | 81 | class MY_Input extends CI_Input { 82 | 83 | public function __construct() 84 | { 85 | parent::__construct(); 86 | } 87 | } 88 | 89 | **Tip:** Any functions in your class that are named identically to the 90 | methods in the parent class will be used instead of the native ones 91 | (this is known as "method overriding"). This allows you to substantially 92 | alter the CodeIgniter core. 93 | 94 | If you are extending the Controller core class, then be sure to extend 95 | your new class in your application controller's constructors. 96 | 97 | :: 98 | 99 | class Welcome extends MY_Controller { 100 | 101 | public function __construct() 102 | { 103 | parent::__construct(); 104 | } 105 | 106 | public function index() 107 | { 108 | $this->load->view('welcome_message'); 109 | } 110 | } 111 | 112 | Setting Your Own Prefix 113 | ----------------------- 114 | 115 | To set your own sub-class prefix, open your 116 | *application/config/config.php* file and look for this item:: 117 | 118 | $config['subclass_prefix'] = 'MY_'; 119 | 120 | Please note that all native CodeIgniter libraries are prefixed 121 | with CI\_ so DO NOT use that as your prefix. 122 | -------------------------------------------------------------------------------- /source/general/creating_drivers.rst: -------------------------------------------------------------------------------- 1 | ############## 2 | Membuat Driver 3 | ############## 4 | 5 | Driver Directory and File Structure 6 | =================================== 7 | 8 | Sample driver directory and file structure layout: 9 | 10 | - /application/libraries/Driver_name 11 | 12 | - Driver_name.php 13 | - drivers 14 | 15 | - Driver_name_subclass_1.php 16 | - Driver_name_subclass_2.php 17 | - Driver_name_subclass_3.php 18 | 19 | .. note:: In order to maintain compatibility on case-sensitive 20 | file systems, the Driver_name directory must be 21 | named in the format returned by ``ucfirst()``. 22 | 23 | .. note:: The Driver library's architecture is such that 24 | the subclasses don't extend and therefore don't inherit 25 | properties or methods of the main driver. 26 | -------------------------------------------------------------------------------- /source/general/credits.rst: -------------------------------------------------------------------------------- 1 | ####### 2 | Credits 3 | ####### 4 | 5 | CodeIgniter was originally developed by `Rick Ellis `_ 6 | (CEO of `EllisLab, Inc. `_). The framework was written for 7 | performance in the real world, with many of the class libraries, helpers, and 8 | sub-systems borrowed from the code-base of `ExpressionEngine 9 | `_. 10 | 11 | It was, for years, developed and maintained by EllisLab, the ExpressionEngine 12 | Development Team and a group of community members called the Reactor Team. 13 | 14 | In 2014, CodeIgniter was acquired by the `British Columbia Institute of Technology 15 | `_ and was then officially announced as a community-maintained 16 | project. 17 | 18 | Bleeding edge development is spearheaded by the handpicked contributors 19 | of the Reactor Team. 20 | 21 | A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and 22 | for bringing frameworks into the general consciousness of the web community. -------------------------------------------------------------------------------- /source/general/drivers.rst: -------------------------------------------------------------------------------- 1 | ######################### 2 | Using CodeIgniter Drivers 3 | ######################### 4 | 5 | Drivers are a special type of Library that has a parent class and any 6 | number of potential child classes. Child classes have access to the 7 | parent class, but not their siblings. Drivers provide an elegant syntax 8 | in your :doc:`controllers ` for libraries that benefit 9 | from or require being broken down into discrete classes. 10 | 11 | Drivers are found in the *system/libraries/* directory, in their own 12 | sub-directory which is identically named to the parent library class. 13 | Also inside that directory is a subdirectory named drivers, which 14 | contains all of the possible child class files. 15 | 16 | To use a driver you will initialize it within a controller using the 17 | following initialization method:: 18 | 19 | $this->load->driver('class_name'); 20 | 21 | Where class name is the name of the driver class you want to invoke. For 22 | example, to load a driver named "Some_parent" you would do this:: 23 | 24 | $this->load->driver('some_parent'); 25 | 26 | Methods of that class can then be invoked with:: 27 | 28 | $this->some_parent->some_method(); 29 | 30 | The child classes, the drivers themselves, can then be called directly 31 | through the parent class, without initializing them:: 32 | 33 | $this->some_parent->child_one->some_method(); 34 | $this->some_parent->child_two->another_method(); 35 | 36 | Creating Your Own Drivers 37 | ========================= 38 | 39 | Please read the section of the user guide that discusses how to :doc:`create 40 | your own drivers `. -------------------------------------------------------------------------------- /source/general/environments.rst: -------------------------------------------------------------------------------- 1 | ############################## 2 | Handling Multiple Environments 3 | ############################## 4 | 5 | Developers often desire different system behavior depending on whether 6 | an application is running in a development or production environment. 7 | For example, verbose error output is something that would be useful 8 | while developing an application, but it may also pose a security issue 9 | when "live". 10 | 11 | The ENVIRONMENT Constant 12 | ======================== 13 | 14 | By default, CodeIgniter comes with the environment constant set to use 15 | the value provided in ``$_SERVER['CI_ENV']``, otherwise defaults to 16 | 'development'. At the top of index.php, you will see:: 17 | 18 | define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); 19 | 20 | This server variable can be set in your .htaccess file, or Apache 21 | config using `SetEnv `_. 22 | Alternative methods are available for nginx and other servers, or you can 23 | remove this logic entirely and set the constant based on the server's IP address. 24 | 25 | In addition to affecting some basic framework behavior (see the next 26 | section), you may use this constant in your own development to 27 | differentiate between which environment you are running in. 28 | 29 | Effects On Default Framework Behavior 30 | ===================================== 31 | 32 | There are some places in the CodeIgniter system where the ENVIRONMENT 33 | constant is used. This section describes how default framework behavior 34 | is affected. 35 | 36 | Error Reporting 37 | --------------- 38 | 39 | Setting the ENVIRONMENT constant to a value of 'development' will cause 40 | all PHP errors to be rendered to the browser when they occur. 41 | Conversely, setting the constant to 'production' will disable all error 42 | output. Disabling error reporting in production is a :doc:`good security 43 | practice `. 44 | 45 | Configuration Files 46 | ------------------- 47 | 48 | Optionally, you can have CodeIgniter load environment-specific 49 | configuration files. This may be useful for managing things like 50 | differing API keys across multiple environments. This is described in 51 | more detail in the environment section of the :doc:`Config Class 52 | <../libraries/config>` documentation. -------------------------------------------------------------------------------- /source/general/errors.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Penanganan Error 3 | ################ 4 | 5 | CodeIgniter lets you build error reporting into your applications using 6 | the functions described below. In addition, it has an error logging 7 | class that permits error and debugging messages to be saved as text 8 | files. 9 | 10 | .. note:: By default, CodeIgniter displays all PHP errors. You might 11 | wish to change this behavior once your development is complete. You'll 12 | find the error_reporting() function located at the top of your main 13 | index.php file. Disabling error reporting will NOT prevent log files 14 | from being written if there are errors. 15 | 16 | Unlike most systems in CodeIgniter, the error functions are simple 17 | procedural interfaces that are available globally throughout the 18 | application. This approach permits error messages to get triggered 19 | without having to worry about class/function scoping. 20 | 21 | CodeIgniter also returns a status code whenever a portion of the core 22 | calls ``exit()``. This exit status code is separate from the HTTP status 23 | code, and serves as a notice to other processes that may be watching of 24 | whether the script completed successfully, or if not, what kind of 25 | problem it encountered that caused it to abort. These values are 26 | defined in *application/config/constants.php*. While exit status codes 27 | are most useful in CLI settings, returning the proper code helps server 28 | software keep track of your scripts and the health of your application. 29 | 30 | The following functions let you generate errors: 31 | 32 | .. php:function:: show_error($message, $status_code, $heading = 'An Error Was Encountered') 33 | 34 | :param mixed $message: Error message 35 | :param int $status_code: HTTP Response status code 36 | :param string $heading: Error page heading 37 | :rtype: void 38 | 39 | This function will display the error message supplied to it using 40 | the error template appropriate to your execution:: 41 | 42 | application/views/errors/html/error_general.php 43 | 44 | or: 45 | 46 | application/views/errors/cli/error_general.php 47 | 48 | The optional parameter ``$status_code`` determines what HTTP status 49 | code should be sent with the error. If ``$status_code`` is less 50 | than 100, the HTTP status code will be set to 500, and the exit 51 | status code will be set to ``$status_code + EXIT__AUTO_MIN``. 52 | If that value is larger than ``EXIT__AUTO_MAX``, or if 53 | ``$status_code`` is 100 or higher, the exit status code will be set 54 | to ``EXIT_ERROR``. 55 | You can check in *application/config/constants.php* for more detail. 56 | 57 | .. php:function:: show_404($page = '', $log_error = TRUE) 58 | 59 | :param string $page: URI string 60 | :param bool $log_error: Whether to log the error 61 | :rtype: void 62 | 63 | This function will display the 404 error message supplied to it 64 | using the error template appropriate to your execution:: 65 | 66 | application/views/errors/html/error_404.php 67 | 68 | or: 69 | 70 | application/views/errors/cli/error_404.php 71 | 72 | The function expects the string passed to it to be the file path to 73 | the page that isn't found. The exit status code will be set to 74 | ``EXIT_UNKNOWN_FILE``. 75 | Note that CodeIgniter automatically shows 404 messages if 76 | controllers are not found. 77 | 78 | CodeIgniter automatically logs any ``show_404()`` calls. Setting the 79 | optional second parameter to FALSE will skip logging. 80 | 81 | .. php:function:: log_message($level, $message, $php_error = FALSE) 82 | 83 | :param string $level: Log level: 'error', 'debug' or 'info' 84 | :param string $message: Message to log 85 | :param bool $php_error: Whether we're logging a native PHP error message 86 | :rtype: void 87 | 88 | This function lets you write messages to your log files. You must 89 | supply one of three "levels" in the first parameter, indicating what 90 | type of message it is (debug, error, info), with the message itself 91 | in the second parameter. 92 | 93 | Example:: 94 | 95 | if ($some_var == '') 96 | { 97 | log_message('error', 'Some variable did not contain a value.'); 98 | } 99 | else 100 | { 101 | log_message('debug', 'Some variable was correctly set'); 102 | } 103 | 104 | log_message('info', 'The purpose of some variable is to provide some value.'); 105 | 106 | There are three message types: 107 | 108 | #. Error Messages. These are actual errors, such as PHP errors or 109 | user errors. 110 | #. Debug Messages. These are messages that assist in debugging. For 111 | example, if a class has been initialized, you could log this as 112 | debugging info. 113 | #. Informational Messages. These are the lowest priority messages, 114 | simply giving information regarding some process. 115 | 116 | .. note:: In order for the log file to actually be written, the 117 | *logs/* directory must be writable. In addition, you must 118 | set the "threshold" for logging in 119 | *application/config/config.php*. You might, for example, 120 | only want error messages to be logged, and not the other 121 | two types. If you set it to zero logging will be disabled. 122 | -------------------------------------------------------------------------------- /source/general/hooks.rst: -------------------------------------------------------------------------------- 1 | #################################### 2 | Hooks - Mengembangkan Inti Framework 3 | #################################### 4 | 5 | CodeIgniter's Hooks feature provides a means to tap into and modify the 6 | inner workings of the framework without hacking the core files. When 7 | CodeIgniter runs it follows a specific execution process, diagramed in 8 | the :doc:`Application Flow <../overview/appflow>` page. There may be 9 | instances, however, where you'd like to cause some action to take place 10 | at a particular stage in the execution process. For example, you might 11 | want to run a script right before your controllers get loaded, or right 12 | after, or you might want to trigger one of your own scripts in some 13 | other location. 14 | 15 | Enabling Hooks 16 | ============== 17 | 18 | The hooks feature can be globally enabled/disabled by setting the 19 | following item in the **application/config/config.php** file:: 20 | 21 | $config['enable_hooks'] = TRUE; 22 | 23 | Defining a Hook 24 | =============== 25 | 26 | Hooks are defined in the **application/config/hooks.php** file. 27 | Each hook is specified as an array with this prototype:: 28 | 29 | $hook['pre_controller'] = array( 30 | 'class' => 'MyClass', 31 | 'function' => 'Myfunction', 32 | 'filename' => 'Myclass.php', 33 | 'filepath' => 'hooks', 34 | 'params' => array('beer', 'wine', 'snacks') 35 | ); 36 | 37 | **Notes:** 38 | 39 | The array index correlates to the name of the particular hook point you 40 | want to use. In the above example the hook point is pre_controller. A 41 | list of hook points is found below. The following items should be 42 | defined in your associative hook array: 43 | 44 | - **class** The name of the class you wish to invoke. If you prefer to 45 | use a procedural function instead of a class, leave this item blank. 46 | - **function** The function (or method) name you wish to call. 47 | - **filename** The file name containing your class/function. 48 | - **filepath** The name of the directory containing your script. 49 | Note: 50 | Your script must be located in a directory INSIDE your *application/* 51 | directory, so the file path is relative to that directory. For example, 52 | if your script is located in *application/hooks/*, you will simply use 53 | 'hooks' as your filepath. If your script is located in 54 | *application/hooks/utilities/* you will use 'hooks/utilities' as your 55 | filepath. No trailing slash. 56 | - **params** Any parameters you wish to pass to your script. This item 57 | is optional. 58 | 59 | If you're running PHP 5.3+, you can also use lambda/anoymous functions 60 | (or closures) as hooks, with a simpler syntax:: 61 | 62 | $hook['post_controller'] = function() 63 | { 64 | /* do something here */ 65 | }; 66 | 67 | Multiple Calls to the Same Hook 68 | =============================== 69 | 70 | If want to use the same hook point with more than one script, simply 71 | make your array declaration multi-dimensional, like this:: 72 | 73 | $hook['pre_controller'][] = array( 74 | 'class' => 'MyClass', 75 | 'function' => 'MyMethod', 76 | 'filename' => 'Myclass.php', 77 | 'filepath' => 'hooks', 78 | 'params' => array('beer', 'wine', 'snacks') 79 | ); 80 | 81 | $hook['pre_controller'][] = array( 82 | 'class' => 'MyOtherClass', 83 | 'function' => 'MyOtherMethod', 84 | 'filename' => 'Myotherclass.php', 85 | 'filepath' => 'hooks', 86 | 'params' => array('red', 'yellow', 'blue') 87 | ); 88 | 89 | Notice the brackets after each array index:: 90 | 91 | $hook['pre_controller'][] 92 | 93 | This permits you to have the same hook point with multiple scripts. The 94 | order you define your array will be the execution order. 95 | 96 | Hook Points 97 | =========== 98 | 99 | The following is a list of available hook points. 100 | 101 | - **pre_system** 102 | Called very early during system execution. Only the benchmark and 103 | hooks class have been loaded at this point. No routing or other 104 | processes have happened. 105 | - **pre_controller** 106 | Called immediately prior to any of your controllers being called. 107 | All base classes, routing, and security checks have been done. 108 | - **post_controller_constructor** 109 | Called immediately after your controller is instantiated, but prior 110 | to any method calls happening. 111 | - **post_controller** 112 | Called immediately after your controller is fully executed. 113 | - **display_override** 114 | Overrides the ``_display()`` method, used to send the finalized page 115 | to the web browser at the end of system execution. This permits you 116 | to use your own display methodology. Note that you will need to 117 | reference the CI superobject with ``$this->CI =& get_instance()`` and 118 | then the finalized data will be available by calling 119 | ``$this->CI->output->get_output()``. 120 | - **cache_override** 121 | Enables you to call your own method instead of the ``_display_cache()`` 122 | method in the :doc:`Output Library <../libraries/output>`. This permits 123 | you to use your own cache display mechanism. 124 | - **post_system** 125 | Called after the final rendered page is sent to the browser, at the 126 | end of system execution after the finalized data is sent to the 127 | browser. 128 | -------------------------------------------------------------------------------- /source/general/index.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Pembahasan Umum 3 | ############### 4 | 5 | .. toctree:: 6 | :titlesonly: 7 | 8 | urls 9 | controllers 10 | reserved_names 11 | views 12 | models 13 | Helpers 14 | libraries 15 | creating_libraries 16 | drivers 17 | creating_drivers 18 | core_classes 19 | ancillary_classes 20 | hooks 21 | autoloader 22 | common_functions 23 | compatibility_functions 24 | routing 25 | errors 26 | Caching 27 | profiling 28 | cli 29 | managing_apps 30 | environments 31 | alternative_php 32 | security 33 | PHP Style Guide 34 | -------------------------------------------------------------------------------- /source/general/libraries.rst: -------------------------------------------------------------------------------- 1 | ############################### 2 | Menggunakan Library CodeIgniter 3 | ############################### 4 | 5 | All of the available libraries are located in your *system/libraries/* 6 | directory. In most cases, to use one of these classes involves initializing 7 | it within a :doc:`controller ` using the following 8 | initialization method:: 9 | 10 | $this->load->library('class_name'); 11 | 12 | Where 'class_name' is the name of the class you want to invoke. For 13 | example, to load the :doc:`Form Validation Library 14 | <../libraries/form_validation>` you would do this:: 15 | 16 | $this->load->library('form_validation'); 17 | 18 | Once initialized you can use it as indicated in the user guide page 19 | corresponding to that class. 20 | 21 | Additionally, multiple libraries can be loaded at the same time by 22 | passing an array of libraries to the load method. 23 | 24 | Example:: 25 | 26 | $this->load->library(array('email', 'table')); 27 | 28 | Creating Your Own Libraries 29 | =========================== 30 | 31 | Please read the section of the user guide that discusses how to 32 | :doc:`create your own libraries `. 33 | -------------------------------------------------------------------------------- /source/general/managing_apps.rst: -------------------------------------------------------------------------------- 1 | ####################### 2 | Mengelola Aplikasi Anda 3 | ####################### 4 | 5 | By default it is assumed that you only intend to use CodeIgniter to 6 | manage one application, which you will build in your *application/* 7 | directory. It is possible, however, to have multiple sets of 8 | applications that share a single CodeIgniter installation, or even to 9 | rename or relocate your application directory. 10 | 11 | Renaming the Application Directory 12 | ================================== 13 | 14 | If you would like to rename your application directory you may do so 15 | as long as you open your main index.php file and set its name using 16 | the ``$application_folder`` variable:: 17 | 18 | $application_folder = 'application'; 19 | 20 | Relocating your Application Directory 21 | ===================================== 22 | 23 | It is possible to move your application directory to a different 24 | location on your server than your web root. To do so open 25 | your main index.php and set a *full server path* in the 26 | ``$application_folder`` variable:: 27 | 28 | $application_folder = '/path/to/your/application'; 29 | 30 | Running Multiple Applications with one CodeIgniter Installation 31 | =============================================================== 32 | 33 | If you would like to share a common CodeIgniter installation to manage 34 | several different applications simply put all of the directories located 35 | inside your application directory into their own sub-directory. 36 | 37 | For example, let's say you want to create two applications, named "foo" 38 | and "bar". You could structure your application directories like this:: 39 | 40 | applications/foo/ 41 | applications/foo/config/ 42 | applications/foo/controllers/ 43 | applications/foo/libraries/ 44 | applications/foo/models/ 45 | applications/foo/views/ 46 | applications/bar/ 47 | applications/bar/config/ 48 | applications/bar/controllers/ 49 | applications/bar/libraries/ 50 | applications/bar/models/ 51 | applications/bar/views/ 52 | 53 | To select a particular application for use requires that you open your 54 | main index.php file and set the ``$application_folder`` variable. For 55 | example, to select the "foo" application for use you would do this:: 56 | 57 | $application_folder = 'applications/foo'; 58 | 59 | .. note:: Each of your applications will need its own index.php file 60 | which calls the desired application. The index.php file can be named 61 | anything you want. -------------------------------------------------------------------------------- /source/general/profiling.rst: -------------------------------------------------------------------------------- 1 | ####################### 2 | Profiling Aplikasi Anda 3 | ####################### 4 | 5 | The Profiler Class will display benchmark results, queries you have run, 6 | and ``$_POST`` data at the bottom of your pages. This information can be 7 | useful during development in order to help with debugging and 8 | optimization. 9 | 10 | Initializing the Class 11 | ====================== 12 | 13 | .. important:: This class does NOT need to be initialized. It is loaded 14 | automatically by the :doc:`Output Library <../libraries/output>` 15 | if profiling is enabled as shown below. 16 | 17 | Enabling the Profiler 18 | ===================== 19 | 20 | To enable the profiler place the following line anywhere within your 21 | :doc:`Controller ` methods:: 22 | 23 | $this->output->enable_profiler(TRUE); 24 | 25 | When enabled a report will be generated and inserted at the bottom of 26 | your pages. 27 | 28 | To disable the profiler you will use:: 29 | 30 | $this->output->enable_profiler(FALSE); 31 | 32 | Setting Benchmark Points 33 | ======================== 34 | 35 | In order for the Profiler to compile and display your benchmark data you 36 | must name your mark points using specific syntax. 37 | 38 | Please read the information on setting Benchmark points in the 39 | :doc:`Benchmark Library <../libraries/benchmark>` page. 40 | 41 | Enabling and Disabling Profiler Sections 42 | ======================================== 43 | 44 | Each section of Profiler data can be enabled or disabled by setting a 45 | corresponding config variable to TRUE or FALSE. This can be done one of 46 | two ways. First, you can set application wide defaults with the 47 | *application/config/profiler.php* config file. 48 | 49 | Example:: 50 | 51 | $config['config'] = FALSE; 52 | $config['queries'] = FALSE; 53 | 54 | In your controllers, you can override the defaults and config file 55 | values by calling the ``set_profiler_sections()`` method of the 56 | :doc:`Output Library <../libraries/output>`:: 57 | 58 | $sections = array( 59 | 'config' => TRUE, 60 | 'queries' => TRUE 61 | ); 62 | 63 | $this->output->set_profiler_sections($sections); 64 | 65 | Available sections and the array key used to access them are described 66 | in the table below. 67 | 68 | ======================= =================================================================== ======== 69 | Key Description Default 70 | ======================= =================================================================== ======== 71 | **benchmarks** Elapsed time of Benchmark points and total execution time TRUE 72 | **config** CodeIgniter Config variables TRUE 73 | **controller_info** The Controller class and method requested TRUE 74 | **get** Any GET data passed in the request TRUE 75 | **http_headers** The HTTP headers for the current request TRUE 76 | **memory_usage** Amount of memory consumed by the current request, in bytes TRUE 77 | **post** Any POST data passed in the request TRUE 78 | **queries** Listing of all database queries executed, including execution time TRUE 79 | **uri_string** The URI of the current request TRUE 80 | **session_data** Data stored in the current session TRUE 81 | **query_toggle_count** The number of queries after which the query block will default to 25 82 | hidden. 83 | ======================= =================================================================== ======== 84 | 85 | .. note:: Disabling the :doc:`save_queries ` setting in 86 | your database configuration will also effectively disable profiling for 87 | database queries and render the 'queries' setting above useless. You can 88 | optionally override this setting with ``$this->db->save_queries = TRUE;``. 89 | Without this setting you won't be able to view the queries or the 90 | `last_query `. -------------------------------------------------------------------------------- /source/general/requirements.rst: -------------------------------------------------------------------------------- 1 | ################### 2 | Kebutuhan Server 3 | ################### 4 | 5 | `PHP `_ version 5.4 or newer is recommended. 6 | 7 | It should work on 5.2.4 as well, but we strongly advise you NOT to run 8 | such old versions of PHP, because of potential security and performance 9 | issues, as well as missing features. 10 | 11 | A database is required for most web application programming. 12 | Currently supported databases are: 13 | 14 | - MySQL (5.1+) via the *mysql* (deprecated), *mysqli* and *pdo* drivers 15 | - Oracle via the *oci8* and *pdo* drivers 16 | - PostgreSQL via the *postgre* and *pdo* drivers 17 | - MS SQL via the *mssql*, *sqlsrv* (version 2005 and above only) and *pdo* drivers 18 | - SQLite via the *sqlite* (version 2), *sqlite3* (version 3) and *pdo* drivers 19 | - CUBRID via the *cubrid* and *pdo* drivers 20 | - Interbase/Firebird via the *ibase* and *pdo* drivers 21 | - ODBC via the *odbc* and *pdo* drivers (you should know that ODBC is actually an abstraction layer) 22 | -------------------------------------------------------------------------------- /source/general/reserved_names.rst: -------------------------------------------------------------------------------- 1 | ############## 2 | Reserved Names 3 | ############## 4 | 5 | In order to help out, CodeIgniter uses a series of function, method, 6 | class and variable names in its operation. Because of this, some names 7 | cannot be used by a developer. Following is a list of reserved names 8 | that cannot be used. 9 | 10 | Controller names 11 | ---------------- 12 | 13 | Since your controller classes will extend the main application 14 | controller you must be careful not to name your methods identically to 15 | the ones used by that class, otherwise your local methods will 16 | override them. The following is a list of reserved names. Do not name 17 | your controller any of these: 18 | 19 | - CI_Controller 20 | - Default 21 | - index 22 | 23 | Functions 24 | --------- 25 | 26 | - :php:func:`is_php()` 27 | - :php:func:`is_really_writable()` 28 | - ``load_class()`` 29 | - ``is_loaded()`` 30 | - ``get_config()`` 31 | - :php:func:`config_item()` 32 | - :php:func:`show_error()` 33 | - :php:func:`show_404()` 34 | - :php:func:`log_message()` 35 | - :php:func:`set_status_header()` 36 | - :php:func:`get_mimes()` 37 | - :php:func:`html_escape()` 38 | - :php:func:`remove_invisible_characters()` 39 | - :php:func:`is_https()` 40 | - :php:func:`function_usable()` 41 | - :php:func:`get_instance()` 42 | - ``_error_handler()`` 43 | - ``_exception_handler()`` 44 | - ``_stringify_attributes()`` 45 | 46 | Variables 47 | --------- 48 | 49 | - ``$config`` 50 | - ``$db`` 51 | - ``$lang`` 52 | 53 | Constants 54 | --------- 55 | 56 | - ENVIRONMENT 57 | - FCPATH 58 | - SELF 59 | - BASEPATH 60 | - APPPATH 61 | - VIEWPATH 62 | - CI_VERSION 63 | - MB_ENABLED 64 | - ICONV_ENABLED 65 | - UTF8_ENABLED 66 | - FILE_READ_MODE 67 | - FILE_WRITE_MODE 68 | - DIR_READ_MODE 69 | - DIR_WRITE_MODE 70 | - FOPEN_READ 71 | - FOPEN_READ_WRITE 72 | - FOPEN_WRITE_CREATE_DESTRUCTIVE 73 | - FOPEN_READ_WRITE_CREATE_DESTRUCTIVE 74 | - FOPEN_WRITE_CREATE 75 | - FOPEN_READ_WRITE_CREATE 76 | - FOPEN_WRITE_CREATE_STRICT 77 | - FOPEN_READ_WRITE_CREATE_STRICT 78 | - SHOW_DEBUG_BACKTRACE 79 | - EXIT_SUCCESS 80 | - EXIT_ERROR 81 | - EXIT_CONFIG 82 | - EXIT_UNKNOWN_FILE 83 | - EXIT_UNKNOWN_CLASS 84 | - EXIT_UNKNOWN_METHOD 85 | - EXIT_USER_INPUT 86 | - EXIT_DATABASE 87 | - EXIT__AUTO_MIN 88 | - EXIT__AUTO_MAX -------------------------------------------------------------------------------- /source/general/urls.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | CodeIgniter URLs 3 | ################ 4 | 5 | By default, URLs in CodeIgniter are designed to be search-engine and 6 | human friendly. Rather than using the standard "query string" approach 7 | to URLs that is synonymous with dynamic systems, CodeIgniter uses a 8 | **segment-based** approach:: 9 | 10 | example.com/news/article/my_article 11 | 12 | .. note:: Query string URLs can be optionally enabled, as described 13 | below. 14 | 15 | URI Segments 16 | ============ 17 | 18 | The segments in the URL, in following with the Model-View-Controller 19 | approach, usually represent:: 20 | 21 | example.com/class/function/ID 22 | 23 | #. The first segment represents the controller **class** that should be 24 | invoked. 25 | #. The second segment represents the class **function**, or method, that 26 | should be called. 27 | #. The third, and any additional segments, represent the ID and any 28 | variables that will be passed to the controller. 29 | 30 | The :doc:`URI Library <../libraries/uri>` and the :doc:`URL Helper 31 | <../helpers/url_helper>` contain functions that make it easy to work 32 | with your URI data. In addition, your URLs can be remapped using the 33 | :doc:`URI Routing ` feature for more flexibility. 34 | 35 | Removing the index.php file 36 | =========================== 37 | 38 | By default, the **index.php** file will be included in your URLs:: 39 | 40 | example.com/index.php/news/article/my_article 41 | 42 | If your Apache server has *mod_rewrite* enabled, you can easily remove this 43 | file by using a .htaccess file with some simple rules. Here is an example 44 | of such a file, using the "negative" method in which everything is redirected 45 | except the specified items: 46 | 47 | :: 48 | 49 | RewriteEngine On 50 | RewriteCond %{REQUEST_FILENAME} !-f 51 | RewriteCond %{REQUEST_FILENAME} !-d 52 | RewriteRule ^(.*)$ index.php/$1 [L] 53 | 54 | In the above example, any HTTP request other than those for existing 55 | directories and existing files is treated as a request for your index.php file. 56 | 57 | .. note:: These specific rules might not work for all server configurations. 58 | 59 | .. note:: Make sure to also exclude from the above rule any assets that you 60 | might need to be accessible from the outside world. 61 | 62 | Adding a URL Suffix 63 | =================== 64 | 65 | In your **config/config.php** file you can specify a suffix that will be 66 | added to all URLs generated by CodeIgniter. For example, if a URL is 67 | this:: 68 | 69 | example.com/index.php/products/view/shoes 70 | 71 | You can optionally add a suffix, like **.html,** making the page appear to 72 | be of a certain type:: 73 | 74 | example.com/index.php/products/view/shoes.html 75 | 76 | Enabling Query Strings 77 | ====================== 78 | 79 | In some cases you might prefer to use query strings URLs:: 80 | 81 | index.php?c=products&m=view&id=345 82 | 83 | CodeIgniter optionally supports this capability, which can be enabled in 84 | your **application/config.php** file. If you open your config file you'll 85 | see these items:: 86 | 87 | $config['enable_query_strings'] = FALSE; 88 | $config['controller_trigger'] = 'c'; 89 | $config['function_trigger'] = 'm'; 90 | 91 | If you change "enable_query_strings" to TRUE this feature will become 92 | active. Your controllers and functions will then be accessible using the 93 | "trigger" words you've set to invoke your controllers and methods:: 94 | 95 | index.php?c=controller&m=method 96 | 97 | .. note:: If you are using query strings you will have to build your own 98 | URLs, rather than utilizing the URL helpers (and other helpers 99 | that generate URLs, like some of the form helpers) as these are 100 | designed to work with segment based URLs. -------------------------------------------------------------------------------- /source/general/welcome.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Selamat datang di CodeIgniter 3 | ############################# 4 | 5 | CodeIgniter adalah sebuah *Application Development Framework* (*toolkit*) 6 | bagi orang-orang yang ingin membangun website menggunakan PHP. 7 | Tujuannya adalah untuk memungkinkan Anda mengembangkan proyek-proyek 8 | lebih cepat daripada Anda menulis kode dari awal, tersedia banyak *libary* untuk 9 | tugas-tugas yang biasa diperlukan, serta antarmuka dan struktur logis yang sederhana untuk mengakses *library* ini. 10 | CodeIgniter memungkinkan Anda fokus pada proyek Anda dengan meminimalkan 11 | jumlah kode yang dibutuhkan untuk tugas yang diberikan. 12 | 13 | ************************** 14 | Untuk siapakah Codeigniter 15 | ************************** 16 | 17 | CodeIgniter tepat untuk Anda jika: 18 | 19 | - Anda ingin *framework* dengan *small footprint* (Ukuran aplikasi yang kecil). 20 | - Anda membutuhkan kinerja yang luar biasa. 21 | - Anda perlu kompatibilitas yang luas untuk hosting standar yang berjalan di berbagai versi PHP dan konfigurasi yang berbeda-beda. 22 | - Anda ingin sebuah *framework* yang hampir tidak membutuhkan konfigurasi. 23 | - Anda ingin sebuah *framework* yang tidak mengharuskan Anda untuk menggunakan *command line* (CLI). 24 | - Anda ingin sebuah *framework* yang tidak mengharuskan Anda untuk mematuhi aturan ketat dalam koding. 25 | - Anda tidak tertarik pada *library* monolitik skala besar seperti PEAR. 26 | - Anda tidak ingin dipaksa untuk belajar bahasa *templating* (meskipun parser template lainnya tersedia jika Anda menginginkannya). 27 | - Anda menghindari kompleksitas, mendukung solusi yang sederhana. 28 | - Anda perlu dokumentasi yang jelas dan menyeluruh. 29 | -------------------------------------------------------------------------------- /source/helpers/array_helper.rst: -------------------------------------------------------------------------------- 1 | ############ 2 | Array Helper 3 | ############ 4 | 5 | The Array Helper file contains functions that assist in working with 6 | arrays. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('array'); 21 | 22 | 23 | Available Functions 24 | =================== 25 | 26 | The following functions are available: 27 | 28 | 29 | .. php:function:: element($item, $array[, $default = NULL]) 30 | 31 | :param string $item: Item to fetch from the array 32 | :param array $array: Input array 33 | :param bool $default: What to return if the array isn't valid 34 | :returns: NULL on failure or the array item. 35 | :rtype: mixed 36 | 37 | Lets you fetch an item from an array. The function tests whether the 38 | array index is set and whether it has a value. If a value exists it is 39 | returned. If a value does not exist it returns NULL, or whatever you've 40 | specified as the default value via the third parameter. 41 | 42 | Example:: 43 | 44 | $array = array( 45 | 'color' => 'red', 46 | 'shape' => 'round', 47 | 'size' => '' 48 | ); 49 | 50 | echo element('color', $array); // returns "red" 51 | echo element('size', $array, 'foobar'); // returns "foobar" 52 | 53 | 54 | .. php:function:: elements($items, $array[, $default = NULL]) 55 | 56 | :param string $item: Item to fetch from the array 57 | :param array $array: Input array 58 | :param bool $default: What to return if the array isn't valid 59 | :returns: NULL on failure or the array item. 60 | :rtype: mixed 61 | 62 | Lets you fetch a number of items from an array. The function tests 63 | whether each of the array indices is set. If an index does not exist it 64 | is set to NULL, or whatever you've specified as the default value via 65 | the third parameter. 66 | 67 | Example:: 68 | 69 | $array = array( 70 | 'color' => 'red', 71 | 'shape' => 'round', 72 | 'radius' => '10', 73 | 'diameter' => '20' 74 | ); 75 | 76 | $my_shape = elements(array('color', 'shape', 'height'), $array); 77 | 78 | The above will return the following array:: 79 | 80 | array( 81 | 'color' => 'red', 82 | 'shape' => 'round', 83 | 'height' => NULL 84 | ); 85 | 86 | You can set the third parameter to any default value you like. 87 | :: 88 | 89 | $my_shape = elements(array('color', 'shape', 'height'), $array, 'foobar'); 90 | 91 | The above will return the following array:: 92 | 93 | array(      94 | 'color' => 'red', 95 | 'shape' => 'round', 96 | 'height' => 'foobar' 97 | ); 98 | 99 | This is useful when sending the ``$_POST`` array to one of your Models. 100 | This prevents users from sending additional POST data to be entered into 101 | your tables. 102 | 103 | :: 104 | 105 | $this->load->model('post_model'); 106 | $this->post_model->update( 107 | elements(array('id', 'title', 'content'), $_POST) 108 | ); 109 | 110 | This ensures that only the id, title and content fields are sent to be 111 | updated. 112 | 113 | 114 | .. php:function:: random_element($array) 115 | 116 | :param array $array: Input array 117 | :returns: A random element from the array 118 | :rtype: mixed 119 | 120 | Takes an array as input and returns a random element from it. 121 | 122 | Usage example:: 123 | 124 | $quotes = array( 125 | "I find that the harder I work, the more luck I seem to have. - Thomas Jefferson", 126 | "Don't stay in bed, unless you can make money in bed. - George Burns", 127 | "We didn't lose the game; we just ran out of time. - Vince Lombardi", 128 | "If everything seems under control, you're not going fast enough. - Mario Andretti", 129 | "Reality is merely an illusion, albeit a very persistent one. - Albert Einstein", 130 | "Chance favors the prepared mind - Louis Pasteur" 131 | ); 132 | 133 | echo random_element($quotes); -------------------------------------------------------------------------------- /source/helpers/cookie_helper.rst: -------------------------------------------------------------------------------- 1 | ############# 2 | Cookie Helper 3 | ############# 4 | 5 | The Cookie Helper file contains functions that assist in working with 6 | cookies. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('cookie'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]]]) 29 | 30 | :param mixed $name: Cookie name *or* associative array of all of the parameters available to this function 31 | :param string $value: Cookie value 32 | :param int $expire: Number of seconds until expiration 33 | :param string $domain: Cookie domain (usually: .yourdomain.com) 34 | :param string $path: Cookie path 35 | :param string $prefix: Cookie name prefix 36 | :param bool $secure: Whether to only send the cookie through HTTPS 37 | :param bool $httponly: Whether to hide the cookie from JavaScript 38 | :rtype: void 39 | 40 | This helper function gives you friendlier syntax to set browser 41 | cookies. Refer to the :doc:`Input Library <../libraries/input>` for 42 | a description of its use, as this function is an alias for 43 | ``CI_Input::set_cookie()``. 44 | 45 | .. php:function:: get_cookie($index[, $xss_clean = NULL]]) 46 | 47 | :param string $index: Cookie name 48 | :param bool $xss_clean: Whether to apply XSS filtering to the returned value 49 | :returns: The cookie value or NULL if not found 50 | :rtype: mixed 51 | 52 | This helper function gives you friendlier syntax to get browser 53 | cookies. Refer to the :doc:`Input Library <../libraries/input>` for 54 | detailed description of its use, as this function acts very 55 | similarly to ``CI_Input::cookie()``, except it will also prepend 56 | the ``$config['cookie_prefix']`` that you might've set in your 57 | *application/config/config.php* file. 58 | 59 | .. php:function:: delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]]]) 60 | 61 | :param string $name: Cookie name 62 | :param string $domain: Cookie domain (usually: .yourdomain.com) 63 | :param string $path: Cookie path 64 | :param string $prefix: Cookie name prefix 65 | :rtype: void 66 | 67 | Lets you delete a cookie. Unless you've set a custom path or other 68 | values, only the name of the cookie is needed. 69 | :: 70 | 71 | delete_cookie('name'); 72 | 73 | This function is otherwise identical to ``set_cookie()``, except that it 74 | does not have the value and expiration parameters. You can submit an 75 | array of values in the first parameter or you can set discrete 76 | parameters. 77 | :: 78 | 79 | delete_cookie($name, $domain, $path, $prefix); 80 | -------------------------------------------------------------------------------- /source/helpers/directory_helper.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Directory Helper 3 | ################ 4 | 5 | The Directory Helper file contains functions that assist in working with 6 | directories. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code: 19 | 20 | :: 21 | 22 | $this->load->helper('directory'); 23 | 24 | Available Functions 25 | =================== 26 | 27 | The following functions are available: 28 | 29 | 30 | .. php:function:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]]) 31 | 32 | :param string $source_dir: Path to the source directory 33 | :param int $directory_depth: Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) 34 | :param bool $hidden: Whether to include hidden directories 35 | :returns: An array of files 36 | :rtype: array 37 | 38 | Examples:: 39 | 40 | $map = directory_map('./mydirectory/'); 41 | 42 | .. note:: Paths are almost always relative to your main index.php file. 43 | 44 | 45 | Sub-folders contained within the directory will be mapped as well. If 46 | you wish to control the recursion depth, you can do so using the second 47 | parameter (integer). A depth of 1 will only map the top level directory:: 48 | 49 | $map = directory_map('./mydirectory/', 1); 50 | 51 | By default, hidden files will not be included in the returned array. To 52 | override this behavior, you may set a third parameter to true (boolean):: 53 | 54 | $map = directory_map('./mydirectory/', FALSE, TRUE); 55 | 56 | Each folder name will be an array index, while its contained files will 57 | be numerically indexed. Here is an example of a typical array:: 58 | 59 | Array ( 60 | [libraries] => Array 61 | ( 62 | [0] => benchmark.html 63 | [1] => config.html 64 | ["database/"] => Array 65 | ( 66 | [0] => query_builder.html 67 | [1] => binds.html 68 | [2] => configuration.html 69 | [3] => connecting.html 70 | [4] => examples.html 71 | [5] => fields.html 72 | [6] => index.html 73 | [7] => queries.html 74 | ) 75 | [2] => email.html 76 | [3] => file_uploading.html 77 | [4] => image_lib.html 78 | [5] => input.html 79 | [6] => language.html 80 | [7] => loader.html 81 | [8] => pagination.html 82 | [9] => uri.html 83 | ) -------------------------------------------------------------------------------- /source/helpers/download_helper.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Download Helper 3 | ############### 4 | 5 | The Download Helper lets you download data to your desktop. 6 | 7 | .. contents:: 8 | :local: 9 | 10 | .. raw:: html 11 | 12 |
13 | 14 | Loading this Helper 15 | =================== 16 | 17 | This helper is loaded using the following code:: 18 | 19 | $this->load->helper('download'); 20 | 21 | Available Functions 22 | =================== 23 | 24 | The following functions are available: 25 | 26 | 27 | .. php:function:: force_download([$filename = ''[, $data = ''[, $set_mime = FALSE]]]) 28 | 29 | :param string $filename: Filename 30 | :param mixed $data: File contents 31 | :param bool $set_mime: Whether to try to send the actual MIME type 32 | :rtype: void 33 | 34 | Generates server headers which force data to be downloaded to your 35 | desktop. Useful with file downloads. The first parameter is the **name 36 | you want the downloaded file to be named**, the second parameter is the 37 | file data. 38 | 39 | If you set the second parameter to NULL and ``$filename`` is an existing, readable 40 | file path, then its content will be read instead. 41 | 42 | If you set the third parameter to boolean TRUE, then the actual file MIME type 43 | (based on the filename extension) will be sent, so that if your browser has a 44 | handler for that type - it can use it. 45 | 46 | Example:: 47 | 48 | $data = 'Here is some text!'; 49 | $name = 'mytext.txt'; 50 | force_download($name, $data); 51 | 52 | If you want to download an existing file from your server you'll need to 53 | do the following:: 54 | 55 | // Contents of photo.jpg will be automatically read 56 | force_download('/path/to/photo.jpg', NULL); -------------------------------------------------------------------------------- /source/helpers/email_helper.rst: -------------------------------------------------------------------------------- 1 | ############ 2 | Email Helper 3 | ############ 4 | 5 | The Email Helper provides some assistive functions for working with 6 | Email. For a more robust email solution, see CodeIgniter's :doc:`Email 7 | Class <../libraries/email>`. 8 | 9 | .. important:: The Email helper is DEPRECATED and is currently 10 | only kept for backwards compatibility. 11 | 12 | .. contents:: 13 | :local: 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | Loading this Helper 20 | =================== 21 | 22 | This helper is loaded using the following code:: 23 | 24 | $this->load->helper('email'); 25 | 26 | Available Functions 27 | =================== 28 | 29 | The following functions are available: 30 | 31 | 32 | .. php:function:: valid_email($email) 33 | 34 | :param string $email: E-mail address 35 | :returns: TRUE if a valid email is supplied, FALSE otherwise 36 | :rtype: bool 37 | 38 | Checks if the input is a correctly formatted e-mail address. Note that is 39 | doesn't actually prove that the address will be able recieve mail, but 40 | simply that it is a validly formed address. 41 | 42 | Example:: 43 | 44 | if (valid_email('email@somesite.com')) 45 | { 46 | echo 'email is valid'; 47 | } 48 | else 49 | { 50 | echo 'email is not valid'; 51 | } 52 | 53 | .. note:: All that this function does is to use PHP's native ``filter_var()``:: 54 | 55 | (bool) filter_var($email, FILTER_VALIDATE_EMAIL); 56 | 57 | .. php:function:: send_email($recipient, $subject, $message) 58 | 59 | :param string $recipient: E-mail address 60 | :param string $subject: Mail subject 61 | :param string $message: Message body 62 | :returns: TRUE if the mail was successfully sent, FALSE in case of an error 63 | :rtype: bool 64 | 65 | Sends an email using PHP's native `mail() `_ 66 | function. 67 | 68 | .. note:: All that this function does is to use PHP's native ``mail`` 69 | 70 | :: 71 | 72 | mail($recipient, $subject, $message); 73 | 74 | For a more robust email solution, see CodeIgniter's :doc:`Email Library 75 | <../libraries/email>`. -------------------------------------------------------------------------------- /source/helpers/index.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Referensi Helper 3 | ################ 4 | 5 | .. toctree:: 6 | :glob: 7 | :titlesonly: 8 | 9 | * 10 | -------------------------------------------------------------------------------- /source/helpers/inflector_helper.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Inflector Helper 3 | ################ 4 | 5 | The Inflector Helper file contains functions that permits you to change 6 | words to plural, singular, camel case, etc. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('inflector'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: singular($str) 29 | 30 | :param string $str: Input string 31 | :returns: A singular word 32 | :rtype: string 33 | 34 | Changes a plural word to singular. Example:: 35 | 36 | echo singular('dogs'); // Prints 'dog' 37 | 38 | .. php:function:: plural($str) 39 | 40 | :param string $str: Input string 41 | :returns: A plular word 42 | :rtype: string 43 | 44 | Changes a singular word to plural. Example:: 45 | 46 | echo plural('dog'); // Prints 'dogs' 47 | 48 | .. php:function:: camelize($str) 49 | 50 | :param string $str: Input string 51 | :returns: Camelized string 52 | :rtype: string 53 | 54 | Changes a string of words separated by spaces or underscores to camel 55 | case. Example:: 56 | 57 | echo camelize('my_dog_spot'); // Prints 'myDogSpot' 58 | 59 | .. php:function:: underscore($str) 60 | 61 | :param string $str: Input string 62 | :returns: String containing underscores instead of spaces 63 | :rtype: string 64 | 65 | Takes multiple words separated by spaces and underscores them. 66 | Example:: 67 | 68 | echo underscore('my dog spot'); // Prints 'my_dog_spot' 69 | 70 | .. php:function:: humanize($str[, $separator = '_']) 71 | 72 | :param string $str: Input string 73 | :param string $separator: Input separator 74 | :returns: Humanized string 75 | :rtype: string 76 | 77 | Takes multiple words separated by underscores and adds spaces between 78 | them. Each word is capitalized. 79 | 80 | Example:: 81 | 82 | echo humanize('my_dog_spot'); // Prints 'My Dog Spot' 83 | 84 | To use dashes instead of underscores:: 85 | 86 | echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot' 87 | 88 | .. php:function:: is_countable($word) 89 | 90 | :param string $word: Input string 91 | :returns: TRUE if the word is countable or FALSE if not 92 | :rtype: bool 93 | 94 | Checks if the given word has a plural version. Example:: 95 | 96 | is_countable('equipment'); // Returns FALSE -------------------------------------------------------------------------------- /source/helpers/language_helper.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Language Helper 3 | ############### 4 | 5 | The Language Helper file contains functions that assist in working with 6 | language files. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('language'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: lang($line[, $for = ''[, $attributes = array()]]) 29 | 30 | :param string $line: Language line key 31 | :param string $for: HTML "for" attribute (ID of the element we're creating a label for) 32 | :param array $attributes: Any additional HTML attributes 33 | :returns: HTML-formatted language line label 34 | :rtype: string 35 | 36 | This function returns a line of text from a loaded language file with 37 | simplified syntax that may be more desirable for view files than 38 | ``CI_Lang::line()``. 39 | 40 | Example:: 41 | 42 | echo lang('language_key', 'form_item_id', array('class' => 'myClass')); 43 | // Outputs: -------------------------------------------------------------------------------- /source/helpers/number_helper.rst: -------------------------------------------------------------------------------- 1 | ############# 2 | Number Helper 3 | ############# 4 | 5 | The Number Helper file contains functions that help you work with 6 | numeric data. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('number'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: byte_format($num[, $precision = 1]) 29 | 30 | :param mixed $num: Number of bytes 31 | :param int $precision: Floating point precision 32 | :returns: Formatted data size string 33 | :rtype: string 34 | 35 | Formats numbers as bytes, based on size, and adds the appropriate 36 | suffix. Examples:: 37 | 38 | echo byte_format(456); // Returns 456 Bytes 39 | echo byte_format(4567); // Returns 4.5 KB 40 | echo byte_format(45678); // Returns 44.6 KB 41 | echo byte_format(456789); // Returns 447.8 KB 42 | echo byte_format(3456789); // Returns 3.3 MB 43 | echo byte_format(12345678912345); // Returns 1.8 GB 44 | echo byte_format(123456789123456789); // Returns 11,228.3 TB 45 | 46 | An optional second parameter allows you to set the precision of the 47 | result:: 48 | 49 | echo byte_format(45678, 2); // Returns 44.61 KB 50 | 51 | .. note:: The text generated by this function is found in the following 52 | language file: *language//number_lang.php* -------------------------------------------------------------------------------- /source/helpers/path_helper.rst: -------------------------------------------------------------------------------- 1 | ########### 2 | Path Helper 3 | ########### 4 | 5 | The Path Helper file contains functions that permits you to work with 6 | file paths on the server. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('path'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: set_realpath($path[, $check_existance = FALSE]) 29 | 30 | :param string $path: Path 31 | :param bool $check_existance: Whether to check if the path actually exists 32 | :returns: An absolute path 33 | :rtype: string 34 | 35 | This function will return a server path without symbolic links or 36 | relative directory structures. An optional second argument will 37 | cause an error to be triggered if the path cannot be resolved. 38 | 39 | Examples:: 40 | 41 | $file = '/etc/php5/apache2/php.ini'; 42 | echo set_realpath($file); // Prints '/etc/php5/apache2/php.ini' 43 | 44 | $non_existent_file = '/path/to/non-exist-file.txt'; 45 | echo set_realpath($non_existent_file, TRUE); // Shows an error, as the path cannot be resolved 46 | echo set_realpath($non_existent_file, FALSE); // Prints '/path/to/non-exist-file.txt' 47 | 48 | $directory = '/etc/php5'; 49 | echo set_realpath($directory); // Prints '/etc/php5/' 50 | 51 | $non_existent_directory = '/path/to/nowhere'; 52 | echo set_realpath($non_existent_directory, TRUE); // Shows an error, as the path cannot be resolved 53 | echo set_realpath($non_existent_directory, FALSE); // Prints '/path/to/nowhere' -------------------------------------------------------------------------------- /source/helpers/security_helper.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Security Helper 3 | ############### 4 | 5 | The Security Helper file contains security related functions. 6 | 7 | .. contents:: 8 | :local: 9 | 10 | .. raw:: html 11 | 12 |
13 | 14 | Loading this Helper 15 | =================== 16 | 17 | This helper is loaded using the following code:: 18 | 19 | $this->load->helper('security'); 20 | 21 | Available Functions 22 | =================== 23 | 24 | The following functions are available: 25 | 26 | 27 | .. php:function:: xss_clean($str[, $is_image = FALSE]) 28 | 29 | :param string $str: Input data 30 | :param bool $is_image: Whether we're dealing with an image 31 | :returns: XSS-clean string 32 | :rtype: string 33 | 34 | Provides Cross Site Script Hack filtering. 35 | 36 | This function is an alias for ``CI_Input::xss_clean()``. For more info, 37 | please see the :doc:`Input Library <../libraries/input>` documentation. 38 | 39 | .. php:function:: sanitize_filename($filename) 40 | 41 | :param string $filename: Filename 42 | :returns: Sanitized file name 43 | :rtype: string 44 | 45 | Provides protection against directory traversal. 46 | 47 | This function is an alias for ``CI_Security::sanitize_filename()``. 48 | For more info, please see the :doc:`Security Library <../libraries/security>` 49 | documentation. 50 | 51 | 52 | .. php:function:: do_hash($str[, $type = 'sha1']) 53 | 54 | :param string $str: Input 55 | :param string $type: Algorithm 56 | :returns: Hex-formatted hash 57 | :rtype: string 58 | 59 | Permits you to create one way hashes suitable for encrypting 60 | passwords. Will use SHA1 by default. 61 | 62 | See `hash_algos() `_ 63 | for a full list of supported algorithms. 64 | 65 | Examples:: 66 | 67 | $str = do_hash($str); // SHA1 68 | $str = do_hash($str, 'md5'); // MD5 69 | 70 | .. note:: This function was formerly named ``dohash()``, which has been 71 | removed in favor of ``do_hash()``. 72 | 73 | .. note:: This function is DEPRECATED. Use the native ``hash()`` instead. 74 | 75 | 76 | .. php:function:: strip_image_tags($str) 77 | 78 | :param string $str: Input string 79 | :returns: The input string with no image tags 80 | :rtype: string 81 | 82 | This is a security function that will strip image tags from a string. 83 | It leaves the image URL as plain text. 84 | 85 | Example:: 86 | 87 | $string = strip_image_tags($string); 88 | 89 | This function is an alias for ``CI_Security::strip_image_tags()``. For 90 | more info, please see the :doc:`Security Library <../libraries/security>` 91 | documentation. 92 | 93 | 94 | .. php:function:: encode_php_tags($str) 95 | 96 | :param string $str: Input string 97 | :returns: Safely formatted string 98 | :rtype: string 99 | 100 | This is a security function that converts PHP tags to entities. 101 | 102 | .. note:: :php:func:`xss_clean()` does this automatically, if you use it. 103 | 104 | Example:: 105 | 106 | $string = encode_php_tags($string); -------------------------------------------------------------------------------- /source/helpers/typography_helper.rst: -------------------------------------------------------------------------------- 1 | ################# 2 | Typography Helper 3 | ################# 4 | 5 | The Typography Helper file contains functions that help your format text 6 | in semantically relevant ways. 7 | 8 | .. contents:: 9 | :local: 10 | 11 | .. raw:: html 12 | 13 |
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code:: 19 | 20 | $this->load->helper('typography'); 21 | 22 | Available Functions 23 | =================== 24 | 25 | The following functions are available: 26 | 27 | 28 | .. php:function:: auto_typography($str[, $reduce_linebreaks = FALSE]) 29 | 30 | :param string $str: Input string 31 | :param bool $reduce_linebreaks: Whether to reduce multiple instances of double newlines to two 32 | :returns: HTML-formatted typography-safe string 33 | :rtype: string 34 | 35 | Formats text so that it is semantically and typographically correct 36 | HTML. 37 | 38 | This function is an alias for ``CI_Typography::auto_typography``. 39 | For more info, please see the :doc:`Typography Library 40 | <../libraries/typography>` documentation. 41 | 42 | Usage example:: 43 | 44 | $string = auto_typography($string); 45 | 46 | .. note:: Typographic formatting can be processor intensive, particularly if 47 | you have a lot of content being formatted. If you choose to use this 48 | function you may want to consider `caching <../general/caching>` your 49 | pages. 50 | 51 | 52 | .. php:function:: nl2br_except_pre($str) 53 | 54 | :param string $str: Input string 55 | :returns: String with HTML-formatted line breaks 56 | :rtype: string 57 | 58 | Converts newlines to
tags unless they appear within
 tags.
59 | 	This function is identical to the native PHP ``nl2br()`` function,
60 | 	except that it ignores 
 tags.
61 | 
62 | 	Usage example::
63 | 
64 | 		$string = nl2br_except_pre($string);
65 | 
66 | .. php:function:: entity_decode($str, $charset = NULL)
67 | 
68 | 	:param	string	$str: Input string
69 | 	:param	string	$charset: Character set
70 | 	:returns:	String with decoded HTML entities
71 | 	:rtype:	string
72 | 
73 | 	This function is an alias for ``CI_Security::entity_decode()``.
74 | 	Fore more info, please see the :doc:`Security Library
75 | 	<../libraries/security>` documentation.


--------------------------------------------------------------------------------
/source/helpers/xml_helper.rst:
--------------------------------------------------------------------------------
 1 | ##########
 2 | XML Helper
 3 | ##########
 4 | 
 5 | The XML Helper file contains functions that assist in working with XML
 6 | data.
 7 | 
 8 | .. contents::
 9 |   :local:
10 | 
11 | .. raw:: html
12 | 
13 |   
14 | 15 | Loading this Helper 16 | =================== 17 | 18 | This helper is loaded using the following code 19 | 20 | :: 21 | 22 | $this->load->helper('xml'); 23 | 24 | Available Functions 25 | =================== 26 | 27 | The following functions are available: 28 | 29 | .. php:function:: xml_convert($str[, $protect_all = FALSE]) 30 | 31 | :param string $str: the text string to convert 32 | :param bool $protect_all: Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo; 33 | :returns: XML-converted string 34 | :rtype: string 35 | 36 | Takes a string as input and converts the following reserved XML 37 | characters to entities: 38 | 39 | - Ampersands: & 40 | - Less than and greater than characters: < > 41 | - Single and double quotes: ' " 42 | - Dashes: - 43 | 44 | This function ignores ampersands if they are part of existing numbered 45 | character entities, e.g. {. Example:: 46 | 47 | $string = '

Here is a paragraph & an entity ({).

'; 48 | $string = xml_convert($string); 49 | echo $string; 50 | 51 | outputs: 52 | 53 | .. code-block:: html 54 | 55 | <p>Here is a paragraph & an entity ({).</p> -------------------------------------------------------------------------------- /source/images/appflowchart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/appflowchart.gif -------------------------------------------------------------------------------- /source/images/arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/arrow.gif -------------------------------------------------------------------------------- /source/images/ci-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/ci-icon.ico -------------------------------------------------------------------------------- /source/images/ci_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/ci_logo.jpg -------------------------------------------------------------------------------- /source/images/ci_logo_flame.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/ci_logo_flame.jpg -------------------------------------------------------------------------------- /source/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/file.gif -------------------------------------------------------------------------------- /source/images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/folder.gif -------------------------------------------------------------------------------- /source/images/smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter-id/user-guide/73221b2966198dad79f4e9a2e1ae557fd7c492b4/source/images/smile.gif -------------------------------------------------------------------------------- /source/index.rst: -------------------------------------------------------------------------------- 1 | ###################################### 2 | Panduan Pengguna CodeIgniter Indonesia 3 | ###################################### 4 | 5 | - :doc:`License Agreement ` 6 | - :doc:`Change Log ` 7 | 8 | .. contents:: 9 | :local: 10 | :depth: 2 11 | 12 | ************** 13 | Selamat Datang 14 | ************** 15 | 16 | .. toctree:: 17 | :titlesonly: 18 | 19 | general/welcome 20 | 21 | ********** 22 | Info Dasar 23 | ********** 24 | 25 | - :doc:`general/requirements` 26 | - :doc:`general/credits` 27 | 28 | ***************** 29 | Panduan Instalasi 30 | ***************** 31 | .. toctree:: 32 | :includehidden: 33 | :maxdepth: 2 34 | :titlesonly: 35 | 36 | installation/index 37 | 38 | ********** 39 | Pengenalan 40 | ********** 41 | 42 | .. toctree:: 43 | :titlesonly: 44 | 45 | overview/index 46 | 47 | ******** 48 | Tutorial 49 | ******** 50 | 51 | .. toctree:: 52 | :includehidden: 53 | :titlesonly: 54 | 55 | tutorial/index 56 | 57 | **************************** 58 | Berkontribusi ke CodeIgniter 59 | **************************** 60 | 61 | .. toctree:: 62 | :glob: 63 | :titlesonly: 64 | 65 | contributing/index 66 | 67 | *************** 68 | Pembahasan Umum 69 | *************** 70 | 71 | .. toctree:: 72 | :glob: 73 | :titlesonly: 74 | 75 | general/index 76 | 77 | ***************** 78 | Referensi Library 79 | ***************** 80 | 81 | .. toctree:: 82 | :glob: 83 | :titlesonly: 84 | 85 | libraries/index 86 | 87 | ****************** 88 | Referensi Database 89 | ****************** 90 | 91 | .. toctree:: 92 | :glob: 93 | :titlesonly: 94 | 95 | database/index 96 | 97 | **************** 98 | Referensi Helper 99 | **************** 100 | 101 | .. toctree:: 102 | :glob: 103 | :titlesonly: 104 | 105 | helpers/index 106 | 107 | .. toctree:: 108 | :glob: 109 | :titlesonly: 110 | :hidden: 111 | 112 | * 113 | overview/index 114 | general/requirements 115 | general/welcome 116 | installation/index 117 | general/index 118 | libraries/index 119 | helpers/index 120 | database/index 121 | tutorial/index 122 | general/credits 123 | -------------------------------------------------------------------------------- /source/installation/downloads.rst: -------------------------------------------------------------------------------- 1 | ####################### 2 | Downloading CodeIgniter 3 | ####################### 4 | 5 | - `CodeIgniter v3.0.3-dev (Current version) `_ 6 | - `CodeIgniter v3.0.2 `_ 7 | - `CodeIgniter v3.0.1 `_ 8 | - `CodeIgniter v3.0.0 `_ 9 | - `CodeIgniter v2.2.5 `_ 10 | - `CodeIgniter v2.2.4 `_ 11 | - `CodeIgniter v2.2.3 `_ 12 | - `CodeIgniter v2.2.2 `_ 13 | - `CodeIgniter v2.2.1 `_ 14 | - `CodeIgniter v2.2.0 `_ 15 | - `CodeIgniter v2.1.4 `_ 16 | - `CodeIgniter v2.1.3 `_ 17 | - `CodeIgniter v2.1.2 `_ 18 | - `CodeIgniter v2.1.1 `_ 19 | - `CodeIgniter v2.1.0 `_ 20 | 21 | ****** 22 | GitHub 23 | ****** 24 | `Git `_ adalah sebuah *version control system* (VCS) yang didistribusikan. 25 | 26 | Akses publik Git tersedia di `GitHub `_. 27 | Harap dicatat bahwa setiap usaha dilakukan untuk menjaga basis kode ini 28 | fungsional, kami tidak dapat menjamin fungsionalitas kode yang diambil dari *branch* yang sedang dikembangkan. 29 | 30 | Dimulai dengan versi 2.0.3, versi stabil juga tersedia di `GitHub Pers `_. 31 | -------------------------------------------------------------------------------- /source/installation/index.rst: -------------------------------------------------------------------------------- 1 | ################# 2 | Panduan Instalasi 3 | ################# 4 | 5 | CodeIgniter diinstal dalam empat langkah: 6 | 7 | #. Unzip paket. 8 | #. Upload folder CodeIgniter dan file ke server Anda. Biasanya file ``index.php`` berada di *root folder* Anda. 9 | #. Buka ``application/config/config.php`` dengan teks editor dan atur URL dasar Anda. Jika Anda berniat untuk menggunakan *encryption* atau *session*, atur *encryption key* Anda. 10 | #. Jika Anda berniat untuk menggunakan database, buka file ``application/config/database.php`` dengan teks editor dan atur konfigurasi database Anda. 11 | 12 | Jika Anda ingin meningkatkan keamanan aplikasi Anda dengan menyembunyikan lokasi 13 | file CodeIgniter Anda, Anda dapat mengubah nama sistem dan folder aplikasi menjadi 14 | sesuatu yang lebih pribadi. Jika Anda ingin mengubah namanya, Anda harus membuka 15 | file index.php di *root folder* dan mengatur variabel ``$system_path`` dan variabel ``$application_folder`` 16 | dengan nama baru yang Anda sukai. 17 | 18 | Untuk keamanan yang terbaik, baik sistem dan folder aplikasi 19 | harus ditempatkan di atas *web root* sehingga mereka tidak langsung dapat diakses 20 | melalui browser. Secara default, file .htaccess telah disertakan dalam setiap folder 21 | untuk membantu mencegah akses langsung, tapi yang terbaik adalah dengan menghapus mereka dari akses publik 22 | sepenuhnya dalam hal perubahan konfigurasi web server atau tidak mematuhi .htaccess. 23 | 24 | Jika Anda ingin *views* Anda dapat diakses secara publik, Anda dapat memindahkan folder *views* dari folder aplikasi Anda. 25 | 26 | Setelah memindah folder *views* Anda, buka file ``index.php`` utama Anda dan atur 27 | variable ``$system_path``, ``$application_folder`` dan ``$view_folder``, 28 | sebaiknya dengan path lengkap, misalnya ``'/www/MyUser/system'``. 29 | 30 | Satu tambahan untuk lingkungan produksi adalah dengan menonaktifkan 31 | *PHP error reporting* dan setiap fungsi *development-only* lainnya. Di 32 | CodeIgniter, ini dapat dilakukan dengan menetapkan konstan ``ENVIRONMENT``, yang 33 | lebih lengkap dijelaskan di :doc:`halaman Keamanan <../general/security>`. 34 | 35 | That's it! 36 | 37 | Jika Anda baru untuk CodeIgniter, silakan baca bagian :doc:`Memulai dengan Codeigniter <../overview/getting_started>` 38 | dari Panduan Pengguna untuk mulai belajar bagaimana membangun aplikasi PHP yang dinamis. Selamat menikmati! 39 | 40 | .. toctree:: 41 | :hidden: 42 | :titlesonly: 43 | 44 | downloads 45 | self 46 | upgrading 47 | troubleshooting 48 | 49 | -------------------------------------------------------------------------------- /source/installation/troubleshooting.rst: -------------------------------------------------------------------------------- 1 | #################### 2 | Penyelesaian Masalah 3 | #################### 4 | 5 | Jika Anda menemukan bahwa tidak peduli apa yang Anda masukkan ke dalam URL Anda hanya 6 | default halaman Anda yang sedang di *load*, mungkin server Anda tidak mendukung 7 | variabel REQUEST_URI yang dibutuhkan untuk melayani URL *search-engine friendly*. Sebagai 8 | langkah pertama, buka file ``application/config/config.php`` Anda dan cari 9 | informasi *URI Protocol*. Ini akan menyarankan Anda mencoba beberapa 10 | pengaturan alternatif. Jika masih tidak bekerja setelah Anda sudah mencoba ini, 11 | Anda harus memaksa CodeIgniter untuk menambahkan tanda tanya ke URL Anda. Untuk 12 | melakukan hal ini, buka file **application/config/config.php** Anda dan ubah bagian ini:: 13 | 14 | $config['index_page'] = "index.php"; 15 | 16 | Menjadi ini:: 17 | 18 | $config['index_page'] = "index.php?"; 19 | -------------------------------------------------------------------------------- /source/installation/upgrade_120.rst: -------------------------------------------------------------------------------- 1 | #################################### 2 | Upgrade Dari Beta 1.0 ke Final 1.2 3 | #################################### 4 | 5 | To upgrade to Version 1.2 please replace the following directories with 6 | the new versions: 7 | 8 | .. note:: If you have any custom developed files in these folders please 9 | make copies of them first. 10 | 11 | - drivers 12 | - helpers 13 | - init 14 | - language 15 | - libraries 16 | - plugins 17 | - scaffolding 18 | 19 | Please also replace your local copy of the user guide with the new 20 | version. 21 | -------------------------------------------------------------------------------- /source/installation/upgrade_130.rst: -------------------------------------------------------------------------------- 1 | ######################### 2 | Upgrading from 1.2 to 1.3 3 | ######################### 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.2. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - application/**models**/ (new for 1.3) 21 | - codeigniter (new for 1.3) 22 | - drivers 23 | - helpers 24 | - init 25 | - language 26 | - libraries 27 | - plugins 28 | - scaffolding 29 | 30 | Step 2: Update your error files 31 | =============================== 32 | 33 | Version 1.3 contains two new error templates located in 34 | application/errors, and for naming consistency the other error templates 35 | have been renamed. 36 | 37 | If you **have not** customized any of the error templates simply replace 38 | this folder: 39 | 40 | - application/errors/ 41 | 42 | If you **have** customized your error templates, rename them as follows: 43 | 44 | - 404.php = error_404.php 45 | - error.php = error_general.php 46 | - error_db.php (new) 47 | - error_php.php (new) 48 | 49 | Step 3: Update your index.php file 50 | ================================== 51 | 52 | Please open your main index.php file (located at your root). At the very 53 | bottom of the file, change this:: 54 | 55 | require_once BASEPATH.'libraries/Front_controller'.EXT; 56 | 57 | To this:: 58 | 59 | require_once BASEPATH.'codeigniter/CodeIgniter'.EXT; 60 | 61 | Step 4: Update your config.php file 62 | =================================== 63 | 64 | Open your application/config/config.php file and add these new items:: 65 | 66 | 67 | /* 68 | |------------------------------------------------ 69 | | URL suffix 70 | |------------------------------------------------ 71 | | 72 | | This option allows you to add a suffix to all URLs. 73 | | For example, if a URL is this: 74 | | 75 | | example.com/index.php/products/view/shoes 76 | | 77 | | You can optionally add a suffix, like ".html", 78 | | making the page appear to be of a certain type: 79 | | 80 | | example.com/index.php/products/view/shoes.html 81 | | 82 | */ 83 | $config['url_suffix'] = ""; 84 | 85 | 86 | /* 87 | |------------------------------------------------ 88 | | Enable Query Strings 89 | |------------------------------------------------ 90 | | 91 | | By default CodeIgniter uses search-engine and 92 | | human-friendly segment based URLs: 93 | | 94 | | example.com/who/what/where/ 95 | | 96 | | You can optionally enable standard query string 97 | | based URLs: 98 | | 99 | | example.com?who=me&what=something&where=here 100 | | 101 | | Options are: TRUE or FALSE (boolean) 102 | | 103 | | The two other items let you set the query string "words" 104 | | that will invoke your controllers and functions: 105 | | example.com/index.php?c=controller&m=function 106 | | 107 | */ 108 | $config['enable_query_strings'] = FALSE; 109 | $config['controller_trigger'] = 'c'; 110 | $config['function_trigger'] = 'm'; 111 | 112 | Step 5: Update your database.php file 113 | ===================================== 114 | 115 | Open your application/config/database.php file and add these new items:: 116 | 117 | 118 | $db['default']['dbprefix'] = ""; 119 | $db['default']['active_r'] = TRUE; 120 | 121 | Step 6: Update your user guide 122 | ============================== 123 | 124 | Please also replace your local copy of the user guide with the new 125 | version. 126 | -------------------------------------------------------------------------------- /source/installation/upgrade_131.rst: -------------------------------------------------------------------------------- 1 | ########################### 2 | Upgrading from 1.3 to 1.3.1 3 | ########################### 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - drivers 21 | - init/init_unit_test.php (new for 1.3.1) 22 | - language/ 23 | - libraries 24 | - scaffolding 25 | 26 | Step 2: Update your user guide 27 | ============================== 28 | 29 | Please also replace your local copy of the user guide with the new 30 | version. 31 | -------------------------------------------------------------------------------- /source/installation/upgrade_132.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.3.1 to 1.3.2 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3.1. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - drivers 21 | - init 22 | - libraries 23 | 24 | Step 2: Update your user guide 25 | ============================== 26 | 27 | Please also replace your local copy of the user guide with the new 28 | version. 29 | -------------------------------------------------------------------------------- /source/installation/upgrade_133.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.3.2 to 1.3.3 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3.2. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - codeigniter 21 | - drivers 22 | - helpers 23 | - init 24 | - libraries 25 | 26 | Step 2: Update your Models 27 | ========================== 28 | 29 | If you are **NOT** using CodeIgniter's 30 | :doc:`Models <../general/models>` feature disregard this step. 31 | 32 | As of version 1.3.3, CodeIgniter does **not** connect automatically to 33 | your database when a model is loaded. This allows you greater 34 | flexibility in determining which databases you would like used with your 35 | models. If your application is not connecting to your database prior to 36 | a model being loaded you will have to update your code. There are 37 | several options for connecting, :doc:`as described 38 | here <../general/models>`. 39 | 40 | Step 3: Update your user guide 41 | ============================== 42 | 43 | Please also replace your local copy of the user guide with the new 44 | version. 45 | -------------------------------------------------------------------------------- /source/installation/upgrade_140.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.3.3 to 1.4.0 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.3.3. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - application/config/**hooks.php** 21 | - application/config/**mimes.php** 22 | - codeigniter 23 | - drivers 24 | - helpers 25 | - init 26 | - language 27 | - libraries 28 | - scaffolding 29 | 30 | Step 2: Update your config.php file 31 | =================================== 32 | 33 | Open your application/config/config.php file and add these new items:: 34 | 35 | 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Enable/Disable System Hooks 40 | |-------------------------------------------------------------------------- 41 | | 42 | | If you would like to use the "hooks" feature you must enable it by 43 | | setting this variable to TRUE (boolean). See the user guide for details. 44 | | 45 | */ 46 | $config['enable_hooks'] = FALSE; 47 | 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Allowed URL Characters 52 | |-------------------------------------------------------------------------- 53 | | 54 | | This lets you specify which characters are permitted within your URLs. 55 | | When someone tries to submit a URL with disallowed characters they will 56 | | get a warning message. 57 | | 58 | | As a security measure you are STRONGLY encouraged to restrict URLs to 59 | | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- 60 | | 61 | | Leave blank to allow all characters -- but only if you are insane. 62 | | 63 | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! 64 | | 65 | */ 66 | $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; 67 | 68 | Step 3: Update your user guide 69 | ============================== 70 | 71 | Please also replace your local copy of the user guide with the new 72 | version. 73 | -------------------------------------------------------------------------------- /source/installation/upgrade_141.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.4.0 to 1.4.1 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.4.0. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace the following directories in your "system" folder with the new 15 | versions: 16 | 17 | .. note:: If you have any custom developed files in these folders please 18 | make copies of them first. 19 | 20 | - codeigniter 21 | - drivers 22 | - helpers 23 | - libraries 24 | 25 | Step 2: Update your config.php file 26 | =================================== 27 | 28 | Open your application/config/config.php file and add this new item:: 29 | 30 | 31 | 32 | /* 33 | |-------------------------------------------------------------------------- 34 | | Output Compression 35 | |-------------------------------------------------------------------------- 36 | | 37 | | Enables Gzip output compression for faster page loads. When enabled, 38 | | the output class will test whether your server supports Gzip. 39 | | Even if it does, however, not all browsers support compression 40 | | so enable only if you are reasonably sure your visitors can handle it. 41 | | 42 | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it 43 | | means you are prematurely outputting something to your browser. It could 44 | | even be a line of whitespace at the end of one of your scripts. For 45 | | compression to work, nothing can be sent before the output buffer is called 46 | | by the output class. Do not "echo" any values with compression enabled. 47 | | 48 | */ 49 | $config['compress_output'] = FALSE; 50 | 51 | Step 3: Rename an Autoload Item 52 | =============================== 53 | 54 | Open the following file: application/config/autoload.php 55 | 56 | Find this array item:: 57 | 58 | $autoload['core'] = array(); 59 | 60 | And rename it to this:: 61 | 62 | $autoload['libraries'] = array(); 63 | 64 | This change was made to improve clarity since some users were not sure 65 | that their own libraries could be auto-loaded. 66 | 67 | Step 4: Update your user guide 68 | ============================== 69 | 70 | Please also replace your local copy of the user guide with the new 71 | version. 72 | -------------------------------------------------------------------------------- /source/installation/upgrade_150.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.4.1 to 1.5.0 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.4.1. If you have not upgraded to that version please do so first. 7 | 8 | Before performing an update you should take your site offline by 9 | replacing the index.php file with a static one. 10 | 11 | Step 1: Update your CodeIgniter files 12 | ===================================== 13 | 14 | Replace these files and directories in your "system" folder with the new 15 | versions: 16 | 17 | - application/config/user_agents.php (new file for 1.5) 18 | - application/config/smileys.php (new file for 1.5) 19 | - codeigniter/ 20 | - database/ (new folder for 1.5. Replaces the "drivers" folder) 21 | - helpers/ 22 | - language/ 23 | - libraries/ 24 | - scaffolding/ 25 | 26 | .. note:: If you have any custom developed files in these folders please 27 | make copies of them first. 28 | 29 | Step 2: Update your database.php file 30 | ===================================== 31 | 32 | Open your application/config/database.php file and add these new items:: 33 | 34 | 35 | $db['default']['cache_on'] = FALSE; 36 | $db['default']['cachedir'] = ''; 37 | 38 | Step 3: Update your config.php file 39 | =================================== 40 | 41 | Open your application/config/config.php file and ADD these new items:: 42 | 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Class Extension Prefix 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This item allows you to set the filename/classname prefix when extending 50 | | native libraries. For more information please see the user guide: 51 | | 52 | | http://codeigniter.com/user_guide/general/core_classes.html 53 | | http://codeigniter.com/user_guide/general/creating_libraries.html 54 | | 55 | */ 56 | $config['subclass_prefix'] = 'MY_'; 57 | 58 | /* 59 | |-------------------------------------------------------------------------- 60 | | Rewrite PHP Short Tags 61 | |-------------------------------------------------------------------------- 62 | | 63 | | If your PHP installation does not have short tag support enabled CI 64 | | can rewrite the tags on-the-fly, enabling you to utilize that syntax 65 | | in your view files. Options are TRUE or FALSE (boolean) 66 | | 67 | */ 68 | $config['rewrite_short_tags'] = FALSE; 69 | 70 | In that same file REMOVE this item:: 71 | 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | Enable/Disable Error Logging 76 | |-------------------------------------------------------------------------- 77 | | 78 | | If you would like errors or debug messages logged set this variable to 79 | | TRUE (boolean). Note: You must set the file permissions on the "logs" folder 80 | | such that it is writable. 81 | | 82 | */ 83 | $config['log_errors'] = FALSE; 84 | 85 | Error logging is now disabled simply by setting the threshold to zero. 86 | 87 | Step 4: Update your main index.php file 88 | ======================================= 89 | 90 | If you are running a stock index.php file simply replace your version 91 | with the new one. 92 | 93 | If your index.php file has internal modifications, please add your 94 | modifications to the new file and use it. 95 | 96 | Step 5: Update your user guide 97 | ============================== 98 | 99 | Please also replace your local copy of the user guide with the new 100 | version. 101 | -------------------------------------------------------------------------------- /source/installation/upgrade_152.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.0 to 1.5.2 3 | ############################# 4 | 5 | .. note:: The instructions on this page assume you are running version 6 | 1.5.0 or 1.5.1. If you have not upgraded to that version please do so 7 | first. 8 | 9 | Before performing an update you should take your site offline by 10 | replacing the index.php file with a static one. 11 | 12 | Step 1: Update your CodeIgniter files 13 | ===================================== 14 | 15 | Replace these files and directories in your "system" folder with the new 16 | versions: 17 | 18 | - system/helpers/download_helper.php 19 | - system/helpers/form_helper.php 20 | - system/libraries/Table.php 21 | - system/libraries/User_agent.php 22 | - system/libraries/Exceptions.php 23 | - system/libraries/Input.php 24 | - system/libraries/Router.php 25 | - system/libraries/Loader.php 26 | - system/libraries/Image_lib.php 27 | - system/language/english/unit_test_lang.php 28 | - system/database/DB_active_rec.php 29 | - system/database/drivers/mysqli/mysqli_driver.php 30 | - codeigniter/ 31 | 32 | .. note:: If you have any custom developed files in these folders please 33 | make copies of them first. 34 | 35 | Step 2: Update your user guide 36 | ============================== 37 | 38 | Please also replace your local copy of the user guide with the new 39 | version. 40 | -------------------------------------------------------------------------------- /source/installation/upgrade_153.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.2 to 1.5.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/database/drivers 15 | - system/helpers 16 | - system/libraries/Input.php 17 | - system/libraries/Loader.php 18 | - system/libraries/Profiler.php 19 | - system/libraries/Table.php 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Update your user guide 25 | ============================== 26 | 27 | Please also replace your local copy of the user guide with the new 28 | version. 29 | -------------------------------------------------------------------------------- /source/installation/upgrade_154.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.3 to 1.5.4 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - application/config/mimes.php 15 | - system/codeigniter 16 | - system/database 17 | - system/helpers 18 | - system/libraries 19 | - system/plugins 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Add charset to your config.php 25 | ====================================== 26 | 27 | Add the following to application/config/config.php 28 | 29 | :: 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Default Character Set 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This determines which character set is used by default in various methods 37 | | that require a character set to be provided. 38 | | 39 | */ 40 | $config['charset'] = "UTF-8"; 41 | 42 | Step 3: Autoloading language files 43 | ================================== 44 | 45 | If you want to autoload any language files, add this line to 46 | application/config/autoload.php 47 | 48 | :: 49 | 50 | $autoload['language'] = array(); 51 | 52 | Step 4: Update your user guide 53 | ============================== 54 | 55 | Please also replace your local copy of the user guide with the new 56 | version. 57 | -------------------------------------------------------------------------------- /source/installation/upgrade_160.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.5.4 to 1.6.0 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/libraries 18 | - system/plugins 19 | - system/language 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Add time_to_update to your config.php 25 | =============================================== 26 | 27 | Add the following to application/config/config.php with the other 28 | session configuration options 29 | 30 | :: 31 | 32 | $config['sess_time_to_update'] = 300; 33 | 34 | 35 | Step 3: Add $autoload['model'] 36 | ============================== 37 | 38 | Add the following to application/config/autoload.php 39 | 40 | :: 41 | 42 | /* 43 | | ------------------------------------------------------------------- 44 | | Auto-load Model files 45 | | ------------------------------------------------------------------- 46 | | Prototype: 47 | | 48 | | $autoload['model'] = array('my_model'); 49 | | 50 | */ 51 | 52 | $autoload['model'] = array(); 53 | 54 | 55 | Step 4: Add to your database.php 56 | ================================ 57 | 58 | Make the following changes to your application/config/database.php file: 59 | 60 | Add the following variable above the database configuration options, 61 | with $active_group 62 | 63 | :: 64 | 65 | $active_record = TRUE; 66 | 67 | 68 | Remove the following from your database configuration options 69 | 70 | :: 71 | 72 | $db['default']['active_r'] = TRUE; 73 | 74 | 75 | Add the following to your database configuration options 76 | 77 | :: 78 | 79 | $db['default']['char_set'] = "utf8"; 80 | $db['default']['dbcollat'] = "utf8_general_ci"; 81 | 82 | 83 | Step 5: Update your user guide 84 | ============================== 85 | 86 | Please also replace your local copy of the user guide with the new 87 | version. 88 | -------------------------------------------------------------------------------- /source/installation/upgrade_161.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.0 to 1.6.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your user guide 24 | ============================== 25 | 26 | Please also replace your local copy of the user guide with the new 27 | version. 28 | -------------------------------------------------------------------------------- /source/installation/upgrade_162.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.1 to 1.6.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Encryption Key 24 | ====================== 25 | 26 | If you are using sessions, open up application/config/config.php and 27 | verify you've set an encryption key. 28 | 29 | Step 3: Constants File 30 | ====================== 31 | 32 | Copy /application/config/constants.php to your installation, and modify 33 | if necessary. 34 | 35 | Step 4: Mimes File 36 | ================== 37 | 38 | Replace /application/config/mimes.php with the dowloaded version. If 39 | you've added custom mime types, you'll need to re-add them. 40 | 41 | Step 5: Update your user guide 42 | ============================== 43 | 44 | Please also replace your local copy of the user guide with the new 45 | version. 46 | -------------------------------------------------------------------------------- /source/installation/upgrade_163.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.2 to 1.6.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your user guide 24 | ============================== 25 | 26 | Please also replace your local copy of the user guide with the new 27 | version. 28 | -------------------------------------------------------------------------------- /source/installation/upgrade_170.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.6.3 to 1.7.0 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your Session Table 24 | ================================= 25 | 26 | If you are using the Session class in your application, AND if you are 27 | storing session data to a database, you must add a new column named 28 | user_data to your session table. Here is an example of what this column 29 | might look like for MySQL:: 30 | 31 | user_data text NOT NULL 32 | 33 | To add this column you will run a query similar to this:: 34 | 35 | ALTER TABLE `ci_sessions` ADD `user_data` text NOT NULL 36 | 37 | You'll find more information regarding the new Session functionality in 38 | the :doc:`Session class <../libraries/sessions>` page. 39 | 40 | Step 3: Update your Validation Syntax 41 | ===================================== 42 | 43 | This is an **optional**, but recommended step, for people currently 44 | using the Validation class. CI 1.7 introduces a new :doc:`Form Validation 45 | class <../libraries/form_validation>`, which deprecates the old 46 | Validation library. We have left the old one in place so that existing 47 | applications that use it will not break, but you are encouraged to 48 | migrate to the new version as soon as possible. Please read the user 49 | guide carefully as the new library works a little differently, and has 50 | several new features. 51 | 52 | Step 4: Update your user guide 53 | ============================== 54 | 55 | Please replace your local copy of the user guide with the new version, 56 | including the image files. 57 | -------------------------------------------------------------------------------- /source/installation/upgrade_171.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.7.0 to 1.7.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. 22 | 23 | Step 2: Update your user guide 24 | ============================== 25 | 26 | Please replace your local copy of the user guide with the new version, 27 | including the image files. 28 | -------------------------------------------------------------------------------- /source/installation/upgrade_172.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 1.7.1 to 1.7.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace these files and directories in your "system" folder with the new 12 | versions: 13 | 14 | - system/codeigniter 15 | - system/database 16 | - system/helpers 17 | - system/language 18 | - system/libraries 19 | - index.php 20 | 21 | .. note:: If you have any custom developed files in these folders please 22 | make copies of them first. 23 | 24 | Step 2: Remove header() from 404 error template 25 | =============================================== 26 | 27 | If you are using header() in your 404 error template, such as the case 28 | with the default error_404.php template shown below, remove that line 29 | of code. 30 | 31 | :: 32 | 33 | 34 | 35 | 404 status headers are now properly handled in the show_404() method 36 | itself. 37 | 38 | Step 3: Confirm your system_path 39 | ================================= 40 | 41 | In your updated index.php file, confirm that the $system_path variable 42 | is set to your application's system folder. 43 | 44 | Step 4: Update your user guide 45 | ============================== 46 | 47 | Please replace your local copy of the user guide with the new version, 48 | including the image files. 49 | -------------------------------------------------------------------------------- /source/installation/upgrade_201.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.0 to 2.0.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder and replace 12 | your index.php file. If any modifications were made to your index.php 13 | they will need to be made fresh in this new one. 14 | 15 | .. note:: If you have any custom developed files in these folders please 16 | make copies of them first. 17 | 18 | Step 2: Replace config/mimes.php 19 | ================================ 20 | 21 | This config file has been updated to contain more mime types, please 22 | copy it to application/config/mimes.php. 23 | 24 | Step 3: Check for forms posting to default controller 25 | ===================================================== 26 | 27 | The default behavior for form_open() when called with no parameters 28 | used to be to post to the default controller, but it will now just leave 29 | an empty action="" meaning the form will submit to the current URL. If 30 | submitting to the default controller was the expected behavior it will 31 | need to be changed from:: 32 | 33 | echo form_open(); //
34 | 35 | to use either a / or base_url():: 36 | 37 | echo form_open('/'); // 38 | echo form_open(base_url()); // 39 | 40 | -------------------------------------------------------------------------------- /source/installation/upgrade_202.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.1 to 2.0.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder and replace 12 | your index.php file. If any modifications were made to your index.php 13 | they will need to be made fresh in this new one. 14 | 15 | .. note:: If you have any custom developed files in these folders please 16 | make copies of them first. 17 | 18 | Step 2: Remove loading calls for the Security Library 19 | ===================================================== 20 | 21 | Security has been moved to the core and is now always loaded 22 | automatically. Make sure you remove any loading calls as they will 23 | result in PHP errors. 24 | 25 | Step 3: Move MY_Security 26 | ========================= 27 | 28 | If you are overriding or extending the Security library, you will need 29 | to move it to application/core. 30 | 31 | csrf_token_name and csrf_hash have changed to protected class 32 | properties. Please use security->get_csrf_hash() and 33 | security->get_csrf_token_name() to access those values. 34 | -------------------------------------------------------------------------------- /source/installation/upgrade_203.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.2 to 2.0.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder and replace 12 | your index.php file. If any modifications were made to your index.php 13 | they will need to be made fresh in this new one. 14 | 15 | .. note:: If you have any custom developed files in these folders please 16 | make copies of them first. 17 | 18 | Step 2: Update your main index.php file 19 | ======================================= 20 | 21 | If you are running a stock index.php file simply replace your version 22 | with the new one. 23 | 24 | If your index.php file has internal modifications, please add your 25 | modifications to the new file and use it. 26 | 27 | Step 3: Replace config/user_agents.php 28 | ======================================= 29 | 30 | This config file has been updated to contain more user agent types, 31 | please copy it to application/config/user_agents.php. 32 | 33 | Step 4: Change references of the EXT constant to ".php" 34 | ======================================================= 35 | 36 | .. note:: The EXT Constant has been marked as deprecated, but has not 37 | been removed from the application. You are encouraged to make the 38 | changes sooner rather than later. 39 | 40 | Step 5: Remove APPPATH.'third_party' from autoload.php 41 | ======================================================= 42 | 43 | Open application/config/autoload.php, and look for the following:: 44 | 45 | $autoload['packages'] = array(APPPATH.'third_party'); 46 | 47 | If you have not chosen to load any additional packages, that line can be 48 | changed to:: 49 | 50 | $autoload['packages'] = array(); 51 | 52 | Which should provide for nominal performance gains if not autoloading 53 | packages. 54 | 55 | Update Sessions Database Tables 56 | =============================== 57 | 58 | If you are using database sessions with the CI Session Library, please 59 | update your ci_sessions database table as follows:: 60 | 61 | CREATE INDEX last_activity_idx ON ci_sessions(last_activity); 62 | ALTER TABLE ci_sessions MODIFY user_agent VARCHAR(120); 63 | 64 | -------------------------------------------------------------------------------- /source/installation/upgrade_210.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.0.3 to 2.1.0 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Replace config/user_agents.php 17 | ====================================== 18 | 19 | This config file has been updated to contain more user agent types, 20 | please copy it to _application/config/user_agents.php*. 21 | 22 | Step 3: Update your user guide 23 | ============================== 24 | 25 | Please also replace your local copy of the user guide with the new 26 | version. -------------------------------------------------------------------------------- /source/installation/upgrade_211.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.0 to 2.1.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Replace config/mimes.php 17 | ================================ 18 | 19 | This config file has been updated to contain more user mime-types, please copy 20 | it to _application/config/mimes.php*. 21 | 22 | Step 3: Update your IP address tables 23 | ===================================== 24 | 25 | This upgrade adds support for IPv6 IP addresses. In order to store them, you need 26 | to enlarge your ip_address columns to 45 characters. For example, CodeIgniter's 27 | session table will need to change 28 | 29 | :: 30 | 31 | ALTER TABLE ci_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL -------------------------------------------------------------------------------- /source/installation/upgrade_212.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.1 to 2.1.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Update your user guide 17 | ============================== 18 | 19 | Please also replace your local copy of the user guide with the new 20 | version. -------------------------------------------------------------------------------- /source/installation/upgrade_213.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.2 to 2.1.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. 15 | 16 | Step 2: Update your user guide 17 | ============================== 18 | 19 | Please also replace your local copy of the user guide with the new 20 | version. -------------------------------------------------------------------------------- /source/installation/upgrade_214.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.3 to 2.1.4 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /source/installation/upgrade_220.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.1.4 to 2.2.x 3 | ############################# 4 | 5 | .. note:: The :doc:`Encrypt Class ` now requires the 6 | Mcrypt extension. If you were previously using the Encrypt Class 7 | without Mcrypt, then this is a breaking change. You must install 8 | the Mcrypt extension in order to upgrade. For information on 9 | installing Mcrypt please see the PHP `documentation 10 | `. 11 | 12 | Before performing an update you should take your site offline by 13 | replacing the index.php file with a static one. 14 | 15 | Step 1: Update your CodeIgniter files 16 | ===================================== 17 | 18 | Replace all files and directories in your "system" folder. 19 | 20 | .. note:: If you have any custom developed files in these folders please 21 | make copies of them first. -------------------------------------------------------------------------------- /source/installation/upgrade_221.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.2.0 to 2.2.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /source/installation/upgrade_222.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.2.1 to 2.2.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /source/installation/upgrade_223.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 2.2.2 to 2.2.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your "system" folder. 12 | 13 | .. note:: If you have any custom developed files in these folders please 14 | make copies of them first. -------------------------------------------------------------------------------- /source/installation/upgrade_301.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 3.0.0 to 3.0.1 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your *system/* directory. 12 | 13 | .. note:: If you have any custom developed files in these directories, 14 | please make copies of them first. 15 | 16 | Step 2: Update your CLI error templates 17 | ======================================= 18 | 19 | Replace all files under your *application/views/errors/cli/* directory. 20 | -------------------------------------------------------------------------------- /source/installation/upgrade_302.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 3.0.1 to 3.0.2 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your *system/* directory. 12 | 13 | .. note:: If you have any custom developed files in these directories, 14 | please make copies of them first. 15 | 16 | Step 2: Update your application/config/constants.php file 17 | ========================================================= 18 | 19 | The *application/config/constants.php* file has been updated to check 20 | if constants aren't already defined before doing that, making it easier 21 | to add an environment-specific configuration. 22 | 23 | .. note:: If you've made modifications to this file, please make a 24 | backup first and cross-check the differences first. -------------------------------------------------------------------------------- /source/installation/upgrade_303.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrading from 3.0.2 to 3.0.3 3 | ############################# 4 | 5 | Before performing an update you should take your site offline by 6 | replacing the index.php file with a static one. 7 | 8 | Step 1: Update your CodeIgniter files 9 | ===================================== 10 | 11 | Replace all files and directories in your *system/* directory. 12 | 13 | .. note:: If you have any custom developed files in these directories, 14 | please make copies of them first. 15 | -------------------------------------------------------------------------------- /source/installation/upgrade_b11.rst: -------------------------------------------------------------------------------- 1 | ################################### 2 | Upgrading From Beta 1.0 to Beta 1.1 3 | ################################### 4 | 5 | To upgrade to Beta 1.1 please perform the following steps: 6 | 7 | Step 1: Replace your index file 8 | =============================== 9 | 10 | Replace your main index.php file with the new index.php file. Note: If 11 | you have renamed your "system" folder you will need to edit this info in 12 | the new file. 13 | 14 | Step 2: Relocate your config folder 15 | =================================== 16 | 17 | This version of CodeIgniter now permits multiple sets of "applications" 18 | to all share a common set of backend files. In order to enable each 19 | application to have its own configuration values, the config directory 20 | must now reside inside of your application folder, so please move it 21 | there. 22 | 23 | Step 3: Replace directories 24 | =========================== 25 | 26 | Replace the following directories with the new versions: 27 | 28 | - drivers 29 | - helpers 30 | - init 31 | - libraries 32 | - scaffolding 33 | 34 | Step 4: Add the calendar language file 35 | ====================================== 36 | 37 | There is a new language file corresponding to the new calendaring class 38 | which must be added to your language folder. Add the following item to 39 | your version: language/english/calendar_lang.php 40 | 41 | Step 5: Edit your config file 42 | ============================= 43 | 44 | The original application/config/config.php file has a typo in it Open 45 | the file and look for the items related to cookies:: 46 | 47 | $conf['cookie_prefix'] = ""; 48 | $conf['cookie_domain'] = ""; 49 | $conf['cookie_path'] = "/"; 50 | 51 | Change the array name from $conf to $config, like this:: 52 | 53 | $config['cookie_prefix'] = ""; 54 | $config['cookie_domain'] = ""; 55 | $config['cookie_path'] = "/"; 56 | 57 | Lastly, add the following new item to the config file (and edit the 58 | option if needed):: 59 | 60 | 61 | /* 62 | |------------------------------------------------ 63 | | URI PROTOCOL 64 | |------------------------------------------------ 65 | | 66 | | This item determines which server global 67 | | should be used to retrieve the URI string. The 68 | | default setting of "auto" works for most servers. 69 | | If your links do not seem to work, try one of 70 | | the other delicious flavors: 71 | | 72 | | 'auto' Default - auto detects 73 | | 'path_info' Uses the PATH_INFO 74 | | 'query_string' Uses the QUERY_STRING 75 | */ 76 | 77 | $config['uri_protocol'] = "auto"; 78 | 79 | -------------------------------------------------------------------------------- /source/installation/upgrading.rst: -------------------------------------------------------------------------------- 1 | ############################# 2 | Upgrade Dari Versi Sebelumnya 3 | ############################# 4 | 5 | Silakan baca catatan *upgrade* sesuai dengan dari versi yang ingin Anda *upgrade*. 6 | 7 | .. toctree:: 8 | :titlesonly: 9 | 10 | Upgrading from 3.0.2 to 3.0.3 11 | Upgrading from 3.0.1 to 3.0.2 12 | Upgrading from 3.0.0 to 3.0.1 13 | Upgrading from 2.2.x to 3.0.x 14 | Upgrading from 2.2.2 to 2.2.3 15 | Upgrading from 2.2.1 to 2.2.2 16 | Upgrading from 2.2.0 to 2.2.1 17 | Upgrading from 2.1.4 to 2.2.x 18 | Upgrading from 2.1.3 to 2.1.4 19 | Upgrading from 2.1.2 to 2.1.3 20 | Upgrading from 2.1.1 to 2.1.2 21 | Upgrading from 2.1.0 to 2.1.1 22 | Upgrading from 2.0.3 to 2.1.0 23 | Upgrading from 2.0.2 to 2.0.3 24 | Upgrading from 2.0.1 to 2.0.2 25 | Upgrading from 2.0 to 2.0.1 26 | Upgrading from 1.7.2 to 2.0 27 | Upgrading from 1.7.1 to 1.7.2 28 | Upgrading from 1.7.0 to 1.7.1 29 | Upgrading from 1.6.3 to 1.7.0 30 | Upgrading from 1.6.2 to 1.6.3 31 | Upgrading from 1.6.1 to 1.6.2 32 | Upgrading from 1.6.0 to 1.6.1 33 | Upgrading from 1.5.4 to 1.6.0 34 | Upgrading from 1.5.3 to 1.5.4 35 | Upgrading from 1.5.2 to 1.5.3 36 | Upgrading from 1.5.0 or 1.5.1 to 1.5.2 37 | Upgrading from 1.4.1 to 1.5.0 38 | Upgrading from 1.4.0 to 1.4.1 39 | Upgrading from 1.3.3 to 1.4.0 40 | Upgrading from 1.3.2 to 1.3.3 41 | Upgrading from 1.3.1 to 1.3.2 42 | Upgrading from 1.3 to 1.3.1 43 | Upgrading from 1.2 to 1.3 44 | Upgrading from 1.1 to 1.2 45 | Upgrading from Beta 1.0 to Beta 1.1 46 | -------------------------------------------------------------------------------- /source/libraries/index.rst: -------------------------------------------------------------------------------- 1 | ################# 2 | Referensi Library 3 | ################# 4 | 5 | .. toctree:: 6 | :glob: 7 | :titlesonly: 8 | 9 | * 10 | -------------------------------------------------------------------------------- /source/libraries/typography.rst: -------------------------------------------------------------------------------- 1 | ################ 2 | Typography Class 3 | ################ 4 | 5 | The Typography Class provides methods that help you format text. 6 | 7 | .. contents:: 8 | :local: 9 | 10 | .. raw:: html 11 | 12 |
13 | 14 | ************************** 15 | Using the Typography Class 16 | ************************** 17 | 18 | Initializing the Class 19 | ====================== 20 | 21 | Like most other classes in CodeIgniter, the Typography class is 22 | initialized in your controller using the ``$this->load->library()`` method:: 23 | 24 | $this->load->library('typography'); 25 | 26 | Once loaded, the Typography library object will be available using:: 27 | 28 | $this->typography 29 | 30 | *************** 31 | Class Reference 32 | *************** 33 | 34 | .. php:class:: CI_Typography 35 | 36 | .. attribute:: $protect_braced_quotes = FALSE 37 | 38 | When using the Typography library in conjunction with the :doc:`Template Parser library ` 39 | it can often be desirable to protect single and double quotes within curly braces. 40 | To enable this, set the ``protect_braced_quotes`` class property to TRUE. 41 | 42 | Usage example:: 43 | 44 | $this->load->library('typography'); 45 | $this->typography->protect_braced_quotes = TRUE; 46 | 47 | .. method auto_typography($str[, $reduce_linebreaks = FALSE]) 48 | 49 | :param string $str: Input string 50 | :param bool $reduce_linebreaks: Whether to reduce consequitive linebreaks 51 | :returns: HTML typography-safe string 52 | :rtype: string 53 | 54 | Formats text so that it is semantically and typographically correct HTML. 55 | Takes a string as input and returns it with the following formatting: 56 | 57 | - Surrounds paragraphs within

(looks for double line breaks to identify paragraphs). 58 | - Single line breaks are converted to
, except those that appear within
 tags.
 59 | 		 -  Block level elements, like 
tags, are not wrapped within paragraphs, but their contained text is if it contains paragraphs. 60 | - Quotes are converted to correctly facing curly quote entities, except those that appear within tags. 61 | - Apostrophes are converted to curly apostrophe entities. 62 | - Double dashes (either like -- this or like--this) are converted to em—dashes. 63 | - Three consecutive periods either preceding or following a word are converted to ellipsis (…). 64 | - Double spaces following sentences are converted to non-breaking spaces to mimic double spacing. 65 | 66 | Usage example:: 67 | 68 | $string = $this->typography->auto_typography($string); 69 | 70 | There is one optional parameter that determines whether the parser should reduce more than two consecutive line breaks down to two. 71 | Pass boolean TRUE to enable reducing line breaks:: 72 | 73 | $string = $this->typography->auto_typography($string, TRUE); 74 | 75 | .. note:: Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. 76 | If you choose to use this method you may want to consider :doc:`caching <../general/caching>` your pages. 77 | 78 | .. php:method:: format_characters($str) 79 | 80 | :param string $str: Input string 81 | :returns: Formatted string 82 | :rtype: string 83 | 84 | This method is similar to ``auto_typography()`` above, except that it only does character conversion: 85 | 86 | - Quotes are converted to correctly facing curly quote entities, except those that appear within tags. 87 | - Apostrophes are converted to curly apostrophe entities. 88 | - Double dashes (either like -- this or like--this) are converted to em—dashes. 89 | - Three consecutive periods either preceding or following a word are converted to ellipsis (…). 90 | - Double spaces following sentences are converted to non-breaking spaces to mimic double spacing. 91 | 92 | Usage example:: 93 | 94 | $string = $this->typography->format_characters($string); 95 | 96 | .. php:method:: nl2br_except_pre($str) 97 | 98 | :param string $str: Input string 99 | :returns: Formatted string 100 | :rtype: string 101 | 102 | Converts newlines to
tags unless they appear within
 tags.
103 | 		This method is identical to the native PHP :php:func:`nl2br()` function, except that it ignores 
 tags.
104 | 
105 | 		Usage example::
106 | 
107 | 			$string = $this->typography->nl2br_except_pre($string);


--------------------------------------------------------------------------------
/source/license.rst:
--------------------------------------------------------------------------------
 1 | #####################
 2 | The MIT License (MIT)
 3 | #####################
 4 | 
 5 | Copyright (c) 2014 - 2015, British Columbia Institute of Technology
 6 | 
 7 | Permission is hereby granted, free of charge, to any person obtaining a copy
 8 | of this software and associated documentation files (the "Software"), to deal
 9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 | 
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 | 
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.


--------------------------------------------------------------------------------
/source/overview/appflow.rst:
--------------------------------------------------------------------------------
 1 | #############
 2 | Alur Aplikasi
 3 | #############
 4 | 
 5 | Grafik berikut menggambarkan bagaimana alur data melewati sistem:
 6 | 
 7 | |Alur aplikasi Codeigniter|
 8 | 
 9 | #. File ``index.php`` berfungsi sebagai *front controller*, menginisialisasi *resource* utama yang dibutuhkan untuk menjalankan CodeIgniter.
10 | #. *Router* memeriksa *HTTP request* untuk menentukan apa yang harus dilakukan dengan itu.
11 | #. Jika file *cache* ada, dikirim langsung ke browser, melewati eksekusi sistem normal.
12 | #. Keamanan. Sebelum *controller* aplikasi dimuat, *HTTP request* dan setiap data pengguna yang di *submit* disaring terlebih dahulu untuk keamanan.
13 | #. *Controller* memuat *model*, *library* utama, *helper*, dan setiap *resource* lainnya yang diperlukan untuk memproses permintaan khusus.
14 | #. *View* di *render* kemudian dikirim ke web browser agar dapat dilihat. Jika *caching* diaktifkan, *view* di *cache* terlebih dahulu sehingga pada permintaan berikutnya dapat dilayani.
15 | 
16 | .. |Alur aplikasi Codeigniter| image:: ../images/appflowchart.gif
17 | 


--------------------------------------------------------------------------------
/source/overview/at_a_glance.rst:
--------------------------------------------------------------------------------
  1 | ###########################
  2 | Sekilas Tentang CodeIgniter
  3 | ###########################
  4 | 
  5 | CodeIgniter itu Sebuah Aplikasi Framework
  6 | =========================================
  7 | 
  8 | CodeIgniter adalah sebuah Application Development Framework (toolkit)
  9 | bagi orang-orang yang ingin membangun website menggunakan PHP.
 10 | Tujuannya adalah untuk memungkinkan Anda mengembangkan proyek-proyek
 11 | lebih cepat daripada Anda menulis kode dari awal, tersedia banyak libary
 12 | untuk tugas-tugas yang biasa diperlukan, serta antarmuka dan struktur logis
 13 | yang sederhana untuk mengakses library ini. CodeIgniter memungkinkan Anda fokus
 14 | pada proyek Anda dengan meminimalkan jumlah kode yang dibutuhkan untuk tugas yang diberikan.
 15 | 
 16 | CodeIgniter itu Gratis
 17 | ======================
 18 | 
 19 | CodeIgniter dilisensikan di bawah lisensi MIT sehingga Anda dapat menggunakannya sesuka hati Anda.
 20 | Untuk informasi lebih lanjut silahkan baca :doc:`license agreement <../license>`.
 21 | 
 22 | CodeIgniter itu Ringan
 23 | ======================
 24 | 
 25 | Benar-benar ringan. Sistem inti hanya memerlukan beberapa *library* yang sangat kecil.
 26 | Hal ini kontras dengan banyak *framework* yang membutuhkan lebih banyak sumber daya secara signifikan.
 27 | *Library* tambahan dimuat secara dinamis atau sesuai permintaan, berdasarkan kebutuhan Anda untuk proses tertentu, sehingga
 28 | sistem dasar sangat ramping dan cukup cepat.
 29 | 
 30 | CodeIgniter itu Cepat
 31 | =====================
 32 | 
 33 | Sangat cepat. Kami menantang Anda untuk menemukan *framework* yang memiliki kinerja
 34 | lebih baik dari CodeIgniter.
 35 | 
 36 | CodeIgniter Menggunakan M-V-C
 37 | =============================
 38 | 
 39 | CodeIgniter menggunakan pendekatan *Model-View-Controller*, yang memungkinkan pemisahan
 40 | antara logika dan presentasi. Ini sangat baik untuk proyek yang dimana desainer bekerja dengan
 41 | file template Anda, sehingga kode di file ini menjadi minimal. Kami menjelaskan MVC lebih
 42 | detail pada halamannya sendiri.
 43 | 
 44 | CodeIgniter Menghasilkan URL yang Bersih
 45 | ========================================
 46 | 
 47 | URL yang dihasilkan oleh CodeIgniter bersih dan *search-engine friendly*.
 48 | Daripada menggunakan standar "query string" pendekatan ke URL yang
 49 | identik dengan sistem dinamis, CodeIgniter menggunakan pendekatan *segment-based*::
 50 | 
 51 | 	example.com/news/article/345
 52 | 
 53 | Catatan: Secara default file ``index.php`` disertakan dalam URL tetapi bisa
 54 | dihapus menggunakan file ``.htaccess`` yang sederhana.
 55 | 
 56 | CodeIgniter Packs a Punch
 57 | =========================
 58 | 
 59 | CodeIgniter dilengkapi dengan *library* yang lengkap yang umumnya paling
 60 | diperlukan untuk tugas pengembangan web, seperti mengakses database,
 61 | mengirim email, memvalidasi data *form*, menjaga *session*, memanipulasi
 62 | gambar, bekerja dengan XML-RPC data dan masih banyak lagi.
 63 | 
 64 | CodeIgniter itu Extensible
 65 | ==========================
 66 | 
 67 | Sistem ini dapat dengan mudah diperluas dengan menggunakan *library* Anda sendiri,
 68 | *helper*, atau melalui *class extensions* atau *system hooks*.
 69 | 
 70 | CodeIgniter Tidak Membutuhkan Template Engine
 71 | =============================================
 72 | 
 73 | Meskipun CodeIgniter mempunyai template parser sederhana yang bisa
 74 | digunakan secara opsional, ia tidak memaksa Anda untuk menggunakannya.
 75 | *Template engine* tidak bisa menyamai kinerja *native* PHP, dan sintaks yang
 76 | harus dipelajari untuk menggunakan *template engine* biasanya hanya sedikit
 77 | lebih mudah daripada belajar dasar-dasar PHP. Pertimbangkan blok kode PHP berikut::
 78 | 
 79 | 	
    80 | 81 |
  • 82 | 83 |
84 | 85 | Kontras ini dengan *pseudo-code* yang digunakan oleh *template engine*:: 86 | 87 |
    88 | {foreach from=$addressbook item="name"} 89 |
  • {$name}
  • 90 | {/foreach} 91 |
92 | 93 | Ya, contoh *template engine* diatas sedikit lebih bersih, tapi harus ditukar dengan performa, 94 | karena pseudo-code harus diubah kembali ke PHP untuk dijalankan. 95 | Karena salah satu tujuan kami adalah **performa maksimal**, kami memilih untuk tidak 96 | memerlukan penggunaan *template engine*. 97 | 98 | CodeIgniter didokumentasikan Secara Menyeluruh 99 | ============================================== 100 | 101 | Programmer suka kode dan membenci menulis dokumentasi. Kami tidak berbeda, 102 | tentu saja, tapi karena dokumentasi **sama pentingnya** sebagai 103 | kode itu sendiri, maka kami berkomitmen untuk melakukannya. *Source code* kami sangat 104 | bersih dan mempunyai komentar yang baik juga. 105 | 106 | CodeIgniter memiliki Komunitas Pengguna yang Ramah 107 | ================================================== 108 | 109 | Komunitas pengguna yang berkembang dapat dilihat secara aktif yang berpartisipasi dalam 110 | `Community Forums `_ kami. 111 | -------------------------------------------------------------------------------- /source/overview/features.rst: -------------------------------------------------------------------------------- 1 | ###################### 2 | Keunggulan CodeIgniter 3 | ###################### 4 | 5 | Fitur dalam dan dari diri mereka sendiri adalah cara yang sangat buruk untuk 6 | menilai sebuah aplikasi karena mereka belum memberitahu Anda apa-apa tentang 7 | pengalaman pengguna, atau bagaimana itu dirancang secara cerdas atau intuitif. 8 | Fitur tidak mengungkapkan apa-apa tentang kualitas kode, atau kinerja, atau 9 | perhatian terhadap detail, atau penerapan keamanan. Satu-satunya cara untuk 10 | benar-benar menilai sebuah aplikasi adalah dengan mencobanya dan mengenal kodenya. 11 | :doc:`Instalasi <../installation/index>` CodeIgniter sangat mudah, oleh karena itu 12 | kami mendorong Anda untuk melakukan hal itu. Sementara itu, ini adalah daftar 13 | fitur utama CodeIgniter. 14 | 15 | - Sistem berbasis MVC 16 | - Sangat ringan 17 | - Database Class yang lengkap dengan dukungan untuk beberapa *platform*. 18 | - Dukungan *query builder* untuk database 19 | - Form dan validasi data 20 | - Keamanan dan penyaringan XSS 21 | - Manajemen *sessions* 22 | - *Email Sending Class*. Mendukung lampiran, HTML/Text email, beberapa protokol (sendmail, SMTP, dan Mail) dan banyak lagi. 23 | - *Image Manipulation Library* (*cropping*, mengubah ukuran, memutar, dll). Mendukung GD, ImageMagick, dan Netpbm 24 | - *File Uploading Class* 25 | - *FTP Class* 26 | - *Localization* 27 | - *Pagination* 28 | - Enkripsi data 29 | - *Benchmarking* 30 | - *Full Page Caching* 31 | - *Error Logging* 32 | - *Application Profiling* 33 | - *Calendaring Class* 34 | - *User Agent Class* 35 | - *Zip Encoding Class* 36 | - *Template Engine Class* 37 | - *Trackback Class* 38 | - *XML-RPC Library* 39 | - *Unit Testing Class* 40 | - *Search-engine Friendly URLs* 41 | - *Flexible URI Routing* 42 | - Dukungan untuk Hooks dan Class Extensions 43 | - Kumpulan *library* fungsi-fungsi "helper" yang besar 44 | -------------------------------------------------------------------------------- /source/overview/getting_started.rst: -------------------------------------------------------------------------------- 1 | ########################## 2 | Memulai dengan CodeIgniter 3 | ########################## 4 | 5 | Aplikasi perangkat lunak memerlukan beberapa proses untuk belajar. Kami telah memberikan 6 | usaha terbaik kami untuk meminimalkan proses belajar dan membuat proses belajar menjadi 7 | menyenangkan. 8 | 9 | Langkah pertama adalah :doc:`menginstall <../installation/index>` 10 | CodeIgniter, kemudian membaca semua topik dalam **Pendahuluan** bagian dari 11 | Daftar Isi. 12 | 13 | Berikutnya, membaca setiap halaman-halaman di dalam **Topik Umum** secara urut. Setiap topik 14 | dibuat berdasarkan topik sebelumnya, dan termasuk contoh kode yang dianjurkan untuk Anda coba. 15 | 16 | Setelah Anda memahami dasar-dasar Codeigniter, Anda akan siap untuk menjelajahi halaman 17 | **Class Reference** dan halaman **Helper Reference** untuk belajar memanfaatkan 18 | file *library* dan *helper*. 19 | 20 | Jangan ragu untuk mengunjungi `Community Forum `_ 21 | jika Anda memiliki pertanyaan atau masalah, dan `Wiki `_ kami untuk melihat contoh kode 22 | yang diposting oleh pengguna lain. 23 | -------------------------------------------------------------------------------- /source/overview/goals.rst: -------------------------------------------------------------------------------- 1 | ############################## 2 | Desain and Sasaran Arsitektur 3 | ############################## 4 | 5 | Tujuan kami untuk CodeIgniter adalah kinerja yang maksimum, kemampuan, dan fleksibilitas dalam hal terkecil, *package* seringan mungkin. 6 | 7 | Untuk memenuhi tujuan ini kami berkomitmen untuk melakukan *benchmarking*, *re-factoring*, dan 8 | menyederhanakan setiap langkah dari proses pembangunanan, menolak semua yang tidak menjadi tujuan berikutnya. 9 | 10 | Dari sudut pandang teknis dan arsitektur, CodeIgniter diciptakan dengan tujuan sebagai berikut: 11 | 12 | - **Dynamic Instantiation.** Dalam CodeIgniter, komponen dimuat dan rutinitas dieksekusi hanya jika diminta, bukan secara global. 13 | Tidak ada asumsi yang dibuat oleh sistem tentang apa yang mungkin diperlukan di luar *resource* utama minimal, 14 | sehingga sistem ini sangat ringan secara *default*. *Event*, yang dipicu oleh *HTTP request*, dan *controller* dan 15 | *view* yang Anda rancang akan menentukan apa yang dipanggil. 16 | - **Loose Coupling.** *Coupling* adalah sejauh mana komponen-komponen dari sistem mengandalkan satu sama lain. 17 | Semakin sedikit komponen yang bergantung satu sama lain, maka komponen tersebut lebih dapat digunakan kembali dan sistem menjadi fleksibel. 18 | Tujuan kami adalah sistem yang sangat longgar (*very loosely coupled system*). 19 | - **Component Singularity.** *Singularity* adalah sejauh mana komponen memiliki tujuan yang difokuskan secara sempit. Dalam CodeIgniter, 20 | setiap *class* dan fungsinya sangat otonom supaya memungkinkan kegunaan yang maksimal. 21 | 22 | CodeIgniter itu *dynamically instantiated*, sistem yang *loosely coupled* dengan singularitas komponen yang tinggi. 23 | Codeigniter berusaha untuk sederhana, fleksible, dan kinerja tinggi dalam paket dengan *footprint* yang kecil. 24 | -------------------------------------------------------------------------------- /source/overview/index.rst: -------------------------------------------------------------------------------- 1 | #################### 2 | Ikhtisar CodeIgniter 3 | #################### 4 | 5 | Halaman-halaman berikut menggambarkan konsep luas CodeIgniter: 6 | 7 | .. toctree:: 8 | :titlesonly: 9 | 10 | Memulai dengan CodeIgniter 11 | Sekilas Tentang CodeIgniter 12 | Fitur yang Didukung 13 | Alur Aplikasi 14 | Model-View-Controller 15 | Desain and Sasaran Arsitektur 16 | -------------------------------------------------------------------------------- /source/overview/mvc.rst: -------------------------------------------------------------------------------- 1 | ##################### 2 | Model-View-Controller 3 | ##################### 4 | 5 | CodeIgniter didasarkan pada pola pengembangan **Model-View-Controller**. 6 | MVC adalah pendekatan perangkat lunak yang memisahkan logika aplikasi dari 7 | presentasi. Dalam prakteknya, itu memungkinkan halaman web Anda memiliki 8 | *scripting* yang minimal karena presentasi terpisah dari *scripting* PHP. 9 | 10 | - **Model** mewakili struktur data Anda. Biasanya *class* model Anda akan berisi fungsi yang 11 | membantu Anda mengambil, menyimpan, dan memperbarui informasi dalam database Anda. 12 | - **View** adalah informasi yang disajikan kepada pengguna. *View* yang biasanya akan menjadi halaman web, 13 | tetapi dalam CodeIgniter, *view* juga bisa menjadi bagian dari sebuah halaman seperti header atau footer. 14 | Hal ini juga dapat menjadi halaman *RSS*, atau jenis-jenis lain dari "halaman". 15 | - **Controller** berfungsi sebagai perantara antara *Model*, *View*, dan *resource* lain yang diperlukan 16 | untuk memproses *HTTP request* dan menghasilkan halaman web. 17 | 18 | CodeIgniter memiliki pendekatan yang cukup longgar untuk MVC karena *Model* tidak 19 | selalu diperlukan. Jika Anda tidak perlu menambahkan pemisahan, atau menemukan bahwa 20 | mempertahankan sebuah *model* memerlukan kompleksitas lebih dari yang Anda inginkan, Anda bisa 21 | mengabaikan mereka dan membangun aplikasi Anda dengan minimal menggunakan *Controller* dan 22 | *View*. CodeIgniter juga memungkinkan Anda untuk memasukkan *script* Anda sendiri, 23 | atau bahkan mengembangkan *library* inti untuk sistem, memungkinkan Anda untuk 24 | bekerja dengan cara yang paling masuk akal bagi Anda. 25 | -------------------------------------------------------------------------------- /source/tutorial/conclusion.rst: -------------------------------------------------------------------------------- 1 | ########## 2 | Kesimpulan 3 | ########## 4 | 5 | Tutorial ini tidak mencakup semua hal yang Anda harapkan dari *content 6 | management system*, tetapi memperkenalkan Anda ke topik yang lebih penting 7 | tentang *routing*, menulis *controller*, dan *model*. Kami berharap tutorial ini 8 | memberi Anda wawasan tentang beberapa pola desain dasar CodeIgniter, yang dapat 9 | Anda perluas. 10 | 11 | Sekarang Anda telah menyelesaikan tutorial ini, kami sarankan Anda memeriksa 12 | sisa dokumentasi. CodeIgniter sering dipuji karena sifat dokumentasinya yang 13 | komprehensif. Gunakan ini untuk keuntungan Anda dan baca "Pengantar" dan "Topik 14 | Umum" secara menyeluruh. Anda harus membaca referensi *class* dan *helper* bila 15 | diperlukan. 16 | 17 | Setiap programmer PHP menengah seharusnya bisa memahami CodeIgniter dalam 18 | beberapa hari. 19 | 20 | Jika Anda masih memiliki pertanyaan tentang *framework* atau kode CodeIgniter 21 | Anda sendiri, Anda dapat: 22 | 23 | - Mengunjungi `forum kami `_ 24 | - Mengunjungi `IRC chatroom `_ 25 | - Menjelajahi `Wiki `_ 26 | 27 | -------------------------------------------------------------------------------- /source/tutorial/index.rst: -------------------------------------------------------------------------------- 1 | ######## 2 | Tutorial 3 | ######## 4 | 5 | Tutorial ini ditujukan untuk memperkenalkan Anda *framework* CodeIgniter dan 6 | prinsip-prinsip dasar arsitektur MVC. Tutorial ini akan menunjukkan Anda 7 | bagaimana aplikasi CodeIgniter dasar dibangun dalam langkah demi langkah. 8 | 9 | Dalam tutorial ini, Anda akan membuat **aplikasi berita dasar** (*basic news 10 | application*). Anda akan mulai dengan menulis kode yang dapat memuat halaman 11 | statis. Berikutnya, Anda akan membuat bagian berita yang membaca berita dari 12 | *database*. Akhirnya, Anda akan menambahkan *form* untuk membuat berita dalam 13 | *database*. 14 | 15 | Tutorial ini akan difokuskan pada: 16 | 17 | - Dasar-dasar MVC 18 | - Dasar-dasar *routing* 19 | - Validasi *form* 20 | - Melakukan *query database* dasar menggunakan "Query Builder" 21 | 22 | Seluruh tutorial ini dibagi atas beberapa halaman, masing-masing menjelaskan 23 | suatu sebagian kecil dari fungsi *framework* CodeIgniter. Anda akan melalui 24 | halaman-halaman berikut: 25 | 26 | - Pendahuluan, halaman ini, yang memberi Anda gambaran tentang apa yang harus 27 | diharapkan. 28 | - :doc:`Halaman statis `, yang akan mengajarkan Anda dasar-dasar 29 | *controller*, *view* dan *routing*. 30 | - :doc:`Bagian Berita`, di mana Anda akan mulai menggunakan 31 | *model* dan akan melakukan beberapa operasi *database* dasar. 32 | - :doc:`Buat berita `, yang akan memperkenalkan lebih lanjut 33 | tentang operasi *database* dan validasi *form*. 34 | - :doc:`Kesimpulan `, yang akan memberi Anda beberapa petunjuk 35 | tentang bacaan lebih lanjut dan sumber lainnya. 36 | 37 | Nikmati perjalanan Anda dengan *framework* CodeIgniter. 38 | 39 | .. toctree:: 40 | :glob: 41 | :hidden: 42 | :titlesonly: 43 | 44 | static_pages 45 | news_section 46 | create_news_items 47 | conclusion --------------------------------------------------------------------------------