cikorka / cakephp-html-tidy-plugin
此软件包最新版本(dev-master)没有可用的许可证信息。
CakePHP HTML Tidy 插件
dev-master
2014-07-27 16:27 UTC
Requires
- php: >=5.3.0
- composer/installers: *
This package is not auto-updated.
Last update: 2024-09-24 07:27:14 UTC
README
HTML Tidy 插件验证并生成整理后的 HTML 输出
安装和设置
-
首先将仓库克隆到您的
app/Plugin/Tidy
目录git clone git@github.com:cikorka/CakePHP-HTML-Tidy-Plugin.git app/Plugin/Tidy cd Plugin/Tidy git submodule init git submodule update cd Vendor/tidy-html5 make -C build/gmake/ sudo make install -C build/gmake/
-
在您的
app/Config/bootstrap.php
文件中加载插件//app/Config/bootstrap.php CakePlugin::load('Tidy');
-
在
app/Controller/AppController.php
文件中添加组件//app/Controller/AppController.php public $components = array('Tidy.Tidy'); // if you want minify HTML code public $components = array('Tidy.Tidy' => array('minify' => true)); // if you want minify HTML code and disable CSS and JS minification public $components = array('Tidy.Tidy' => array('minify' => true, 'js' => false, 'css' => false));
-
在
app/Model/YourModel.php
文件中添加行为//If you want use Tidy and optional Minify fileds content before save into db public $actsAs = array('Tidy.Tidy' => array('field_name' => array('minify' => true)));