John Drago > Apache2-ASP-1.58 > Apache2::ASP::Tag

Download:
Apache2-ASP-1.58.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  2
View Bugs
Report a bug
Source   Latest Release: Apache2-ASP-1.59

NAME ^

Apache2::ASP::Tag - Base class for all ASP Tag Extensions.

EXPERIMENTAL STATUS ^

NOTE: This module and the entire Tag Extension model for Apache2::ASP is experimental at this point. Do not use Tag Extensions in your production code because they will change in a future release.

SYNOPSIS ^

  package My::Bold;
  
  # Your tag should subclass Apache2::ASP::Tag:
  use base 'Apache2::ASP::Tag';
  
  # Declare these variables if you want access to them:
  use vars qw(
    $Session  $Server
    $Request  $Response
    $Config   $Application
    $Form
  );
  
  # You must define this method:
  sub render
  {
    my ($s, $args, $innerHTML) = @_;
    
    return "<b>" . $innerHTML . "</b>";
  }# end render()
  
  1;# return true:

Then in your ASP script, you could simply do this:

  <html>
    <body>
      This is my <My:Bold>name</My:Bold>
    </body>
  </html>

The output would be this:

  <html>
    <body>
      This is my <b>name</b>
    </body>
  </html>

DESCRIPTION ^

ASP Tag Extensions provides a means of abstracting logic in ASP scripts without adding large chunks of complicated Perl code.

NOTE: Tag Extensions are object-oriented and can subclass each other.

PUBLIC METHODS ^

new( )

Returns a blessed hashref-based object.

ABSTRACT METHODS ^

render( $args, $innerHTML )

Should return a string. $args is a hashref of all the "attributes" from the tag itself. For example:

  <My:Bold arg1="val1" id="bold123">Text</My:Bold>

Would equate to the following call:

  My::Bold->new()->render({
    arg1 => 'val1',
    id   => 'bold123',
  }, 'Text');

BUGS ^

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.

HOMEPAGE ^

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR ^

John Drago mailto:jdrago_999@yahoo.com

COPYRIGHT AND LICENSE ^

Copyright 2007 John Drago, All rights reserved.

This software is free software. It may be used and distributed under the same terms as Perl itself.