{"id":4425,"date":"2019-12-09T04:53:41","date_gmt":"2019-12-09T04:53:41","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=4425"},"modified":"2026-03-09T19:19:21","modified_gmt":"2026-03-09T19:19:21","slug":"codeigniter-tutorial","status":"publish","type":"post","link":"\/ng\/tutorials\/codeigniter-tutorial","title":{"rendered":"CodeIgniter tutorial: the complete guide"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>Website development can seem challenging, especially if tackled without any assistance. Luckily, there are development tools like CodeIgniter. It&rsquo;s a PHP framework maintained by the British Columbia Institute of Technology with a simple yet effective toolkit for developing web applications.<\/p><p>In this CodeIgniter tutorial, we&rsquo;ll go through the process of installing and setting up the CodeIgniter framework on web hosting and a VPS and demonstrate how to create a simple web application.<\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/How-to-Speed-Up-Your-Website-EN.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/public\" alt=\"\" class=\"wp-image-69260\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/eBook-Speed-Up-your-website.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><p>\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-set-up-codeigniter-for-your-website\">Set Up CodeIgniter for Your Website<\/h2><p>Before we start, keep in mind that CodeIgniter requires a Linux, Apache, MySQL, and PHP (LAMP) stack. Luckily, it comes pre-installed with <a href=\"\/ng\/web-hosting\">Hostinger&rsquo;s web hosting plans<\/a>.<\/p><p>However, if you choose a <a href=\"\/ng\/vps-hosting\">VPS plan<\/a>, you will need to install the LAMP stack first. Here&rsquo;s how to <a href=\"\/ng\/tutorials\/how-to-install-lamp-ubuntu-16-04\">install LAMP on Ubuntu<\/a> or <a href=\"\/ng\/tutorials\/vps\/how-to-install-lamp-stack-centos7\">CentOS<\/a>. When done, proceed with the CodeIgniter setup.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-full\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-web-hosting\" href=\"\/ng\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/public\" alt=\"Hostinger web hosting banner\" class=\"wp-image-98604\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-step-1-installing-codeigniter\">Step 1. Installing CodeIgniter<\/h3><p>CodeIgniter can be installed automatically via Composer or manually by using File Manager.<\/p><p><div><p class=\"important\"><strong>Important!<\/strong> For the Composer method, SSH access is required. <a href=\"\/ng\/tutorials\/how-to-use-putty-ssh\" target=\"&rdquo;_blank&rdquo;\" rel=\"noopener\">Use PuTTY<\/a> \/ Powershell on Windows or the built-in terminal shell on Linux and macOS. <\/p><\/div>\n\n\n\n<\/p><p><strong>Install CodeIgniter 4 Using Composer<\/strong><\/p><ol class=\"wp-block-list\">\n<li>Log in to your SSH account and navigate to the <strong>public_html <\/strong>root directory with this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd domains\/yourdomain.com\/public_html<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Install CodeIgniter 4.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">composer create<strong>-<\/strong>project codeigniter4<strong>\/<\/strong>appstarter project<strong>-<\/strong>root <\/pre><p>The command above will create a <strong>project-root<\/strong> directory for the CodeIgniter files. In this tutorial, we&rsquo;re using the latest stable CodeIgniter version &ndash; <strong>4.1.9<\/strong>. You can use the command below from your CodeIgniter directory to update it:<\/p><pre class=\"wp-block-preformatted\">composer update<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>For convenience, we recommend moving the contents of <strong>project-root<\/strong> to the <strong>public_html<\/strong> directory. First, determine the current directory with this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">pwd <\/pre><p>It will look something like this: <\/p><pre class=\"wp-block-preformatted\">\/home\/u123456789\/domains\/yourdomain.com\/public_html <\/pre><p>Now move the files: <\/p><pre class=\"wp-block-preformatted\">mv project-root\/* \/home\/u123456789\/domains\/yourdomain.com\/public_html <\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Once that&rsquo;s done, enter this URL into the browser:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\"><a href=\"https:\/\/yourdomain.com\/public\">https:\/\/yourdomain.com\/public <\/a> <\/pre><p>Make sure to replace <strong>yourdomain.com<\/strong> with your domain.<\/p><p>CodeIgniter&rsquo;s default screen will appear, letting you know it was installed successfully.<\/p><p><strong>Install CodeIgniter 4 Manually<\/strong><\/p><p>If you want to skip the SSH part needed for Composer, go with the manual installation.<\/p><p>Remember that even though the manual method is simple, you will need to check for merge conflicts when updating your website. Follow these steps to perform the manual installation:<\/p><ol class=\"wp-block-list\">\n<li>Download the <a href=\"https:\/\/github.com\/CodeIgniter4\/framework\/releases\/tag\/v4.1.6\">latest version of CodeIgniter<\/a>.<\/li>\n\n\n\n<li>Using File Manager, extract it in the root directory &ndash; <strong>yourdomain.com\/public_html<\/strong>.<\/li>\n\n\n\n<li>The <strong>framework-4.1.9<\/strong> folder will appear. Open it and double-click the folder within. You should see a window like this one:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/12\/A-File-Manager-page-showcasing-Codeigniter-installation-files.png\"><img loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"461\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/A-File-Manager-page-showcasing-Codeigniter-installation-files.png\/public\" alt=\"A File Manager page showcasing Codeigniter installation files\" class=\"wp-image-55945\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/A-File-Manager-page-showcasing-Codeigniter-installation-files.png\/w=623,fit=scale-down 623w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/A-File-Manager-page-showcasing-Codeigniter-installation-files.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/A-File-Manager-page-showcasing-Codeigniter-installation-files.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/a><\/figure><\/div><p>Press <strong>CTRL + A<\/strong> to select all the files and use the <strong>Move<\/strong> button to transfer everything to <strong>public_html<\/strong>:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/12\/All-of-the-CodeIgniter-files-selected-with-the-red-border-indicating-the-move-button.png\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"516\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/All-of-the-CodeIgniter-files-selected-with-the-red-border-indicating-the-move-button.png\/public\" alt=\"All of the CodeIgniter files selected with the red border indicating the move button\" class=\"wp-image-55947\" style=\"width:625px;height:517px\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/All-of-the-CodeIgniter-files-selected-with-the-red-border-indicating-the-move-button.png\/w=624,fit=scale-down 624w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/All-of-the-CodeIgniter-files-selected-with-the-red-border-indicating-the-move-button.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/All-of-the-CodeIgniter-files-selected-with-the-red-border-indicating-the-move-button.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/figure><\/div><p>The path will look like this:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/12\/The-File-Manager-move-dialog-box.png\"><img loading=\"lazy\" decoding=\"async\" width=\"314\" height=\"271\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/The-File-Manager-move-dialog-box.png\/public\" alt=\"The File Manager move dialog box\" class=\"wp-image-55946\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/The-File-Manager-move-dialog-box.png\/w=314,fit=scale-down 314w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/The-File-Manager-move-dialog-box.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/The-File-Manager-move-dialog-box.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Open the browser and enter this URL:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\"><a href=\"https:\/\/yourdomain.com\/public\"><code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">https:\/\/yourdomain.com\/public<\/code><\/a><\/pre><p>Make sure to replace <strong>yourdomain.com<\/strong> with your domain name.<\/p><p>CodeIgniter&rsquo;s default screen will appear, which means it was installed successfully.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-2-configuring-codeigniter\">Step 2. Configuring CodeIgniter<\/h3><p>After installing CodeIgniter, it&rsquo;s crucial to configure it so it works correctly. We recommend starting by <a href=\"\/ng\/tutorials\/locate-and-create-htaccess\">creating a <strong>.htaccess<\/strong><\/a> file and pasting this snippet into it:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">RewriteEngine on\nRewriteCond %{REQUEST_URI} !^public\nRewriteRule ^(.*)$ public\/$1 [L]<\/pre><p>These <strong>.htaccess<\/strong> rules will make the CodeIgniter website URL look like this:<\/p><pre class=\"wp-block-preformatted\">https:\/\/yourdomain.com <\/pre><p>Instead of:<\/p><pre class=\"wp-block-preformatted\">https:\/\/yourdomain.com\/public<\/pre><p>After that, proceed with the advanced configuration.<\/p><p><strong>Configuring CodeIgniter for Web Hosting Plans<\/strong><\/p><p>In this section, we&rsquo;ll discuss the advanced settings for web hosting plans. Let&rsquo;s start with a new MySQL database.<\/p><ol class=\"wp-block-list\">\n<li>Find the <strong>Hosting<\/strong> &rarr; <strong>Manage<\/strong> &rarr; <strong>MySQL Databases<\/strong> section on Hostinger&rsquo;s <a href=\"\/ng\/tutorials\/video\/hpanel-overview\">hPanel<\/a>:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-databases-highlighted.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"622\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-databases-highlighted.png\/public\" alt=\"The hPanel dashboard with the databases option highlighted\" class=\"wp-image-83748\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-databases-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-databases-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-databases-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-databases-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Once there, specify the database name, username, and password and click <strong>Create<\/strong>:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-management-createnewdatabase-highlighted.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"374\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-management-createnewdatabase-highlighted.png\/public\" alt=\"Databases management section in the hPanel with a highlight on the create button\" class=\"wp-image-80646\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-management-createnewdatabase-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-management-createnewdatabase-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-management-createnewdatabase-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-management-createnewdatabase-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Navigate to <strong>File Manager<\/strong> and open the <strong>Database.php<\/strong> file for editing. Here&rsquo;s the full path:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">\/domains\/yourdomain.com\/public_html\/app\/Config\/Database.php<\/code><\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Locate the following section of the file and replace the details with the information of your newly-created database &ndash; <strong>username<\/strong>, <strong>password<\/strong>, and <strong>database<\/strong>. The rest of the values should follow this example:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public $default = [\n'DSN'      =&gt; '',\n'hostname' =&gt; 'localhost',\n'username' =&gt; 'u123456789_user',\n'password' =&gt; 'Y0ur$tr0ngPa$$w0rd',\n'database' =&gt; 'u123456789_name',\n'DBDriver' =&gt; 'MySQLi',\n'DBPrefix' =&gt; '',\n'pConnect' =&gt; false,\n'DBDebug'  =&gt; (ENVIRONMENT !== 'production'),\n'charset'  =&gt; 'utf8',\n'DBCollat' =&gt; 'utf8_general_ci',\n'swapPre'  =&gt; '',\n'encrypt'  =&gt; false,\n'compress' =&gt; false,\n'strictOn' =&gt; false,\n'failover' =&gt; [],\n'port'     =&gt; 3306,\n];<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Set up your domain name by modifying CodeIgniter&rsquo;s <strong>App.php<\/strong> file found here:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">\/domains\/yourdomain.com\/public_html\/app\/Config\/App.php<\/code><\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Locate the following line and change its value to your real domain name:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">public $baseURL = 'https:\/\/yourdomain.com\/'; <\/code><\/pre><p>Save the file and exit.<\/p><p>The database is now synced with CodeIgniter.<\/p><p><strong>Configuring Virtual Hosts on VPS<\/strong><\/p><p>VPS users can run multiple CodeIgniter applications on a single domain name. To do so, they need to set up virtual hosts.<\/p><p><div><p class=\"important\"><strong>Important!<\/strong> Make sure that your VPS is using Apache and not Nginx or any other web server<\/p><\/div>\n\n\n\n<\/p><ol class=\"wp-block-list\">\n<li>Ensure that the document root is synced with the installation directory of CodeIgniter. To do so, open the virtual host file.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">sudo nano \/etc\/apache2\/sites-enabled\/000-default<\/code><\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Look for the following block:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;VirtualHost *:80&gt;\nDocumentRoot \/path\/to\/codeigniter\n[.......]\n&lt;VirtualHost *:80&gt;&lt;br&gt;<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Change <strong>\/path\/to\/codeigniter<\/strong> with the actual path of the CodeIgniter installation directory. By doing this, all URLs will point to this folder. Save the changes by pressing <strong>CTRL + X<\/strong> and <strong>Y<\/strong>.<\/li>\n<\/ol><p>For a more efficient development process, get rid of <strong>index.php<\/strong> from CodeIgniter&rsquo;s URL format. Here&rsquo;s how to do it:<\/p><ol class=\"wp-block-list\">\n<li>Open the <strong>config.php<\/strong> file.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano \/public_html\/app\/Config\/App.php<\/pre><p>Locate the following line:<\/p><pre class=\"wp-block-preformatted\">public $indexPage = 'index.php';<\/pre><p>Replace it with this:<\/p><pre class=\"wp-block-preformatted\">public $indexPage = '';<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>It&rsquo;s necessary to re-route future requests by modifying the <strong>.htaccess<\/strong> file to ensure that no errors appear. Before doing so, check whether <strong>mod_rewrite<\/strong> is enabled.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">apache2ctl -M<\/pre><p>The above command will output the capabilities of the server. If <strong>mod_rewrite<\/strong> is on the list, continue to the next step. Otherwise, execute this line: <\/p><pre class=\"wp-block-preformatted\">a2enmod rewrite<\/pre><p>Then, restart Apache.<\/p><pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"raw\" class=\"EnlighterJSRAW\">sudo service apache2 restart <\/code><\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Create a <strong>.htaccess<\/strong> file in the root folder of CodeIgniter.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano public_html\/.htaccess<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Paste the following lines to the file. If <strong>.htaccess<\/strong> was already created during the configuration part of the tutorial, add all the lines except for the first one. Save the changes and exit the file.<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">RewriteEngine on\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule .* index.php?\/$0 [PT,L]&lt;br&gt;<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Let Apache know that it should look for the newly-created <strong>.htaccess<\/strong> file. To achieve this, open the virtual host file again:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo nano \/etc\/apache2\/sites-enabled\/000-default<\/pre><p>Ensure that <strong>AllowOverride<\/strong> is set to <strong>All<\/strong>, as shown below:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;Directory&gt;\nOptions Indexes FollowSymLinks MultiViews\nAllowOverride All\nOrder allow,deny\nallow from all\n&lt;\/Directory&gt;<\/pre><p>After confirming it, save the file.<\/p><p>If done correctly, <strong>index.php<\/strong> won&rsquo;t appear, making the URL look cleaner.<\/p><h2 class=\"wp-block-heading\" id=\"h-understanding-mvc\">Understanding MVC<\/h2><p>Before continuing our CodeIgniter tutorial and learning how to build an application with the framework, we should cover the basics of the model-view-controller (MVC) pattern.<\/p><p>Simply put, MVC is a web development architecture paradigm. It states that the <a href=\"https:\/\/www.techtarget.com\/whatis\/definition\/business-logic\">business logic<\/a> in any application should be separated from the presentation.<\/p><ul class=\"wp-block-list\">\n<li><strong>Model<\/strong> &ndash; deals with the database, carries out computations, and more. In short, it is where your business logic is located.<\/li>\n\n\n\n<li><strong>View &ndash; <\/strong>forms the application&rsquo;s presentation layer where the data from models is embedded.<\/li>\n\n\n\n<li><strong>Controller<\/strong> &ndash; will route user requests to the appropriate <strong>model.<\/strong> Once the model has done its job, the controller will load the relevant <strong>view<\/strong>.<\/li>\n<\/ul><p>This architectural pattern also gives developers the flexibility to reuse code for multiple views. For example, it will allow you to implement the same navigation bar on every webpage of your application. Moreover, as both <strong>views<\/strong> and <strong>models<\/strong> are entirely separate, the front-end developers can work in parallel with the back-end team to speed up the development process.<\/p><p>Note that CodeIgniter also subscribes to the <strong>Object-Oriented Programming<\/strong> (OOP) paradigm. As such, <strong>models<\/strong> and <strong>controllers<\/strong> are PHP classes that extend the base classes provided by the framework. <strong>Views<\/strong> can also be called PHP files, although the bulk of their content is <strong>HTML\/CSS<\/strong>. Only a few snippets of core PHP code are present and are used to display the data from models.<\/p><h3 class=\"wp-block-heading\" id=\"h-routing-basics\">Routing Basics<\/h3><p>This is how CodeIgniter formats its URL strings:<\/p><pre class=\"wp-block-preformatted\">&lt;base_url&gt;\/index.php\/&lt;controller_name&gt;\/&lt;controller_function&gt;\/&lt;function_parameter_1&gt;\/&gt;\/&lt;function_parameter_2&gt;&hellip;<\/pre><p>We have shown you how to remove <strong>index.php<\/strong> from the format in the previous section. As a result, your URL will be similar to this example:<\/p><pre class=\"wp-block-preformatted\">http:\/\/www.yourdomain.com\/welcome\/tester\/1<\/pre><p>Here, <strong>welcome<\/strong> is a controller class corresponding to a controller file named <strong>welcome.php<\/strong>. This class will call the <strong>tester()<\/strong> function and pass &lsquo;<strong>1<\/strong>&rsquo; as a parameter. More parameters can be supplied similarly, separated by slashes.<\/p><h3 class=\"wp-block-heading\" id=\"h-libraries\">Libraries<\/h3><p>CodeIgniter encourages reuse of existing libraries and helper functions to perform common tasks. The framework also lets users decide which library to load and when. This on-demand process results in fast, lightweight, and feature-rich applications.<\/p><p>Loading a library is easy in CodeIgniter. For instance, to load the <strong>Database<\/strong> library, pass the following line in your model or controller:<\/p><pre class=\"wp-block-preformatted\">$this-&gt;load-&gt;database();<\/pre><p>We suggest autoloading common libraries so they&rsquo;ll be ready whenever needed. CodeIgniter uses <a href=\"https:\/\/codeigniter.com\/user_guide\/concepts\/autoloader.html#namespaces\">the PSR-4 standard<\/a>, which makes autoloading straightforward:<\/p><ol class=\"wp-block-list\">\n<li>Open the autoload file:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano app\/Config\/Autoload.php<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Add the libraries into the <strong>psr4<\/strong> array:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$psr4 = [\n'App'         =&gt; APPPATH,\n'CodeIgniter' =&gt; SYSTEMPATH,\n];<\/pre><h2 class=\"wp-block-heading\" id=\"h-create-a-simple-app-with-codeigniter\">Create a Simple App with CodeIgniter<\/h2><p>At this point of the CodeIgniter tutorial, you should have a running distribution of CodeIgniter and an understanding of how <strong>models<\/strong>, <strong>views<\/strong>, and <strong>controllers<\/strong> work. Now, we are going to create a simple CodeIgniter web application.<\/p><p>We&rsquo;ll use the <strong>model<\/strong> to fetch agency names from our database and sort and display them using our <strong>view<\/strong>. The <strong>controller<\/strong> will be used to route the requests between the <strong>model<\/strong> and the <strong>view<\/strong>.<\/p><p>Once you have a basic knowledge on the fundamental CodeIgniter process, you can start building complete web applications.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-1-creating-a-phpmyadmin-table\">Step 1. Creating a phpMyAdmin Table<\/h3><p>This section will cover the steps to create a table with phpMyAdmin via hPanel. This table is essential because it will form the basis of our application.<\/p><ol class=\"wp-block-list\">\n<li>Log in to your hosting account. Navigate to the <strong>Databases<\/strong> section and select <strong>phpMyAdmin<\/strong>.<\/li>\n\n\n\n<li>Look for the database that you have synced with CodeIgniter and click <strong>Enter phpMyAdmin<\/strong>:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"427\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted-1.png\/public\" alt=\"phpMyAdmin section on hPanel, red border is indicating a button to enter phpMyAdmin\" class=\"wp-image-80657\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted-1.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted-1.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted-1.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-databases-phpmyadmin-enterphpmyadmin-highlighted-1.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Once there, select the <strong>SQL<\/strong> section, paste in this query, and press <strong>Go<\/strong>:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE TABLE agencies (\n    id int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',\n    name varchar(100) NOT NULL COMMENT 'Name',\n    email varchar(255) NOT NULL COMMENT 'Email Address',\n    PRIMARY KEY (id)\n  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT=''AUTO_INCREMENT=1;\n  \n    INSERT INTO agencies(id, name, email) VALUES\n  (1, 'Development', 'awesomeinbox@domain.com'),\n  (2, 'Production', 'sparkingjoy@domain.net'),\n  (3, 'Testing', 'user@mydomain.com'),\n  (4, 'Building', 'editor@mydomain.net'),\n  (5, 'Debugging', 'anotherawesomeinbox@anotherdomain.com');<\/pre><p>It will look like this:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/12\/An-example-query-pasted-to-the-phpMyAdmin-SQL-section.-The-application-will-sort-out-the-pasted-entries-from-highest-to-lowest.png\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"445\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/An-example-query-pasted-to-the-phpMyAdmin-SQL-section.-The-application-will-sort-out-the-pasted-entries-from-highest-to-lowest.png\/public\" alt=\"An example query pasted to the phpMyAdmin SQL section. The application will sort out the pasted entries from highest to lowest\" class=\"wp-image-55952\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/An-example-query-pasted-to-the-phpMyAdmin-SQL-section.-The-application-will-sort-out-the-pasted-entries-from-highest-to-lowest.png\/w=683,fit=scale-down 683w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/An-example-query-pasted-to-the-phpMyAdmin-SQL-section.-The-application-will-sort-out-the-pasted-entries-from-highest-to-lowest.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/12\/An-example-query-pasted-to-the-phpMyAdmin-SQL-section.-The-application-will-sort-out-the-pasted-entries-from-highest-to-lowest.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/a><\/figure><\/div><p>This query will automatically create a database filled with the data that we will be able to use later.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-2-creating-the-model\">Step 2. Creating the Model<\/h3><p>Once the database table has been created, begin working on the business logic. To do this, create a <strong>model<\/strong> that will retrieve the database values.<\/p><ol class=\"wp-block-list\">\n<li>Access <strong>File Manager<\/strong><\/li>\n\n\n\n<li>Models are placed in the <strong>public_html\/app\/Models <\/strong>directory so they won&rsquo;t interfere with application&rsquo;s directory structure. Go to the <strong>Models<\/strong> directory and create a new PHP file called <strong>AgencyModel.php.<\/strong><\/li>\n\n\n\n<li>Paste the following code into the <strong>AgencyModel.php<\/strong> file:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php namespace AppModels;\nuse CodeIgniterDatabaseConnectionInterface;\nuse CodeIgniterModel; \nclass AgencyModel extends Model\n{\n    protected $table = 'agencies';\n     protected $allowedFields = ['name', 'email'];\n}<\/pre><p>As you can see, the model class (<strong>AgencyModel<\/strong>) extends the generic <strong>Model<\/strong> class that CodeIgniter provides. Note that CodeIgniter requires all class names to begin with a capital letter.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-3-creating-the-controller\">Step 3. Creating the Controller<\/h3><p>Next, we&rsquo;ll create a route using the <strong>controller<\/strong>. This way, whenever a user makes a request, the view will be supplied with the information from the model.<\/p><ol class=\"wp-block-list\">\n<li>To create a new controller, go to the <strong>app\/Controllers<\/strong> directory and create a file named <strong>Agencies.php<\/strong>. Remember, CodeIgniter&rsquo;s controllers must have the same name as the class inside it.<\/li>\n\n\n\n<li>Paste the following code into the file:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php namespace AppControllers;\n \nuse CodeIgniterController;\nuse AppModelsAgencyModel;\n\nclass Agencies extends Controller\n{\n}<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>We&rsquo;ll create a simple function to sort all the database entries from highest to lowest. To do so, add this code snippet to the file:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public function index()\n{    \n  $model = new AgencyModel(); \n  $data['agencies'] = $model-&gt;orderBy('id', 'DESC')-&gt;findAll();    return view('agencies', $data);\n}<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>The complete code will look like this:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php namespace AppControllers;\n\nuse CodeIgniterController;\nuse AppModelsAgencyModel;\n\nclass Agencies extends Controller\n{\npublic function index()\n{    \n  $model = new AgencyModel(); \n  $data['agencies'] = $model-&gt;orderBy('id', 'DESC')-&gt;findAll();    return view('agencies', $data);\n}\n}<\/pre><h3 class=\"wp-block-heading\" id=\"h-step-4-creating-the-view\">Step 4. Creating the View<\/h3><p>Finally, we&rsquo;ll create a <strong>view<\/strong> that will display the list of agencies.<\/p><ol class=\"wp-block-list\">\n<li>Enter the<strong> app\/Views<\/strong> folder, and create a new file titled <strong>agencies.php<\/strong>. The file&rsquo;s name has to correspond to the <strong>view<\/strong> that you told the controller to load, featured in the last line of the <strong>view()<\/strong> method.<\/li>\n\n\n\n<li>Paste in the following code and save the file:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!doctype html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n  &lt;meta charset=\"utf-8\"&gt;\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;div class=\"row mt-3\"&gt;\n     &lt;table class=\"table table-bordered\" id=\"agencies\"&gt;       &lt;thead&gt;\n   &lt;tr&gt;\n             &lt;th&gt;Id&lt;\/th&gt;\n             &lt;th&gt;Name&lt;\/th&gt;\n             &lt;th&gt;Email&lt;\/th&gt;\n          &lt;\/tr&gt;\n       &lt;\/thead&gt;\n       &lt;tbody&gt;\n          &lt;?php if($agencies): ?&gt;\n          &lt;?php foreach($agencies as $agencies1): ?&gt;\n          &lt;tr&gt;\n             &lt;td&gt;&lt;?php echo $agencies1['id']; ?&gt;&lt;\/td&gt;\n             &lt;td&gt;&lt;?php echo $agencies1['name']; ?&gt;&lt;\/td&gt;\n             &lt;td&gt;&lt;?php echo $agencies1['email']; ?&gt;&lt;\/td&gt;\n          &lt;\/tr&gt;\n         &lt;?php endforeach; ?&gt;\n         &lt;?php endif; ?&gt;\n       &lt;\/tbody&gt;\n     &lt;\/table&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre><p>The <strong>view<\/strong> will display the information passed by the controller in the <strong>$data<\/strong> array. The results won&rsquo;t be stunning since we haven&rsquo;t added styling to our view. However, you can add inline styling or reference a CSS stylesheet in the<strong> view<\/strong> later.<\/p><p>Our sample application is complete. You should be able to run this application by entering the following URL in your browser:<\/p><pre class=\"wp-block-preformatted\">http:\/\/yourdomain.com\/Agencies<\/pre><p>The web application will call the agencies&rsquo; <strong>controller<\/strong> created in <strong>Step 3<\/strong> and sort the elements of the database.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Learning how to build a web application is necessary if you wish to become a web developer. Luckily, CodeIgniter and its MVC architecture make the development process fast, efficient, and easy for anyone.<\/p><p>In this article, we&rsquo;ve discussed the essentials of this framework and talked about what makes CodeIgniter so simple yet effective. We&rsquo;ve also showcased how the MVC software design pattern operates and created a simple application.<\/p><p>If you have any remarks or questions, leave them in the comment section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Website development can seem challenging, especially if tackled without any assistance. Luckily, there are development tools like CodeIgniter. It&rsquo;s a PHP framework maintained by the British Columbia Institute of Technology with a simple yet effective toolkit for developing web applications. In this CodeIgniter tutorial, we&rsquo;ll go through the process of installing and setting up the [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/codeigniter-tutorial\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":279,"featured_media":144907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Comprehensive CodeIgniter Tutorial for Beginners","rank_math_description":"Looking to make awesome web apps? Learn how to install CodeIgniter 4 and create your first app with our comprehensive CodeIgniter tutorial.","rank_math_focus_keyword":"codeigniter tutorial","footnotes":""},"categories":[22644],"tags":[],"class_list":["post-4425","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/codeigniter-tutorial","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/tutorial-codeigniter","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/codeigniter","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/tutorial-codeigniter-indonesia-lengkap","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/codeigniter-tutorial","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/codeigniter-tutorial","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/codeigniter-tutorial","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/tutorial-codeigniter","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/codeigniter-tutorial","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/codeigniter-tutorial","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/codeigniter-tutorial","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/codeigniter-tutorial","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/4425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/279"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=4425"}],"version-history":[{"count":53,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/4425\/revisions"}],"predecessor-version":[{"id":144906,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/4425\/revisions\/144906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/144907"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=4425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=4425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=4425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}