php原生转框架,转 php 框架 Php 依赖框架

php 开发依赖框架

为了掌握这个方法,我们需要学习如下框架

https://codeigniter.org.cn/user_guide/installation/installing_composer.html#id4

https://www.ibm.com/developerworks/cn/web/wa-codeigniter/

https://www.w3cschool.cn/codeIgniter3/pbqxlozt.html

codeigniter 社区:(这个社区还是可以到额,)

https://codeigniter.org.cn/forums/forum-code-1.html

http://www.dba.cn/book/codeigniter/

######samlpe 1

感谢yangzie1192,

--applicationcoreMY_Controller.php

--定义着 如下内容

--abstract class Front_Controller extends CI_Controller

Codeigniter所有的控制器都必须继承CI_Controller类,

但CI_Controller类位于system目录下,不太方便修改。

为方便做一些公用的处理,通常情况下我们会在application/core下创建MY_Controller,

用来继承CI_Controller,从而项目中所有的控制器继承MY_Controller,而不是CI_Controller;

abstract class MY_Controller extends CI_Controller

{

function __construct()

{

parent::__construct();

$this->load->config('wechatconf'); //自定义配置文件

$this->load->database(); //初始化数据库链接

$this->load->library('session'); //初始化session类

$this->load->helper('url'); //加载URL辅助类

$this->load->helper('form'); //加载form辅助类

$this->load->helper('common'); //公共辅助函数库

//关闭浏览器,PHP进程依然执行

ignore_user_abort(true);

set_time_limit(0);

//设置时区

date_default_timezone_set('PRC');//'Asia/Shanghai' 亚洲/上海 ;

header("Content-type: text/html; charset=utf-8");

}

}

以上代码可以大致说明该类的作用;

————————————————

版权声明:本文为CSDN博主「yangzie1192」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/u014471522/java/article/details/32726919

##############sample 2

C:wamp64wwwmyappapplicationlibraries

感谢 ed Jul 19 '11 at 19:46Max Benin

Make sure to autoload model on application/config/autoload.php at line 56.

$autoload['libraries']=array('database');

##############sample3

https://codeigniter.org.cn/forums/thread-19043-1-1.html

applicationlibraries 配置 Layout.php   Layoutfull.php

####sample 4

You can try this:

First Load the URL Helper with:

$this->load->helper('url'); or set the following value in application/config/autoload.php

$autoload['helper'] = array('url');

Then you can show the site url with:

Note: Results depends on values stored in application/config/config.php

######sample 5

感谢kissmumu

我们的template或是称之为layout的文件(layout_main.php)大致如下(简化了,实际应用中会有很多网站固定元素的):

viewslayout_main and layout_main_full html

https://codeigniter.org.cn/forums/thread-1176-1-1.html

#####sample 6

感谢 Ali Raza

./application/config/config.php

Encryption Key

---------------------

If you use the Encryption class or the Session class you MUST set an encryption key. See the user guide for info.

$config['encryption_key']='02527-269-2503946-70386-34730519';

#####sample 7

感谢小亚亚啊

如何使用bootstrap

1.在CI3根目录下放js、css、img等文件夹

在view下文件的head区:

" />

以后涉及到链接样式的地方就直接:

2。感谢 ChristineZ

https://www.cnblogs.com/zsnzsn/p/8416215.html删除appliaction/.htaccess 文件 ,既可以访问 bootstrap 文件了

###########sample 8

感谢 file:///C:/wamp64/www/myapp/user_guide/libraries/loader.html

######

##网页端解码比较麻烦。php 决定了 存储所有数据都在数据库端,包括网页端 所有的输出和显示。

##如果你需要学习一个成品, 一条语句 往往嵌套了后台 若干张表,你不知道问题出在哪个表 ,无法学习一个简单的模块

##唯一的建议 是函数名字 一定要简单易识别

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值