You are previewing Programming with CodeIgniter MVC.
O'Reilly logo
Programming with CodeIgniter MVC

Book Description

Build feature-rich web applications using the CodeIgniter MVC framework

  • Build feature-rich web applications using the CodeIgniter MVC framework

  • Master the concepts of maximum simplicity, separation, flexibility,reusability, and performance efficiency

  • A guick guide to programming using the CodeIgniter MVC framework

In Detail

The CodeIgniter Model-View-Controller framework provides genius simplicity, flexibility, and efficient resource usage, boosting performance and reusability.

"Programming with CodeIgniter MVC" reviews the unique features of CodeIgniter using simple, easy-to-follow, and practical examples.

Programming with CodeIgniter MVC provides a simple step-by-step guide to efficiently utilizingthe CodeIgniter MVC framework for developing web applications. This book is packed with engaging examples to understand the usage of controllers, libraries, and (Codeigniter) CI Models. This book commences with a quick discussion of the CodeIgniter Integration with external plugins such as Flickr API, Google Maps and more will be reviewed with clear usage examples. It will then cover CI naming convention rules, mandatory and optional configurations, and usage within a CI project. It will also cover user defined configurations.

By the end of this book, you will not only understand user-defined libraries in a CI framework, but also their services, role, usage, and scope with the help of an example-based approach. The book also covers helpers, models, and views, as well as their usage.

Using this book, youwill soonbe able to develop feature-rich web applications using the CodeIgniter MVC framework. "Programming with CodeIgniter MVC" is a one-stop solution to developing solutions with CodeIgniter MVC.

Table of Contents

  1. Programming with CodeIgniter MVC
    1. Table of Contents
    2. Programming with CodeIgniter MVC
    3. Credits
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Started
      1. Installing CodeIgniter
      2. Folders overview
        1. Mandatory components
      3. Example 1 – hello world
        1. The controller file
        2. The view file
      4. Example 2 – passing the complex parameters to a view
        1. The controller file
        2. The view file
      5. Example 3 – the database query by a model rendering results to a view
        1. The controller file
        2. The model file
        3. The view file
      6. Example 4 – interactive contact forms
        1. The controller file
        2. The view file
      7. Summary
    9. 2. Configurations and Naming Conventions
      1. CI directory tree
        1. config.php
        2. database.php
        3. routes.php
      2. Defining and using your own configurations
      3. Understanding and using CI naming conventions
        1. The main resource type naming rules
          1. Controller definition naming rules
          2. Example 1 – calling the controller index method
          3. Example 2 – calling the controller and calc method without arguments
          4. Example 3 – calling the controller and calc method with arguments
          5. Example 4 – calling AJAX to an AJAX-oriented method with arguments
          6. Loading libraries, models, and helpers
      4. Miscellaneous naming conventions
      5. Summary
    10. 3. Controller Usage and Scope
      1. Scope of the CI controller
      2. The user-defined CI controller
        1. Extending the CI controller
      3. CI controller use cases
      4. Example 1 – default homepage controller
        1. The controller file
        2. The view file
        3. The configuration file
      5. Example 2 – sending e-mails with attachments
        1. The controller file
      6. Example 3 – admin and regular user log in
        1. The controller file
        2. The model file
        3. The database file to upload for this example
        4. The login_view view file
        5. The login_in_view view file
      7. Summary
    11. 4. Libraries
      1. The CI libraries' scope and usage
        1. Available CI libraries
      2. Example 1 – using the built-in libraries
        1. The controller file
        2. The view file
      3. Example 2 – using third-party libraries such as the Google Maps CI library wrapper
        1. The controller file
        2. The view file
      4. Example 3 – building a library such as the Flickr API wrapper
        1. The flickr_wrapper.php library file
        2. The flickr_recent.php controller file
        3. The flickr_recent_view.php view file
      5. Example 4 – the LinkedIn API wrapper
        1. Requirements
        2. Authentication flowchart
        3. The linkedin_handler.php library file
        4. The linkedinfo.php controller file
        5. The linkedin-me.php view file
      6. Summary
    12. 5. Helpers
      1. CI helpers' scope and usage
        1. Available CI helpers
          1. CI system helpers
          2. CI third-party helpers
      2. Example 1 – using built-in helpers
        1. The controller file
        2. The view file
      3. Example 2 – SSL helper
        1. The helper file
        2. The controller file
        3. The view file
      4. Example 3 – building your own helper
        1. The helper file
        2. The controller file
        3. The view file
      5. Summary
    13. 6. Models
      1. Scope of the CI model
        1. The model resource path
        2. Loading a model
        3. Using model methods
        4. Connecting to a database
        5. Business logic
      2. Object Relational Mapping (ORM)
        1. ORM simple operations example
      3. Example 1 – a CRUD example
        1. The controller file
        2. The model file
        3. The view file
      4. Example 2 – a business logic example
        1. The controller file
        2. The model file
        3. The view file
      5. Example 3 – retrieving data from Facebook
        1. The controller file
        2. The model file
        3. The view file
      6. Summary
    14. 7. Views
      1. Scope of the CI view
        1. The CI view resources path
        2. The rendering flow
        3. View flexibility
      2. Accessing the libraries/helpers
        1. Forms
        2. AJAX
        3. Parser configuration issues
        4. Integrating jQuery or other client-side libraries
        5. Plugins for rendering view
      3. Example 1 – HTML5 location powered by Google Maps
        1. The controller file
        2. The view file
      4. Example 2 – user feedback powered by AJAX and the jQuery UI
        1. The ajax_handler.php controller file
        2. The users_model.php model file
        3. The logged_in_view.php view file
      5. Summary
    15. A. Appendix
    16. Index