Welcome Guest, Not a member yet? Register   Sign In
Ocular Layout Library 1.0
#1

[eluser]kilishan[/eluser]
I know I've been away for awhile, but I return bearing a gift. Smile

My little layout library, Ocular, has gotten quite a few downloads in the last months, so I do hope it's working for everyone, but I'm thrilled to announce the release of version 1.0. It's a complete rewrite and, while similar, not backwards compatible, though the changes are easy to make.

Download the Ocular Layout Library v1.0.

The new version has the following features:

- Automatic assignment of view based on controller/function names (like previous versions)
- Allows you to implement many of the Yahoo performance guidelines (including having inline and external scripts inserted at the bottom of the page)
- Works in either a 'development mode' that creates standard CSS/JS links, or a production mode that creates a single call to the Minify library (included) that will combine, minify, compress and cache your CSS or JS files (included).
- Allows for easy inclusion (and caching!) of partial views.
- Allows you to render Markdown formatted pages for content within your layout (great for help pages, home pages, etc)
- Allows you to easily insert "blocks" into a layout that change from page to page.

Unlike the previous version, this one is PHP5 only, and does not currently have anything built in to allow it to work with/as a module. If this is something you use a lot, let me know, and I'll get it working - or feel free to make the changes and I'll incorporate them.

The documentation on Google Code has not been updated yet, but full documentation and feature tests available to install in the archive.

NOTE FOR PREVIOUS USERS: I've removed the helper and incoprorated all of the same features back into the main class, so you'll have to expand your calls in your views if you upgrade.

If you have any feature requests, just let me know!

Hope it helps!

EDIT: if you're using the rewrite rules in your htaccess, you'll need to allow the 'min' directory.
#2

[eluser]kaging[/eluser]
An Error Was Encountered

Unable to load the requested file: helpers/ocular_helper.php

tested on fresh CI 1.7.1
#3

[eluser]kilishan[/eluser]
[quote author="kaging" date="1245668871"]An Error Was Encountered

Unable to load the requested file: helpers/ocular_helper.php

tested on fresh CI 1.7.1[/quote]

Did you autoload the ocular_helper file like for the old version? If so, then just remove that. The helper doesn't exist anymore. I haven't updated the docs on GoogleCode yet, I apologize.

If you didn't autoload, then I've got an oops somewhere that I need to check into.
#4

[eluser]kilishan[/eluser]
A new version of the library, 1.0.1, has been uploaded to http://ocular.googlecode.com. It fixes several small bugs that were reported and should work error-free for everyone, now.

The one gotcha, is that the docs on the GoogleCode site are not current. The library no longer uses a separate helper, so don't try to autoload that as the docs would suggest.
#5

[eluser]louis w[/eluser]
Pretty cool. Very close to what I had developed for my extension of the output library.

A good idea to clean the code up would be to create a benchmark method in your library and have that do the check if profiling it turned on instead of having to place a conditional twice in each method. Not that it really matters but I also noticed a few places where you track when a benchmark starts but not when it ends.
#6

[eluser]kilishan[/eluser]
[quote author="louis w" date="1250217053"]Pretty cool. Very close to what I had developed for my extension of the output library.

A good idea to clean the code up would be to create a benchmark method in your library and have that do the check if profiling it turned on instead of having to place a conditional twice in each method. Not that it really matters but I also noticed a few places where you track when a benchmark starts but not when it ends.[/quote]

Good point. I'll take care of that in the next release (Starting work on that next week). The main new feature will be the ability to use different themes. This is primarily to allow for easily implementing various mobile versions.

I also need to look into the caching a little more. Working on the documentation, I realized it doesn't quite work like it ultimately needs to. Works great for partials, but full pages, not so much.... Smile
#7

[eluser]kilishan[/eluser]
I have posted a new user_guide as a download at the GoogleCode page (http://ocular.googlecode.com). This covers every function, and includes a tutorial on how to convert a downloaded template for use with Ocular.

I believe it's the most thorough and user-friendly documentation I've ever written, so it should cover all of your bases. If I missed something, though, or messed up anywhere, please let me know! This is the foundation that I'll be growing from as I introduce new features (yes, there are a couple planned for the future) so I want it to stay as complete and correct as possible.

Here's a direct link: http://ocular.googlecode.com/files/ocular_guide.zip




Theme © iAndrew 2016 - Forum software by © MyBB