摘要:
php.ini 配置php.ini文件 (以上传500M以下大小的文件为例) 查找以下选项并修改-> file_uploads = On ;打开文件上传选项 upload_max_filesize = 500M ;上传文件上限 如果要上传比较大的文件,仅仅以上两条还不够,必须把服务器缓存上限调大,把 阅读全文
摘要:
使用joinWith进行表关联我们都知道可以用join on来写多个表之间的关联。先看看yii2中joinWit的声明 joinWith( with,with,eagerLoading = true, $joinType = ‘LEFT JOIN’ ) 我们都知道可以用join on来写多个表之间的 阅读全文
摘要:
1、找到相应模块的config文件夹的main-local.php文件注释相关代码,如下: 2、将web下面的两个入口文件改成false index.php index-test.php 阅读全文
摘要:
首先判断日志文件存放的文件夹是否存在, is_dir()函数判断文件夹是否存在。 如果没有则需要创建文件夹, mkdir()函数创建文件夹。 $str = "你需要写入日志文件的东西"; \r\n 换行$file = fopen("./log/123.log", "a+"); //创建文件或打开文件 阅读全文
摘要:
.wxss内容 .wxml内容 .js内容: 最终效果图 阅读全文
摘要:
//修改 public function actionUpdateNews(){ //接收前端json数据 $data = file_get_contents('php://input'); //解析json转成数组 $last_data = json_decode($data,true); //取值 ... 阅读全文
摘要:
\Yii::$app->session->setFlash('success', '添加成功'); return $this->redirect(['user/lists']); 阅读全文
摘要:
原始访问模式为:http://www.month9bk.com/index.php?r=user/lists 那么想要改成全是/的pathinfo模式我们需要进行以下配置: 1、打开config文件夹下的main.php输入以下代码: 此代码的位置为: 2、省略掉index.php,我们需要在入口文 阅读全文
摘要:
Controller Model: view文件夹下的default.php页面: view文件夹下的index.php页面: view文件夹下的lists.php页面: 数据库: 阅读全文
摘要:
public function AddNews(){ $data = Request::instance()->param(); //接收文件 $file = request()->file('img'); //上传 $info = $file->move(ROOT_PATH . 'public' . DS . 's... 阅读全文