Codeigniter PDF
Codeigniter PDF
You have worked with PHP, for small sites this works very well. HTML files
can be easily extended with dynamic content from the database, form
processing, etc.
When sites grow, you might have realized that across multiple pages lots of
code repetition occurs. This is a problem when you need to change certain
parts of a page, that affects many or all pages.
Enterprise class (big) web applications need structure, one HTML file per
page with PHP code is not optimal => things get confusing, hard to work in
teams, etc.
Most common for Web application development are frameworks that are
based on the Model-View-Controller design pattern
Controller: Handles all incoming HTTP requests, passes data to the views
There are countless similar PHP frameworks, the most popular ones being
CakePHP and symfony. Ruby on Rails is famous in the Ruby world.
CodeIgniter is very light weight. It doesnt force any convention but provides
many commonly required features through a set of build in libraries.
CodeIgniter has a low learning curve and is one of the best documented PHP
web frameworks.
Custom Routing
1. The index.php serves as the front controller, initializing the base resources needed
to run CodeIgniter.
2. The Router examines the HTTP request to determine what should be done with it.
3. If a cache file exists, it is sent directly to the browser, bypassing the normal
system execution.
4. Security. Before the application controller is loaded, the HTTP request and any
user submitted data is filtered for security.
5. The Controller loads the model, core libraries, plugins, helpers, and any other
resources needed to process the specific request.
6. 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.
Dienstag, 4. Mai 2010
Getting Started
/index.php/controller/action
/application/config/routes.php
$this->load->view(blog_view);
Using a Helper
These are small PHP functions <?php echo anchor('blog/comments', 'Click Here');?>
$this->load->helper(name);
Inserting Data
Method Chaining
$this->output->enable_profiler(TRUE);