https://github.com/tonyaxo/yii2-typeform
Typeform.com integration for the Yii framework
https://github.com/tonyaxo/yii2-typeform
extension php typeform yii2
Last synced: 5 months ago
JSON representation
Typeform.com integration for the Yii framework
- Host: GitHub
- URL: https://github.com/tonyaxo/yii2-typeform
- Owner: tonyaxo
- Created: 2018-08-07T07:42:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T16:22:33.000Z (over 7 years ago)
- Last Synced: 2024-04-19T20:21:46.100Z (about 2 years ago)
- Topics: extension, php, typeform, yii2
- Language: PHP
- Homepage: https://packagist.org/packages/tonyaxo/yii2-typeform
- Size: 60.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Typeform.com Extension for Yii 2
[Typeform.com](https://typeform.com) yii2 integration
[](https://travis-ci.org/tonyaxo/yii2-typeform)
[](https://coveralls.io/github/tonyaxo/yii2-typeform?branch=master)
[](https://codeclimate.com/github/tonyaxo/yii2-typeform/maintainability)
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
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 :
```php
// SiteController.php
public function actions()
{
return [
'index' => [
'class' => 'tonyaxo\yii2typeform\AuthAction',
'successCallback' => [$this, 'onAuthSuccess'],
],
];
}
```
```php
// auth-view.php
= \tonyaxo\yii2typeform\widgets\Auth::widget([
'baseAuthUrl' => ['/authorize/index'],
'linkOptions' => [
'class' => 'btn btn-info'
]
]);
```
```php
// 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);
}
}
}
```