Thule - 0.9.6
  • Welcome
  • Introduction
  • - MVC(Model-View-Controller)
    - Architecture of Framework
    - Flow Chart of Application
    - Services In One Server
    - Developing Guide
    - Features
  • Installation
  • Getting Started
  • - Direct Access HTTP
    - Router Access HTTP
    - Router Direct Access HTTP
    - Reserved Function
    - Convention
    - Bootstrap
    - Pack Javascript , CSS
  • Basic Modules
  • - Model
    - View
    - Controller
  • Libraries
  • - Router
    - Config
    - Response
    - Request
    - Database
    - Query
    - Cache
    - Debug
    - Log
    - Unit Test
    - Registry
    - Profile
  • Helper
  • - Auth
    - Calendar
    - Date
    - Error page
    - Email
    - Form
    - GeoIP
    - Google
    - Html Element
    - Html
    - Http
    - I18n
    - Image
    - Json
    - Jquery
    - Login
    - Layout
    - Locale
    - PHP to Javascript
    - Paging
    - Payflow
    - Soap
    - Text
    - Table
    - Uri
    - Upload
    - Validation
  • Plugins
  • - Smarty Template Engine
  • History
  • Home > Pack CSS,Javascript

    This functionality provides the minimized requests from client and even help to boost up the loading time .

    Usually this function will be called in header of view to call css and javascript which can be called by request of different pages.

    css,javascript files location should be defined before using pack that you can check it out on config .

    Need Html helper

    First of all, if you want to call this pack-css, should have "Html" helper can support a lots of stuff on front-end side.

    $FE->loadHelper("html");

    How to call CSS pack

    Packing-css will keep the file list as buffer before flush like following.

    $FE->Html->cssPack("style");
    $FE->Html->cssPack("style1");
    $FE->Html->cssPack("style2");

    And the first-calling css will be flushed first and last will be last therefore you need to consider of order sometimes makes you be bothered with broken css.

    Following line will generate the pack css link.(don't forget the "echo" )

    echo $FE->Html->cssPackLink();

    How to call Javascript pack

    This pack will be doing as similar as css job.

    $FE->Html->javascriptPack("js1");
    $FE->Html->javascriptPack("js2");
    $FE->Html->javascriptPack("js3");

    Generate the javacripts with packed

    echo $FE->Html->javascriptPackLink();