小伙儿
为什么我这样不能更新啊
$model=new Site(); if($model->load(Yii::$app->request->post()) && $model->validate()){ $id=1; $site=Site::findOne($id); $site->title='123'; var_dump($site); $site->save(); }
$model = Site::findOne($id); if($model->load(Yii::$app->request->post()) && $model->validate()){ $site->title='123'; $site->save(); }
这样就行了
这个很简单,你按着我的配置来即可。
server { charset utf-8; client_max_body_size 128M; listen 80; server_name local.yii2test.com index index.php index.html index.htm; root /usr/local/nginx/html/yii2test/web; location ~ \.php$ { root /usr/local/nginx/html/yii2test/web; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } #yii框架使用代码 location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php?$args; } location ~ /\.ht { deny all; } }
上面我给你做了一个虚拟域名,你按着我的配置就可以正常访问了。 url 最终是这样的 local.yii2test.com/index
@枕边书 检查一下 ①web/,htaccess 是否存在 ② urlManager 是否配置 ③ apache rewrite 模块开启了吗
咋能默认选中呢
@15807105408 好的 ArrayHelper::map() 此方法会取出数组中的指定列的值 第一个参数是 数据源 第二个参数是 多选框的值 第三个值是 多选框的那个值 举个例子吧
第三个参数
你整明白了吗??