Tuesday, April 6, 2010

Exploring ColdMVC

If you haven't checked out ColdMVC yet you should. It's a light weight ColdFusion ORM framework I've being playing around with. The biggest thing I was impressed with is the tags on the views you can make...I am easily satisfied.

Have you ever been tired of typing that same css container.
Ex:

<div class="buttons">
<!--- some buttons --->
</div>


With ColdMVC's tags that section turns into:

<buttons>
<!--- some buttons --->
</buttons>

The tags help keep the view clean. The only worry that I have NOT ran into yet is that helper tags are very similar to html tags. Not sure how it will play out yet, but no problems so far.

4 comments:

  1. If you're worried about the confusion between ColdMVC tags and HTML tags, you can specify your own tag prefix in your application's config file. For example, open up /config/config.ini and add tagPrefix=foo under your [default] environment.

    Now instead of <buttons></buttons>, you'll use <foo:buttons></foo:buttons>.

    ReplyDelete
  2. Also, if you don't like how the buttons tag works in ColdMVC, you can create your own by adding a buttons.cfm file inside your project's /app/tags/ folder.

    ReplyDelete
  3. Just a heads up, I just committed a change to ColdMVC that sets the default tag prefix to "c" instead of "". Hopefully this elimiates some possible confusion.

    When you download the latest copy of ColdMVC, you'll either want to update your code from <buttons> to <c:buttons> or set tagPrefix="" inside your config.ini.

    Sorry about any inconvenience.

    ReplyDelete
  4. Tony, I'm curious how you setup the tag prefix globally. We are using tag prefixes at work, but using cfimport we end up placing that cfimport call on EVERY view that uses the tags, which sucks. The documentation says you can't use them from includes, layouts, etc.

    ReplyDelete