An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          





Typeform.com Extension for Yii 2



[Typeform.com](https://typeform.com) yii2 integration

[![Build Status](https://travis-ci.org/tonyaxo/yii2-typeform.svg?branch=master)](https://travis-ci.org/tonyaxo/yii2-typeform)
[![Coverage Status](https://coveralls.io/repos/github/tonyaxo/yii2-typeform/badge.svg?branch=master)](https://coveralls.io/github/tonyaxo/yii2-typeform?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/5c2f1eea56030224f7e1/maintainability)](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);
}
}
}
```