Location:Home >> News >> 开发

CI框架常用方法小结

CI框架常用方法小结

本文实例讲述了CI框架常用方法。分享给大家供大家参考,具体如下:

一、在模板文件中加载css、js文件:

?
1
2
3
4
5
6
7
8
<link rel="stylesheet"type="text/css"href="<?=base_url('css/style.css')?>"/>
<link rel="stylesheet"type="text/css"href="<?=base_url('js/kindeditor/themes/default/default.css')?>"/>
<link rel="shortcut icon"href="<?=base_url('images/favicon.ico')?>"/>
[removed][removed]
[removed][removed]
[removed][removed]
[removed][removed]
[removed][removed]

二、在模板文件中加载子模板文件:

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

三、模板文件中可以直接使用函数调用数据

四、模型中调用CI对象

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

更多关于CodeIgniter相关内容感兴趣的读者可查看本站专题:《codeigniter入门教程》、《CI(CodeIgniter)框架进阶教程》、《php优秀开发框架总结》、《ThinkPHP入门教程》、《ThinkPHP常用方法总结》、《Zend FrameWork框架入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总

希望本文所述对大家基于CodeIgniter框架的PHP程序设计有所帮助。

Special Reminder & Disclaimer:
The information of this website comes from the Internet. The content (pictures, videos and words) released by this website is mainly the content submitted by users and reproduced by users. The purpose is to convey more information, which does not mean that this website agrees with its views. The originality, statements, and content of this article have not been verified by this website. We do not guarantee or promise the authenticity, completeness, or timeliness of this article or all or part of its content or text. Please verify the relevant content on your own. This website does not assume direct or joint liability for infringement of such works. If any content on this website infringes on your rights, please contact us promptly (email: nssa@soufind.com )This site will complete the processing within 72 hours. The original content on this website cannot be reproduced without permission, or the source must be indicated when reprinting: nssa.vip Aerospace Alliance

Author: 本站网友

Recommended for you

Post comments

admin

Contact Us

Contact Us

Online consultation: QQ交谈

Email: service#soufind.com

follow us on WeChat
Scan and follow us on WeChat

Scan and follow us on WeChat