Innovative Computer Solutions,
Development & Technical Support

07975 997026 • enquiries[delete-me]@[delete-me]harpanet.com

User Tools

Site Tools


programming:php:codeigniter:hats:index

hArpanet Template System (hATS) for CodeIgniter

v2.1.1

hArpanet's Template System (hATS) is a Helper for the CodeIgniter framework and provides a structured, flexible approach to creating layout templates for any CI website. As well as reducing the PHP code necessary within standard CI View files, hATS allows easy changes to the theme of a project to allow seasonal visual differences to be applied easily without affecting core functionality.

hATS v2.1.1

Version 2.x is a significant update from the previous v1.7 and cannot simply be copied over-the-top-of an existing install!

CodeIgniter v3.x

Although hATS will work as expected with CI 3.x (currently in -dev status), CI 3.x now requires Controllers to use Uppercase first characters for their filenames.

If you wish to use hATS with CI 3.x you will need to rename the files to match the new requirements.

DOWNLOAD hATS

hATS is available through GitHub and can be downloaded using the Download ZIP button at the bottom-right options menu.

See: https://github.com/hArpanet/CodeIgniter_hAts

INSTALLING hATS

Installation of hATS is a simple as copying the hATS folders to your CI website.

NOTE: hATS v2.1.1 has changed most of its folder and file names!

The downloaded .zip file contains two folders. These two folders should be copied into your existing CodeIgniter website.

  • Copy the application folder from hATS into the folder containing your own application folder. (This is the root of your website in a clean CI install.)
    • At the very least you need to copy the hats_helper.php file from the /application/helpers folder into your own helpers folder.
  • Copy the hAts folder into the root of your website. (In a clean CI install, this is the same place as the application folder.)

The hATS zip file contains the following files:

NEW hATS EXAMPLE CONTROLLER

 The hATS example page

hATS v2.0+ introduced a new example controller. It is located in application/controllers and named hats_example.php

To run the example controller, enter your website URL into your browser followed by /hats_example ( eg. http://myserver.net/hats_example )

The code in hats_example.php is fully commented for you to see exactly how to use hATS theme and parts within your own website. For more information, see the hats_example page.

  • The hats_example.php file can safely be deleted and is of no use in a production environment, it is provided solely as a learning aid.

NEW hATS TESTING CONTROLLER

hATS v2.1.1 introduces a new testing controller (mainly so I can see if I break anything). It is located in application/controllers and named hats_tests.php

To run the testing controller, enter your website URL into your browser followed by /hats_tests ( eg. http://myserver.net/hats_tests )

  • The hats_tests.php file can safely be deleted and is of no use in a production environment, but as a learning tool it is fully commented and you may be able to find some usage examples in there.

READY TO ROLL

Once you have installed hATS and confirmed that the example page is working, you are ready to begin setting up your own theme and parts.

hATS FUNCTION REFERENCE

All available functions are documented on the reference page.

Comments



J J R T Y F D​ X᠎ I V Q J
programming/php/codeigniter/hats/index.txt · Last modified: 14/07/2014 20:41 by harpanet