se agrega ejemplo a documentación de doxygen de FileDir.
17 files changed:
* Hooks vs IT (HIT) is a simple template implementation, based on hooks and IT
* template systems.
*
* Hooks vs IT (HIT) is a simple template implementation, based on hooks and IT
* template systems.
*
+ * @exapmle MLIB/Tpl/FileDir/test.php
+ *
* @note This class was originally created as a part of BIFE.
* @author Leandro Lucarella <luca@llucax.hn.org>
* @todo Add a global example and an explanation of the directory structure to
* @note This class was originally created as a part of BIFE.
* @author Leandro Lucarella <luca@llucax.hn.org>
* @todo Add a global example and an explanation of the directory structure to
-<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80 foldmethod=marker:
+<?php /* vim: set binary noeol et ts=4 sw=4 tw=80 foldmethod=marker:
-------------------------------------------------------------------------------
mlib
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
mlib
-------------------------------------------------------------------------------
Authors: Martín Marrese <m_marrese@argentina.com>
Leandro Lucarella <luca@llucax.hn.org>
-------------------------------------------------------------------------------
Authors: Martín Marrese <m_marrese@argentina.com>
Leandro Lucarella <luca@llucax.hn.org>
-------------------------------------------------------------------------------
-$Id: Tpl.php 584 2004-07-30 05:50:10Z luca $
-----------------------------------------------------------------------------*/
//{{{Explanation of this example.
-----------------------------------------------------------------------------*/
//{{{Explanation of this example.
//}}}
//{{{ Require Once.
//}}}
//{{{ Require Once.
+ini_set('include_path', '../../../lib:' . ini_get('include_path'));
require_once 'MLIB/Tpl/FileDir.php';
//}}}
require_once 'MLIB/Tpl/FileDir.php';
//}}}
//}}}
//{{{ Create a page from a template.
//}}}
//{{{ Create a page from a template.
-$HIT =& new MLIB_Tpl_FileDir ('TPLS'); // Where TPLS is the subdirectory where I'll
- // put my html_templates.
+$TPL =& new MLIB_Tpl_FileDir ('TPLS'); // Where TPLS is the subdirectory where I'll
+ // put my html_templates.
//}}}
//{{{ Show this source
//}}}
//{{{ Show this source
else
{
//{{{ Add header group of templates.
else
{
//{{{ Add header group of templates.
- $HIT->pushGroup('header');
+ $TPL->pushGroup('header');
//{{{ First ROW
//{{{ Obtain the data cells of the first row.
//{{{ First ROW
//{{{ Obtain the data cells of the first row.
- $cells = $HIT->parse('cell',
+ $cells = $TPL->parse('cell',
array (
'ATTR' => 'width="20%" align="center"', //Sets the width of the cell.
array (
'ATTR' => 'width="20%" align="center"', //Sets the width of the cell.
- 'CELL' => $HIT->parse('logo', //Add the logo image to this cell.
+ 'CELL' => $TPL->parse('logo', //Add the logo image to this cell.
array(
'SRC' => $img_source, //Source of the image.
'ATTR' => 'border="0"', //Image attributes
array(
'SRC' => $img_source, //Source of the image.
'ATTR' => 'border="0"', //Image attributes
- $cells.= $HIT->parse('cell',
+ $cells.= $TPL->parse('cell',
array (
'ATTR' => 'width="80%" align="center"', //Sets the width of the cell.
'CELL' => 'MLIB_Tpl_FileDir Example' //Title.
array (
'ATTR' => 'width="80%" align="center"', //Sets the width of the cell.
'CELL' => 'MLIB_Tpl_FileDir Example' //Title.
//}}}
// Obtain the first row of the header table.
//}}}
// Obtain the first row of the header table.
- $rows = $HIT->parse('row', 'CELL', $cells);
+ $rows = $TPL->parse('row', 'CELL', $cells);
//}}}
//{{{ Second Row
// Obtain the data cells of the first row.
//}}}
//{{{ Second Row
// Obtain the data cells of the first row.
- $cells = $HIT->parse('cell',
+ $cells = $TPL->parse('cell',
array (
'ATTR' => 'colspan="2" align="center"', //Sets the width of the cell.
'CELL' => '<b>This is the second row of the header table.</b>'
array (
'ATTR' => 'colspan="2" align="center"', //Sets the width of the cell.
'CELL' => '<b>This is the second row of the header table.</b>'
);
// Obtain the first row of the header table.
);
// Obtain the first row of the header table.
- $rows.= $HIT->parse('row', 'CELL', $cells);
+ $rows.= $TPL->parse('row', 'CELL', $cells);
//}}}
// Obtain the parsed templates and add it to the header "main" template.
//}}}
// Obtain the parsed templates and add it to the header "main" template.
'table',
array (
'ATTR' => $table_width . ' border="1" align="center"',
'table',
array (
'ATTR' => $table_width . ' border="1" align="center"',
)
);
// Remove from the group stack the header group.
)
);
// Remove from the group stack the header group.
- $HIT->popGroup('header');
+ $TPL->popGroup('header');
//}}}
//{{{ Add body group of templates.
//}}}
//{{{ Add body group of templates.
- $HIT->pushGroup('body');
+ $TPL->pushGroup('body');
- $cells = $HIT->parse('cell',
+ $cells = $TPL->parse('cell',
array (
'ATTR' => 'valign="center" align="center" height="370"', //Sets the width of the cell.
'CELL' => '<font size="1">BODY</font>' //Body Content
array (
'ATTR' => 'valign="center" align="center" height="370"', //Sets the width of the cell.
'CELL' => '<font size="1">BODY</font>' //Body Content
);
// Obtain the first row of the header table.
);
// Obtain the first row of the header table.
- $rows = $HIT->parse('row', 'CELL', $cells);
+ $rows = $TPL->parse('row', 'CELL', $cells);
//}}}
// Obtain the parsed templates and add it to the header "main" template.
//}}}
// Obtain the parsed templates and add it to the header "main" template.
'table',
array (
'ATTR' => $table_width . ' border="0" align="center"',
'table',
array (
'ATTR' => $table_width . ' border="0" align="center"',
)
);
// Remove from the group stack the header group.
)
);
// Remove from the group stack the header group.
- $HIT->popGroup('body');
+ $TPL->popGroup('body');
//}}}
//{{{ Add footer group of templates.
//}}}
//{{{ Add footer group of templates.
- $HIT->pushGroup('footer');
+ $TPL->pushGroup('footer');
//{{{ First ROW
//{{{ Obtain the data cells of the first row.
//{{{ First ROW
//{{{ Obtain the data cells of the first row.
- $cells = $HIT->parse('cell',
+ $cells = $TPL->parse('cell',
array (
'ATTR' => 'align="center"', //Sets the width of the cell.
array (
'ATTR' => 'align="center"', //Sets the width of the cell.
- $HIT->parse('link_meconlib_dev')
+ $TPL->parse('link_meconlib_dev')
)
)
);
//}}}
// Obtain the first row of the header table.
)
)
);
//}}}
// Obtain the first row of the header table.
- $rows = $HIT->parse('row', 'CELL', $cells);
+ $rows = $TPL->parse('row', 'CELL', $cells);
//}}}
// Obtain the parsed templates and add it to the header "main" template.
//}}}
// Obtain the parsed templates and add it to the header "main" template.
'table',
array (
'ATTR' => $table_width . ' border="1" align="center"',
'table',
array (
'ATTR' => $table_width . ' border="1" align="center"',
)
);
// Remove from the group stack the header group.
)
);
// Remove from the group stack the header group.
- $HIT->popGroup('footer');
+ $TPL->popGroup('footer');
//}}}
//{{{ Add SOURCE group of templates.
//}}}
//{{{ Add SOURCE group of templates.
- $HIT->pushGroup('source');
+ $TPL->pushGroup('source');
// Obtain the parsed templates and add it to the header "main" template.
// Obtain the parsed templates and add it to the header "main" template.
- $SOURCE = $HIT->parse('div');
+ $SOURCE = $TPL->parse('div');
// Remove from the group stack the header group.
// Remove from the group stack the header group.
- $HIT->popGroup('source');
+ $TPL->popGroup('source');
//}}}
}
//}}}
//{{{ Add all the parsed templates to the main template.
//}}}
}
//}}}
//{{{ Add all the parsed templates to the main template.
- 'TITLE' => 'MLIB_Tpl_HIT Test',
+ 'TITLE' => 'MLIB_Tpl_FileDir Test',
'BODY' => $HEADER . $BODY . $FOOTER,
'SOURCE' => $SOURCE
)
'BODY' => $HEADER . $BODY . $FOOTER,
'SOURCE' => $SOURCE
)
+?>
\ No newline at end of file