XAO::DO::Web::Page

XAO::DO::Web::Page is a core object of XAO::Web rendering system.
Download

XAO::DO::Web::Page Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andrew Maltsev
  • Publisher web site:
  • http://search.cpan.org/~amaltsev/

XAO::DO::Web::Page Tags


XAO::DO::Web::Page Description

XAO::DO::Web::Page is a core object of XAO::Web rendering system. XAO::DO::Web::Page is a core object of XAO::Web rendering system.SYNOPSISOutside web environment: my $page=XAO::Objects->new(objname => 'Page'); my $date=$page->expand(template => '');Inside XAO::Web template: < %Page path="/bits/some-path" ARG={< %SomeObject/f% >}% >As XAO::DO::Web::Page object (from now on just Page displayable object) is the core object for XAO::Web web rendering engine we will start with basics of how it works.The goal of XAO::Web rendering engine is to produce HTML data file that can be understood by browser and displayed to a user. It will usually use database tables, templates and various displayable objects to achieve that.Every time a page is requested in someone's web browser a XAO::Web handler gets executed, prepares site configuration, opens database connection, determines what would be start object and/or start path and does a lot of other useful things. If you have not read about it yet it is suggested to do so -- see XAO::Web::Intro and XAO::Web.Although XAO::Web handler can call arbitrary object with arbitrary arguments to produce an HTML page we will assume the simplest scenario of calling Page object with just one argument -- path to an HTML file template for simplicity (another way to pass some template to a Page object is to pass argument named "template" with the template text as the value). This is the default behavior of XAO::Web handler if you do not override it in configuration.Let's say user asked for http://oursite.com/ and XAO::Web translated that into the call to Page's display method with "path" argument set to "/index.html". All template paths are treated relative to "templates" directory in site directory or to system-wide "templates" directory if site-specific template does not exist. Suppose templates/index.html file in our site's home directory contains the following: Hello, World!As there are no special symbols in that template Page's display method will return exactly that text without any changes (it will also cache pre-parsed template for re-use under mod_perl, but this is irrelevant for now).


XAO::DO::Web::Page Related Software