PHPackages                             daccess1/yii2-tilda-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. daccess1/yii2-tilda-api

ActiveYii2-extension[API Development](/categories/api)

daccess1/yii2-tilda-api
=======================

Tilda platform api extension for Yii2

1.2.0(6y ago)0732MITPHP

Since May 12Pushed 6y agoCompare

[ Source](https://github.com/daccess1/yii2-tilda-api)[ Packagist](https://packagist.org/packages/daccess1/yii2-tilda-api)[ RSS](/packages/daccess1-yii2-tilda-api/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (16)Used By (0)

Yii2 Tilda Api
==============

[](#yii2-tilda-api)

Read in other languages: [Русский](https://github.com/daccess1/yii2-tilda-api/blob/master/README.ru.md)

Tilda platform api extension for Yii2

This is a fork of [nariman924/yii2-tilda-api](https://github.com/nariman924/yii2-tilda-api) project, which seems to be abandoned for a couple of years.

Installation
============

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require daccess1/yii2-tilda-api

```

or add

```
"daccess1/yii2-tilda-api": "^1.0"

```

to the require section of your `composer.json` file.

Once the extension is installed, include this in components section of your `common/config/main-local.php` file:

```
    'components' => [
         ...
         'tilda' => [
             'class' => 'daccess1\tilda\TildaApi',
             'publicKey' => '**********',
             'secretKey' => '**********',
             // Change URL if needed. Don't forget to set protocol
             // to https:// when moving to production.
             'assetsUrl' => 'http://'.$_SERVER['HTTP_HOST'].'/tilda',
             // Change 'public_html' to the frontend web directory if needed
             // (default Yii2 directory is 'frontend/web')
            'assetsPath' => dirname(dirname(__DIR__)).'/public_html/tilda',
             //Optional default project ID (integer)
             //'defaultProjectID' => *****
         ],
     ],
```

Apply required migrations

```
php yii migrate --migrationPath=@vendor/daccess1/yii2-tilda-api/migrations

```

Usage
=====

[](#usage)

The two most common goals of this extension are saving Tilda pages to lhe local database and then showing them to the end user. The following instruction shows some common usage patterns for this extension. All examples assume that you are using Gii-generated CRUD.

Saving pages
------------

[](#saving-pages)

To render the list of the pages from Tilda project, you can use the `renderPageSelect` method. It's designed to be used with the ActiveForm generated with Gii, and requires no additional setup by default. Simply replace your form field that stores Tilda page id with this code:

```
