Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b0351ba4
Commit
b0351ba4
authored
Dec 29, 2013
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs improved
parent
5c2064bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
controller.md
docs/guide/controller.md
+19
-1
No files found.
docs/guide/controller.md
View file @
b0351ba4
...
@@ -39,7 +39,7 @@ The output of an action is what the method returns. The return value will be han
...
@@ -39,7 +39,7 @@ The output of an action is what the method returns. The return value will be han
component which can convert the output to differnet formats such as JSON for example. The default behavior
component which can convert the output to differnet formats such as JSON for example. The default behavior
is to output the value unchanged though.
is to output the value unchanged though.
You also can disable CSRF validation per controller, by setting its property:
You also can disable CSRF validation per controller
and/or action
, by setting its property:
```
php
```
php
namespace
app\controllers
;
namespace
app\controllers
;
...
@@ -59,6 +59,24 @@ class SiteController extends Controller
...
@@ -59,6 +59,24 @@ class SiteController extends Controller
}
}
```
```
To disable CSRF validation per custom actions you can do:
```
php
namespace
app\controllers
;
use
yii\web\Controller
;
class
SiteController
extends
Controller
{
public
function
beforeAction
(
$action
)
{
// ...set `$this->enableCsrfValidation` here based on some conditions...
// call parent method that will check CSRF if such property is true.
return
parent
::
beforeAction
(
$action
);
}
}
```
Routes
Routes
------
------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment