View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Miles Crawford > Solstice-1440 > Solstice::View



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 3364   Source  


Solstice::View - A superclass for constructing views.


  package MyView;

  use base qw(Solstice::View);

  our $template = 'path/to/template.html';

  # If you dynamically choose a template, you need to specify the possibilities up 
  # front, so the compiler knows how to deal with them.  In most cases, this line 
  # is unnecessary:
  $self->setPossibleTemplates('template_cool.html', 'template_lame.html');

  sub generateParams {
    # To add a single scalar or array ref
    $self->setParam('param_name', $scalar);
    $self->setParam('param_name', \@array);

    # To add to a loop...
    $self->addParam('loop_name', \%hash_ref);

    # To add multiple values at once...

  # You can do this instead, but it's old, and not recommended.
  sub _getTemplateParams {
    return { my => "specific", template => "params" };


This is a virtual class for creating solstice view objects. This class should never be instantiated as an object, rather, it should always be sub-classed.


No symbols exported..



Creates a new Solstice::View object. $model is the data model for the view


Takes an error object and returns the html you can put in your template.

This function isn't doing anything anymore. Is it even being used??


Sets the data model for this view.


Returns the data model for this view.


Sets an error for this view.


Returns the error for this view.


Sets all of the templates that might be used by the view.


Returns the templates that this view might use.

makeButton {
makeStaticButton {
makeFlyoutButton {
makePopinButton {
makePopupButton {

Adds the sorting widgets for a given sort service object.


Appends the HTML code for this view to $screen.

This will try to compile a paint method, if there's a path for compiled views in config.

setParam('name', 'value')

Sets a param's value. Multiple calls to this method will overwrite previous values.


Sets multiple values into a param. Multiple calls will overwrite previous values.

addParam('loop_name', $data_ref)

This adds the data combo to the loop given. Multiple calls will add multiple values.

setSubView("key_name", $view_object)

This tells the view that a subview has already been created, so it should use that instead of creating a new one.


This is a method for a view to get a subview that may have already been created.


This turns on a flag for a view, so that it knows it is not the top-level view. By default all views will think they are top level, which impacts the way they react upon form submission error.


Returns the flag specifying whether this view is a sub view.


This sets a flag that says a subview has an error. This makes it so the top level view can show a more global error message.


Returns a flag saying whether a subview has an error.

createChildViewList( 'loop_name', 'var_name' )

this is an alias for addChildView, since it can actually handle many views


This should fill out the params for the view, by way of setParam and addParam.


Process child views and add params to the view.

Private Methods


Sets the template file for this view. The template file is assumed to live in the relative 'templates' directory.


Returns the template file for this view. The template file is assumed to live in the relative 'templates' directory.


Sets the template file for this view. The template file is assumed to live in the relative 'templates' directory.


Returns the template file for this view. The template file is assumed to live in the relative 'templates' directory.


This will return the path to templates. If it's been set already, it will return that, otherwise it will figure it out.


This will return the data for a template. Can be overridden by old-skool view subclasses. This handles errors for us. Yay!


Clears out all params added or set.


Determines whether the template has been modified, and recompiles if needed.


Modules Used



Catalyst Group, <>


$Revision: 3364 $


Copyright 1998-2007 Office of Learning Technologies, University of Washington

Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

syntax highlighting: