In Yii 2.0, close CSRF check for special action

/**
 * @inheritdoc
 */
public function beforeAction($action)
{            
    if ($action->id == 'yiilib-method') {
        $this->enableCsrfValidation = false;
    }

    return parent::beforeAction($action);
}