1. Go to this page and download the library: Download daccess1/yii2-tilda-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
daccess1 / yii2-tilda-api example snippets
'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' => *****
],
],
if ($model->load(Yii::$app->request->post()) && $model->save()) {
//insert this line
Yii::$app->tilda->getPage($model->your_field_id);
return $this->redirect(['view', 'id' => $model->id]);
}