- CodeIgniter 1.7
- David Upton Jose Argudo Blanco
- 297字
- 2021-04-01 13:45:30
Summary
The MVC pattern is a widely used and is a very effective way of organizing a complex website. CI uses it to help you sort your own code, but it is also fairly flexible about how it does so.
The crucial thing is to understand what the different type of files are, and how they relate to each other. Then, you can decide whether to write your code in library or model files, or as helpers or plugins.
We've looked at the CI file structure, and seen how you can, if you want, inspect all the CI code, but (thankfully!) you don't have to. We did tinker with one of the original files—the config
file, which holds critical site information in one place to make it easy for us to upgrade or change later.
We've seen the basic object structure of a controller, and used a simple constructor to get some data from our config
file and put it into a class property. We've dynamically passed information from a new controller we wrote, to a new view. So far, the main thing CI has done for us is to encourage us to use a basic structure as we start to define our site. As we go on, it will become clear just how important that structure is.
Also, we looked at the way in which CI's components pass data and control between themselves. It's useful to understand this when you start to write your code.
Lastly, we looked at CI's own URL helper as a good example of a chunk of code, and we wrote our own rudimentary menu
library class. Now continue to Chapter 4, where we will see how CodeIgniter will help us improve the way we work with databases, don't wait!
- Photoshop數碼攝影后期處理專業技法(第2版)
- 中文版Illustrator 2021完全自學教程
- Photoshop CC 實戰入門
- SolidWorks 2021中文版機械設計從入門到精通
- Django 1.2 E/commerce
- 下一代空間計算:AR與VR創新理論與實踐
- UG NX 完全實例解析
- iPhone JavaScript Cookbook
- AI短視頻生成與剪輯實戰108招:ChatGPT+剪映
- 中文版Photoshop CC平面設計實用教程
- 虛擬現實:沉浸于VR夢境
- 3D打印輕松實踐:從材料應用到三維建模
- 中文版3ds Max 2014-VRay效果圖制作完全自學教程
- Python氣象應用編程
- Plone 3 Theming