[limb-issues] ! Updated: (MCR-6) Create convenient output tag
Pavel Shevaev (JIRA)
jira at limb-project.com
Tue Sep 18 11:58:55 MSD 2007
[ http://jira.limb-project.com/browse/MCR-6?page=all ]
Pavel Shevaev updated MCR-6:
----------------------------
Description:
We need a convenient output tag to save some typing in templates, for example:
<%$var.foo.bar.name%>
...could actually be compiled as:
<?php echo $var->getFoo()->getBar()->getName() ?>
..or(which is longer but safer):
<?php
if($res = $var->getFoo())
if($res = $res->getBar())
{
$res = $res->getName();
echo $res;
}
?>
..or(which may be faster but not as generic as prev. example):
<?php
if($res = $var->get('foo'))
if($res = $res->get('bar'))
{
$res = $res->get('name');
echo $res;
}
?>
And add output filters as in WACT to the mix:
<%$var.foo|encode|clip:5,3%>
..which can be compiled as:
<?php
if($res = $var->get('foo'))
echo macro_filter_clip(macro_filter_encode($res), 5, 3);
?>
was:
We need a convenient output tag to save some typing in templates, for example:
<%$var.foo.bar.name%>
...could actually be compiled as:
<?php echo $var->getFoo()->getBar()->getName() ?>
..or(which is longer but safer):
<?php
if($res = $var->getFoo())
if($res = $res->getBar())
$res = $res->getName();
?>
..or(which may be faster but not as generic as prev. example):
<?php
if($res = $var->get('foo'))
if($res = $res->get('bar'))
$res = $res->get('name');
?>
And add output filters as in WACT to the mix:
<%$var.foo|encode|clip:5,3%>
..which can be compiled as:
<?php
if($res = $var->get('foo'))
echo macro_filter_clip(macro_filter_encode($res), 5, 3);
?>
> Create convenient output tag
> ----------------------------
>
> Key: MCR-6
> URL: http://jira.limb-project.com/browse/MCR-6
> Project: MACRO
> Issue Type: New Feature
> Reporter: Pavel Shevaev
> Assigned To: Pavel Shevaev
>
> We need a convenient output tag to save some typing in templates, for example:
> <%$var.foo.bar.name%>
> ...could actually be compiled as:
> <?php echo $var->getFoo()->getBar()->getName() ?>
> ..or(which is longer but safer):
> <?php
> if($res = $var->getFoo())
> if($res = $res->getBar())
> {
> $res = $res->getName();
> echo $res;
> }
> ?>
> ..or(which may be faster but not as generic as prev. example):
> <?php
> if($res = $var->get('foo'))
> if($res = $res->get('bar'))
> {
> $res = $res->get('name');
> echo $res;
> }
> ?>
> And add output filters as in WACT to the mix:
> <%$var.foo|encode|clip:5,3%>
> ..which can be compiled as:
> <?php
> if($res = $var->get('foo'))
> echo macro_filter_clip(macro_filter_encode($res), 5, 3);
> ?>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.limb-project.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the limb-issues
mailing list