Yii Framework Forum: What is function behaviors in SiteController.php ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

What is function behaviors in SiteController.php ? Rate Topic: -----

#1 User is offline   parthcreation 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 16-October 16

Posted 17 October 2016 - 12:02 AM

I am starting up with yii2
I dont have any idea of previous version of YII
But I have good knowledge of codeigniter and have been working in codeigniter from last 3 years.

MY Question is as below :

There is a function name behaviors() in SiteController.php file.
It has below code. I want to knwow what does it do?

public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'only' => ['logout'],
'rules' => [
[
'actions' => ['logout'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['post'],
],
],
];
}
0

#2 User is offline   wgetus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 07-May 14

Posted 17 October 2016 - 12:38 AM

http://www.yiiframew...-behaviors.html
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users