tonyaxo / yii2-typeform
Typeform.com integration for the Yii framework
Installs: 730
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2-authclient: ~2.1.0
README
Typeform.com Extension for Yii 2
Typeform.com yii2 integration
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist tonyaxo/yii2-typeform "*"
or add
"tonyaxo/yii2-typeform": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
// SiteController.php public function actions() { return [ 'index' => [ 'class' => 'tonyaxo\yii2typeform\AuthAction', 'successCallback' => [$this, 'onAuthSuccess'], ], ]; }
// auth-view.php <?= \tonyaxo\yii2typeform\widgets\Auth::widget([ 'baseAuthUrl' => ['/authorize/index'], 'linkOptions' => [ 'class' => 'btn btn-info' ] ]);
// user.php class MyTypeForm extends EmbeddedTypeForm { const BASE_FORM_URL = 'https://myaccount.typeform.com/to/'; public $type = EmbeddedTypeForm::TYPE_POPUP; /** * @param mixed $id */ public function setFormId(?string $id): void { if ($id !== null) { $this->setUrl(self::BASE_FORM_URL . $id); } } }