PHP code example of daxslab / yii2-cas-client
1. Go to this page and download the library: Download daxslab/yii2-cas-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daxslab / yii2-cas-client example snippets
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->goHome();
}
return $this->redirect(['/cas/auth/login']);
}
public function actionLogout()
{
if (Yii::$app->user->isGuest) {
return $this->redirect(['/cas/auth/logout']);
}
return $this->goHome();
}