定制 elabx/processwire-alpinejs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elabx/processwire-alpinejs

Composer 安装命令:

composer require elabx/processwire-alpinejs

包简介

Add AlpineJS to ProcessWire admin

关键字:

README 文档

README

Adds alpinejs as a module in the ProcessWire admin.

Integrates Alpine.js locally into the ProcessWire Admin interface.

Features

  • Local Hosting: Downloads Alpine.js core and plugins from unpkg.com to your server for local serving.
  • Admin Integration: Automatically loads Alpine.js in the ProcessWire Admin backend.
  • Plugin Support: Easily enable official Alpine.js plugins (Mask, Intersect, Persist, Focus, Collapse, Morph, History).
  • 1-Click Updates: Check for updates and download the latest version directly from the module configuration.

Requirements

  • ProcessWire 3.0 or newer
  • PHP 7.3 or newer

Installation

Install the module from the modules directory or with Composer:

composer require elabx/processwire-alpinejs

Setup

After installing, you need to configure where Alpine.js is loaded from. There are two options:

Option 1: Download via module settings

Go to Modules > Configure > AlpineJS and click the download button. This fetches the latest Alpine.js core and plugins from unpkg.com and stores them locally in the module's js/ directory.

Option 2: Custom file path

If you prefer to manage the Alpine.js file yourself (e.g. to version-control it), set the Custom Alpine.js file path in the module settings. This should be a path relative to the site root, such as site/templates/scripts/alpine.js. When set, this file is used instead of the downloaded version.

You can also override the core script URL programmatically via hook:

$wire->addHookAfter('AlpineJS::getCoreScriptUrl', function($event) {
    $event->return = '/site/templates/scripts/alpine.js';
});

Usage

Admin Backend

Alpine.js is automatically loaded in the ProcessWire admin. You can use it in your custom admin pages, hooks, or Inputfields.

Frontend

To use Alpine.js in your frontend templates, output the scripts manually:

// Load only Alpine Core
echo $modules->get('AlpineJS')->renderScripts();

// Load Alpine Core + Plugins
echo $modules->get('AlpineJS')->renderScripts(['intersect', 'persist']);

统计信息

  • 总下载量: 1.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固