chemezov/luya-module-tilda

LUYA模块带Tilda块

安装: 17

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:yii2-extension

1.0.2 2024-09-07 16:48 UTC

This package is auto-updated.

Last update: 2024-09-07 16:49:24 UTC


README

LUYA模块带Tilda块

安装

安装此扩展的首选方式是通过composer

运行以下命令之一

php composer.phar require --prefer-dist chemezov/luya-module-tilda "*"

或添加以下内容到您的composer.json文件的require部分。

"chemezov/luya-module-tilda": "*"

用法

为了将模块添加到您的项目,请进入config的模块部分

return [
    'modules' => [
        // ...
        'tilda' => [
            'class' => 'chemezov\luya\tilda\frontend\Module',
            'useAppViewPath' => true, // When enabled the views will be looked up in the @app/views folder, otherwise the views shipped with the module will be used.
            
            // Required fields
            'cache' => 'tildaCache',
            'publicKey' => 'YOUR_PUBLIC_KEY',
            'secretKey' => 'YOUR_SECRET_KEY',
            
            // Optional fields
            // You can leave this field empty. In this case, all projects will be shown.
            'projectIds' => [
                123, // Project ID
                456, // Project ID
            ],
            // Block wrapper css class
            'defaultBlockCssClasses' => 'b-tilda-content-outer',
            'blockGroup' => \app\blockgroups\ProjectGroup::class,
            
            // The directory for downloading resources (css, js, img). Make sure it has write permissions.
            'assetsPath' => '@webroot/uploads/tilda',
            'assetsUrl' => '/uploads/tilda',
        ],
        // ...
    ],
    'components' => [
        // Do not specify an empty cache, otherwise go beyond the API request limit
        'tildaCache' => [
            'class' => 'yii\caching\FileCache',
        ],
    ],
];

确保您有正确的写入权限到assetsPath,并且assetsUrl可以通过http(s)请求访问。

同时请确保通过cron启动了queue

* * * * * cd /path/to/www && ./luya queue/run -v

当通过webhook重新加载资源时,这是必要的。