Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Minify Html in Cakephp 2.x

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 679
    Comment on it

     

    Minify Html in Cakephp 2.x

     

    Hello friends welcome to findnerd. Today I am going to tell you how to minify html in cakephp 2. I am going to use minify html plugin which will remove unnecessary white spaces from html. This plugin is also available on github and you can download it easily and use it. Basic requirements for installing this plugin:

    • PHP 5.2 or above 
    • Cakephp 2.x

     

    Let's start installing this plugin, follow the steps given below:

     

    Step 1: Download Minify Plugin

     

     

    Step 2: Create Plugin

     

    • Extract the zip archive when the downloading is completed. 
    • Rename folder "cakephp-minifyhtml-plugin-master" to "MinifyHtml". 
    • Copy "MinifyHtml" folder to cakephp2_project/app/Plugin/

     

    Step 3: Load Plugin

     

    • Edit bootstrap.php and write the following code. This will load the plugin "MinifyHtml"

     

    CakePlugin::load('MinifyHtml');

     

    • Go to app/Controller/AppController.php and add the following line:

     

    public $helpers = array("MinifyHtml.MinifyHtml");

     

    Now load the project on the browser and by pressing Ctrl + U you can see that plugin has minified all the html pages of the project.

     

    Thanks for reading the blog.

     

    Minify Html in Cakephp 2.x

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: