This is my first article. actually very difficult for me to make the original conten rather than editing or copy and paste, but by the demands of love google I have made my original content. I am not here to explain what it codeigniter? but I'll share some tips for you all to use and edit the most important parts in codeigneter. please follow the following steps:
- First of all for those who do not have codeigniter, feel free to download on the official site codeigniter Here
- Then after downloading codeigniter, you will find some files from CodeIgniter please see the following picture
- Then you go to the application folder, you will find several folders. you will find two folders are "views" and "controllers". these folders are most decisive in codeigniter in the run. Please see the following picture
- Then we will try to edit 2 folder, then you will be able to use codeigniter well, first we will edit the folder "view". view serves as a directory where the php files are put. See the following picture
- Then there are some pictures that I circled. This image became my main page. index1.php as the main page for the form user and index2.php as the main admin page for the form. same as the usual functions of index.
- The following syntax to load the php file on the main page of "index1.php"
<?php if (!empty($page)): ?>For an explanation of above syntax will be explained in a later article
<?php $this->load->view($page); ?>
<?php else: ?>
<?php $this->load->view('error_page'); ?>
<?php endif; ?>
- Then we will edit the folder "controllers". function of This folder as the page controller page. or we can define as identifier pages that we have put the folder "View".
- Then in the directory "controllers" there is file named welcome.php image above is for mengidentifer edit multiple files. php that exist in the directory "Views"
a brief description of the above syntax:
public function index ()
{
$ data = array ('title' => 'Home', 'page' => 'home', 'login' => 'login');
$ this-> load-> view ('index1', $ data);
}
Home above identity of home.php is located in the directory "view"then "page" is used identifier to link to the index menuthen all the php file that will be loaded on the main page of "index1.php" And so on for multiple syntax identifier such as the step above
Download template tutorial that I used will follow
The next page will explain how to add and edit the css file, javascript and images in codeigniter
1 comments:
I like it
Post a Comment and Don't Spam!