![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php学习笔记
请不要让我脱发
360菜鸟FE一枚
展开
-
PHP中对public,static,private,protected的理解
private protected public本类内 true true true子类内 false true true类外部 false false truestatic:定义静态属性和方法 通过self::method或者self::var进行调用,在子类中通过parent::原创 2017-07-05 11:28:30 · 2455 阅读 · 1 评论 -
Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight respon
今天在写一个项目的时候出现了一个很莫名其妙的问题,除了post请求其他的请求都可以调通,在使用post的时候,总是报以下错误。因为在请求的header中出现以下问题:后端是我用php撸的部署在nginx上, 错误原因应该是php中post请求的cors机制。。解决方法如下:第一种: 在php代码中加上Yii::$app->getResponse()->headers->set(‘Access-C原创 2017-12-07 10:21:55 · 38665 阅读 · 2 评论