On 11/30/07, Sherrard Burton <[EMAIL PROTECTED]> wrote:
> i may have overlooked this in the documentation, but is there a
> $m->comp() equivalent to attr_if_exists()? obviously it's not critical,
> but it would be nice to be able to shortcut logic like this:
>
> % if ( $m->comp_exists( '/path/to/possible/component' ) ) {
> % $m->comp( '/path/to/possible/component' );
> % }
>
> to
>
> % $m->comp_if_exists( '/path/to/possible/component' );
what if write your own:
sub HTML::Mason::Request::comp_if_exists
{
my ($self, $path, %args) = @_;
return $self->fetch_comp($path) ? $self->comp($path, %args) : '';
}
and then call it the way you wanted..
Regards,
Xicheng
---
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users