Created
December 14, 2009 19:12
-
-
Save soska/256319 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo csml::tag('div#header'); | |
echo csml::entag('This is the header','h1#site-name.page-title'); | |
echo csml::tag('/div'); | |
/* | |
Output: | |
<div id="header"> | |
<h1 id="site-name" class="page-title">This is the header</h1> | |
</div> | |
*/ | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include("csml.php"); | |
t('div#container'); | |
t('div#content'); | |
t('div#header'); | |
en('This is the header',array('h1.page-title','a.link[href="http://duperrific.com" rel="friend"]'),'',INLINE); | |
t('/div'); | |
t('ul#main.navigation'); | |
en('Home',array('li','a[href="/home"]')); | |
en('About',array('li','a[href="/about"]')); | |
en('Login',array('li','a[href="/login"]')); | |
en('Signup',array('li','a[href="/signup"]')); | |
t('/'); | |
// selectors can also be passed as an array in the second argument | |
$selectors = array( | |
'ul.navigation', | |
'li', | |
'a.button[href="http://google.com"]', | |
); | |
en("Go to Google",$selectors); | |
// output: <ul class="navigation><li><a href="http://google.com"" class="button">Go to Google</a></li></ul> | |
t('/div#content'); | |
t('/div#container'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment