搜尋
首頁php框架YIIyii2專案Action報403錯誤怎麼辦
yii2專案Action報403錯誤怎麼辦Jul 20, 2020 am 10:00 AM
actionyii2

yii2專案報403錯誤的解決方法:先開啟對應的程式碼檔案;然後在ACF驗證裡面修改寫法;最後將單字和單字之間用「-」符號分割即可解決403錯誤。

yii2專案Action報403錯誤怎麼辦

yii2.0 Action 報403 錯誤[ 2.0 版本]

當你在編輯一個action 的時候,也許是一個單字,也許是拼接的單字,像是actionGet(); actionSpecialCallback();

推薦:《yii教學

當你遇見actionSpecialCallback() ; 這種方法的時候,你在ACF 驗證裡面的寫法是單字和單字之間用- 分割就不會出現403 錯誤了,如下所示:

use yii\filters\AccessControl;
class SiteController extends Controller
{
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => ['special-callback'],
                'rules' => [
                    [
                        'actions' => ['special-callback'],
                        'allow' => true,
                        'matchCallback' => function ($rule, $action) {
                            return date('d-m') === '31-10';
                        }
                    ],
                ],
            ],
        ];
    }
    // Match callback called! This page can be accessed only each October 31st
    public function actionSpecialCallback()
    {
        return $this->render('happy-halloween');
    }
}

以上是yii2專案Action報403錯誤怎麼辦的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
DJI Osmo Action 5 Pro: Release date mooted as retailer reveals launch pricing that could undercut GoPro Hero 13 BlackDJI Osmo Action 5 Pro: Release date mooted as retailer reveals launch pricing that could undercut GoPro Hero 13 BlackSep 04, 2024 am 06:51 AM

DJI has not confirmed any plans to introduce a new action camera yet. Instead, it seems that GoPro will get ahead of its rival this year, having teased that it will introduce two new action cameras on September 4. For context, these are expected to a

yii2 怎么去掉jqueryyii2 怎么去掉jqueryFeb 17, 2023 am 09:55 AM

yii2去掉jquery的方法:1、编辑AppAsset.php文件,注释掉变量$depends里的“yii\web\YiiAsset”值;2、编辑main.php文件,在字段“components”下面添加配置为“'yii\web\JqueryAsset' => ['js' => [],'sourcePath' => null,],”即可去掉jquery脚本。

New DJI Osmo action camera spotted before probable summer 2024 launch to rival recent GoPro and Insta360 releasesNew DJI Osmo action camera spotted before probable summer 2024 launch to rival recent GoPro and Insta360 releasesJul 01, 2024 am 09:49 AM

Almost a year has passed since DJI released the Osmo Action 4 (curr. $299 on Amazon). Since then, the company has focused on its other divisions, including new RS camera gimbals. On top of that, it has introduced various drones as well like the Avata

精选几道CTF习题,带你学习yii2框架!精选几道CTF习题,带你学习yii2框架!Feb 23, 2022 am 10:33 AM

本篇文章带大家了解yii2框架,分享几道CTF习题,通过它们来学习yii2框架,希望对大家有所帮助。

Insta360 Go 3S: New pocketable 4K action camera released weighing just 39 g with Apple Find My supportInsta360 Go 3S: New pocketable 4K action camera released weighing just 39 g with Apple Find My supportJun 14, 2024 pm 06:05 PM

Insta360hasreleasedanewactioncamera,itssecondoftheyearaftertheInsta360X4(curr.$499.99onAmazon).Asexpected,thecompanyhasintroducedtheGo3S,anupgradedthatGo3thatadds4Kvideorecordingcapabilities.Specifically,whileInst

Vuex状态管理之Action异步操作详解Vuex状态管理之Action异步操作详解Aug 10, 2022 pm 03:29 PM

某些情况,我们希望在Vuex中进行一些异步操作, 比如网络请求, 必然是异步的,这个时候怎么处理呢?下面就给大家介绍Vuex状态管理之Action异步操作,希望对需要的朋友有所帮助!

怎么使用YII2框架安装Redis扩展怎么使用YII2框架安装Redis扩展May 26, 2023 pm 06:41 PM

1.需要下载yii2-redis的master分支windows版本composer下载2.解压复制到vendor/yiisoft下面3.yiisoft下面extensions.php里面增加'yiisoft/yii2-redis'=>array('name'=>'yiisoft/yii2-redis','version'=>'2.0.

GoPro releases new Hero 13 Black action camera with new lens mods alongside curious GoPro HeroGoPro releases new Hero 13 Black action camera with new lens mods alongside curious GoPro HeroSep 05, 2024 am 06:45 AM

GoPro has now introduced its annual action camera refresh. Unlike in recent years, the company has decided to release two models. However, it has not returned to 360-degree cameras, despite teasing this time last year that it would replace the Max wi

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版