src/modules/user/widgets/RbacWidget.php
private function addRole ()
		{
			$roleForm = new RoleForm();
			if (Yii::$app->request->getIsPost())
			{
				$roleForm->setAttributes(Yii::$app->request->post('RoleForm'));
				if ($roleForm->method == 'rbac-add')
					$roleForm->setScenario(RoleForm::SCENARIO_ADD);

				if ($roleForm->validate())
				{
					$this->saveRole($roleForm);
					$url = Yii::$app->request->referrer . '#roles';
					Yii::$app->response->redirect($url);
				}
			}

			return $roleForm;
		}
private function addRole ()
		{
			$roleForm = new RoleForm();
			if (Yii::$app->request->getIsPost())
			{
				$roleForm->setAttributes(Yii::$app->request->post('RoleForm'));
				if ($roleForm->method == 'rbac-add')
					$roleForm->setScenario(RoleForm::SCENARIO_ADD);

				if ($roleForm->validate())
				{
					$this->saveRole($roleForm);
					$url = Yii::$app->request->referrer . '#roles';
					Yii::$app->response->redirect($url);
				}
			}

			return $roleForm;
		}
private function addRole ( ) { $ roleForm = new RoleForm ( ) ; if ( Yii :: $ app -> request -> getIsPost ( ) ) { $ roleForm -> setAttributes ( Yii :: $ app -> request -> post ( 'RoleForm' ) ) ; if ( $ roleForm -> method == 'rbac-add' ) $ roleForm -> setScenario ( RoleForm :: SCENARIO_ADD ) ; if ( $ roleForm -> validate ( ) ) { $ this -> saveRole ( $ roleForm ) ; $ url = Yii :: $ app -> request -> referrer . '#roles' ; Yii :: $ app -> response -> redirect ( $ url ) ; } } return $ roleForm ; }
Add new role
Add new role