Welcome to YiiML

a haml-inspired markup for the Yii framework, provided by peml


Introduction

YiiML is a ViewRenderer component for the Yii framework, that gives you shortcuts and does the heavy lifting so you don't have to. It uses your indentation to know when to close tags, and when to behave differently. It also lets you more easily see the css applicable structure of your page, making styling from your markup much more evident.

YiiML is a wrapper around the YiiCL extension of the peml project. This brings peml additional commands specific to the Yii framework.

The core syntax of peml borrows heavily from haml, to demonstrate, here's a YiiML example, which is in this case almost identical to haml.


YiiML

#profile
  .left.column
    #date= print_date()
    #address= user()->address
  .right.column
    #email= user()->email
    #bio= user()->bio

PHP

<div id="profile">
  <div class="left column">
    <div id="date"><?php echo print_date(); ?></div>
    <div id="address"><?php echo user()->address; ?></div>
  </div>
  <div class="right column">
    <div id="email"><?php echo user()->email; ?></div>
    <div id="bio"><?php echo user()->bio; ?></div>
  </div>
</div>

That's it!

You can find a short tutorial explaining the common syntax here, as well as other materials from the links on the sidebar.