CodeIgniter View usage considerations, codeigniter_php Tutorials

Source: Internet
Author: User
Tags codeigniter

CodeIgniter View usage considerations, CodeIgniter


This article describes the considerations for using the CodeIgniter view. Share to everyone for your reference, as follows:

CI in the view is application/views/template file, template in support of direct use of PHP, so the implementation of the template is not too much to say, said several views of the note:

1. The CI view can load multiple views in the controller, and the page finally combines the contents to output. This is not a good thing if the load is given to the controller to do it, and you need to adjust the controller to adjust the template structure. It can be encapsulated in the controller or given directly to the view to ensure that each action is load only one view file.

2, let the view do what it is good at, do not define HTML directly in the PHP code, this will make the program and view is difficult to maintain, if you want to load HTML, can be returned by load.

3, although there is a universal get_instance method, but in the view also do not go directly to read data or do some other modules of things. The function of a view is to receive data and show it to ensure that people do their best.

4, about whether to use the template version of the problem, the individual tends to use the template. When you use PHP directly, you need to deal with the problem of defining variables and converting them to HTML entities, which can be resolved and provide some more convenient operations. If you want to say the efficiency problem, not here, also mostly not PHP.

More readers interested in CodeIgniter framework related content can view this site topic: "CodeIgniter Introductory Tutorial" and "CI (codeigniter) Framework Advanced Tutorial"

It is hoped that this article is helpful to the PHP program design based on CodeIgniter framework.

Articles you may be interested in:

    • CodeIgniter Custom Controller My_controller usage Analysis
    • Case analysis of controller succession problem in CodeIgniter controllers
    • 2 codeigniter file Batch Upload Controller example
    • CodeIgniter Hook Usage Example detailed
    • Example analysis of database.php usage of codeigniter configuration
    • CodeIgniter Multi-language Implementation method detailed
    • CI (CodeIgniter) Model Usage Example analysis
    • CodeIgniter Read and write separation implementation method detailed
    • CI (CodeIgniter) Simple statistics access to the number of implementation methods
    • Analysis of the business logic example of CodeIgniter controller

http://www.bkjia.com/PHPjc/1094769.html www.bkjia.com true http://www.bkjia.com/PHPjc/1094769.html techarticle CodeIgniter View Usage considerations, CodeIgniter This article describes the usage considerations for CodeIgniter views. Share to everyone for reference, as follows: CI in the view is Application/vi ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.