SoFunction
Updated on 2025-03-10

Summary of common methods of CI framework

This article describes common methods of CI frameworks. Share it for your reference, as follows:

1. Load css and js files in the template file:

<link rel="stylesheet" type="text/css" href="<?=base_url('css/')?>" />
<link rel="stylesheet" type="text/css" href="<?=base_url('js/kindeditor/themes/default/')?>" />
<link rel="shortcut icon" href="<?=base_url('images/')?>" />
<script type="text/javascript" src="<?=base_url('js/')?>"></script>
<script type="text/javascript" src="<?=base_url('js/')?>"></script>
<script type="text/javascript" src="<?=base_url('js/?skin=default')?>"></script>
<script type="text/javascript" src="<?=base_url('js/datejs/')?>"></script>
<script type="text/javascript" charset="utf-8" src="<?=base_url('js/kindeditor/')?>"></script>

2. Load the sub-template file in the template file:

<?php $this->load->view('admin_head.php');?>
<?php $this->load->view('admin_foot.php');?>

3. Function call data can be used directly in the template file

4. Calling CI objects in the model

$CI =& get_instance();
$CI->load->model('Data_model');

For more information about CodeIgniter, readers who are interested in view the topic of this site:Codeigniter Introductory Tutorial》、《Advanced tutorial on CI (CodeIgniter) framework》、《Summary of excellent development framework for php》、《ThinkPHP Introduction Tutorial》、《Summary of common methods of ThinkPHP》、《Zend FrameWork Framework Introduction Tutorial》、《PHP object-oriented programming tutorial》、《PHP+mysql database operation tutorial"and"Summary of common database operation techniques for php

I hope that the description in this article will be helpful to everyone's PHP programming based on the CodeIgniter framework.