Download presentation
Presentation is loading. Please wait.
1
Introduction To Codeigniter
2
Evolution of Web Development
How you first started building websites.
3
Evolution of Web Development
How you’re building websites now.
4
Evolution of Web Development
How you build websites with a framework
5
Architecture: Architecture an idea about how to structure your application, possibly shared through natural language documentation and structured methods. Architecture consists of the guiding principles behind a given application. Architecture is about style, abstract idea, flow, methodology, and concept. Architecture is adopted to describe the activity of designing and construction of any kind of system.
6
FrameWork: Framework an implementation of an architecture that someone can use as the basis for a working application. A Framework consists of one or more libraries. Framework as others have said is a collection of tools you use to implement your architecture. Framework is something which implements the style, idea, concept etc or makes it easier to implement it.
7
Architecture & Framework
8
MVC Architecture: MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting. The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database. The View is the information that is being presented to a user. A View will normally be a web page, but in CodeIgniter, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page". The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
9
Simple Application Flow Chart:
Your computer will send a request to the Controller. The Controller will interact with the Model, making a demand. The Model will make the processing, then return some data to the Controller. The Controller will analyze the results (maybe needs some more data, and it will make another request to another Model). Finally, the data will be sent to the view, which is interpreted by the webserver, and will be displayed back in your browser.
10
Introduction To Codeigniter.
CodeIgniter is : An Application Development Framework. A toolkit - for people who build web sites using PHP. CodeIgniter follows a Model-View-Controller (MVC). Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing Rich set of libraries for commonly needed tasks. A simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.
11
Application Flow Chart:
The index.php serves as the front controller, initializing the base resources needed to run CodeIgniter. The Router examines the HTTP request to determine what should be done with it. If a cache file exists, it is sent directly to the browser, bypassing the normal system execution. Security. Before the application controller is loaded, the HTTP request and any user submitted data is filtered for security. The Controller loads the model, core libraries, helpers, and any other resources needed to process the specific request. The finalized View is rendered then sent to the web browser to be seen. If caching is enabled, the view is cached first so that on subsequent requests it can be served.
12
And Who is That Man? CI was written by Rick Ellis, rock musician turned programmer. Rick makes his living as CEO of pMachine, which sells an excellent content management system called Expression Engine. In January 2006, he wrote on his blog, :
13
Who is CodeIgniter For? CodeIgniter is right for you if:
You want a framework with a Small Footprint (‘Refer to the minimal amount of disk space required by an application’). You want a framework that requires nearly zero configuration. You want a framework that does not require you to use the command line. You want a framework that does not require you to adhere to restrictive coding rules. You need clear, thorough documentation.
14
Summary: CodeIgniter is a Php framework created to help web developers build websites and applications faster and more efficiently. Similar to the foundation needed for building a house. CodeIgniter lays down a solid foundation for web developers to build their projects from saving them time and providing a logical structure for their code. CodeIgniter follows a Model-View-Controller (MVC) architecture which keeps developers organized and makes future updates manageable. In addition, it’s loaded with many helper classes that allow developers to quickly code common repetitive tasks with ease. Lightweight and fast, it’s perfect for projects that are hosted on shared servers. CodeIgniter is Thoroughly Documented.
15
Helpers & Libraries (Class References).
Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category. Helpers are not written in an object oriented format in the way that Controllers and Models are, they are simply a collection of procedural functions. Libraries(Class References): CodeIgniter comes with a set of class files that are used throughout many applications—these are known as "Libraries". In short, a library is a file that helps developers write better code, build better applications. A library creates a wrapper for your application's functions which, for example, contains many functions that make the creation of complex SQL queries very easy; it also makes queries much more readable.
16
Prerequisites Prior using CodeIgniter, its required that you must have clear concepts of MVC design Pattern. Wish you already have Apache and Php configured or xampp/wamp like already installed on you machine. Download the coy of CodeIgniter setup version from Extract it and Copy the directory to the root of your local server, without doing anything else. Type in you browser Url
17
CodeIgniter Really Works!
18
Directory Structure The application directory structure is mainly consists of 2 directory, 'system' and 'application'. The 'system' directory is the core and consists of the core framework files. All our codes are going to take place in the 'application directory'. When a new version is released, you can update your existing application just by replacing this system directory with the latest release. We won't never going to work on this folder our selves ever.
19
Directory Structure Here you can clearly see the sub directories of ‘application’ The Concerned Directories are as follow: Cache : This directory will contain all kinds of cached files if you are using so. Config : This directory includes settings/configuration related information like database settings, route information, constants declaration, items to be auto loaded etc. Controller : This directory includes all controller definitions. It can be said as the entry point of application also, every requests triggers a certain method of a controller. Models : This directory will include all model classes used in our application. This section can be said as the 'data access layer' of our application. Views : This directory will include all view template files.
20
Getting Started First we will create a file for controller in controller direcotry. The controller class name must start with Capital letter and must extent parent controller. File name should be in small. Note: class name and file name should be same. Make a function index i.e is automatically loaded when controller is accessed.
21
CodeIgniter URLs By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard "query string" approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach: Note: Query string URLs can be optionally enabled, as described below.
22
CodeIgniter URLs URI Segments:
The segments in the URL, in following with the Model-View-Controller approach, usually represent: By default, the index.php file will be included in your URLs: For Example example.com/index.php/news/article/my_article example.com/class/function/ID The first segment represents the controller class that should be invoked. The second segment represents the class function, or method, that should be called. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.
23
URL Helper Loading this Helper
This helper is loaded using the following code: $this->load->helper('url'); site_url() Returns your site URL, as specified in your config file. The index.php file (or whatever you have set as your site index_page in your config file) will be added to the URL, as will any URI segments you pass to the function, and the url_suffix as set in your config file.
24
site_url() Segments can be optionally passed to the function as a string or an array. Here is a string example: echo site_url("news/local/123"); The above example would return something like: Here is an example of segments passed as an array: $segments = array('news', 'local', '123'); echo site_url($segments);
25
base_url() Returns your site base URL, as specified in your config file. Example: echo base_url(); This function returns the same thing as site_url, without the index_page or url_suffix being appended. Also like site_url, you can supply segments as a string or an array. Here is a string example: echo base_url("blog/post/123"); The above example would return something like: This is useful because unlike site_url(), you can supply a string to a file, such as an image or stylesheet. For example: echo base_url("images/icons/edit.png");This would give you something like:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.