Ocular is a set of functions for the Code Igniter PHP framework. It is heavily inspired by the Rails ActionView functionality (and it’s associated helpers). It was designed for Code Igniter version 1.5.4+.
Ocular 1.0 has been released! More power and flexibility while allowing you to increase the performance of your website with CSS/JS minification through the 3rd party Minify library (included), partial-view cacheing, Markdown-formatted pages and more.
Here are a few of the features that it provides you, simply by installing the library.
- Automatically finds and uses views based upon the controller/function name in the URI.
- Uses “application” as a default name for your main template, your css and javascript files. This can be overridden, but makes for a nice default.
- Built in function to render view partials from within other views. This helps us to “Don’t Repeat Yourself”.
- Simple mechanic for passing data to views and partials.
- Automatically combines and minifies multiple stylesheets and javascript files to speed up page display for the user, if in production mode.
- Allows you to use Markdown Formatted pages as views.
NOTE: The docs in these pages are intended for use with the 0.20 version of the code. The docs for previous versions can be found at the CodeIgniter Wiki. The current library version is 1.0 and contains it's own documentation once installed.
Getting Started
Where to begin? First off, you need to download and install the latest version of the library. More details on this can be found in the Installation Guide. When that's done, you should read the Introduction to get an overview of the basic uses. Once you're comfortable with that, you should read the Recipes section for some additional uses.
If you discover new tricks with the library, or want to get involved in the development, I encourage you to join the project, and we'll work together to make sure it's the easiest and most powerful view library for CodeIgniter.