Zinc::View

From Deep Thought

Jump to: navigation, search

Zinc::View

NAME

Zinc::View

DESCRIPTION

Handles what we show the users.

SYNOPSIS

Really meant to be used within a Zinc framework. See Zinc::Director.

REQUIRES

HTML::TemplateZ

BASE METHODS

Overrides for the HTML::TemplateZ Base Class

new()

Same thing as HTML::TemplateZ::new() but we ad some properties.

Properties (optional)

 PageToDisplay = the name of the page in the Template Directory to display
 ActionResults = the string that contains the action results output
 ActionResultsPage = the name of a page in the Template Directory to be shown after results are done.
 Message = an application message string that you want to print later (via SELF)

display()

A simpler display() method that is based on the HTML::TemplateZ display.

This version uses our "PageToDisplay" property to determine the template file to be shown. It takes only one parameter that is position (versus named).

Browser()

Return a CGI variable from the Director->{WebIO} object that we are attached to.

 Example:
 $self->DoSomethingCool($self->Browser('formentry'));

FUNCTIONAL METHODS

They do something special to extend the base HTML::TemplateZ class.

AddToResults()

Add the string passed in to this method to the Action Results property so we can display it in the view if so desired.

Memory()

Return the Memory object from the Director we are attached to.

 Example:
 $self->Memory->Recall('user.user_name');

SetResultsPage()

Set the page that we are going to show when display action results.

DISPLAY METHODS

Show something cool (aka Z-Codes)

BROWSERINFO()

Display browser info including form/URL variables that have been submitted.

DIRECTOR()

Display properties from the Director.

 The parameter to DIRECTOR must be one of:
 Command - show current Director command
 Context - show current Director context
 Directive - show current Director directive
 origCommand - show the original command
 
 Defaults to Command if none of the above are selected.
 

 Example:
 <<DIRECTOR(Directive}>>

RECALL()

Display a data element from the Memory object linked to the Zinc::Director.

PULLDOWN()

Display a pulldown menu based on a selection from the Memory object linked to the Zinc::Director.

The parameters are positional, which means if you are specifiying the later options such as a different field name (3rd parameter) you must specify the first 2 parameters (table.field for the value, field for the show).

Parameters (required)

  $_[0] = table.field string for the value the pulldown returns

Parameters (optional)

  $_[1] = field for what the pulldown shows

Example

    <div class="formentryline">
        <div class="formlabel">Category</div>
        <div class="forminput">

            <!-- A pulldown of category IDs -->
            <%PULLDOWN(categories.cat_id)%>

            <!-- ...with a different field showing -->
            <%PULLDOWN(categories.cat_id,cat_name)%>

            <!-- ...with a different field name -->
            <%PULLDOWN(categories.cat_id,cat_name,req_catid)%>
        </div>
    </div>

ShowResults()

A Z-Code that is used to show the results of an action. If the Director command is 'show' then just show the specified page.

NOTES

 None.

EXAMPLES

 None.

AUTHOR

 Cyber Sprocket Labs, Advanced Internet Technology Consultants
 Contact info@cybersprocket.com for more info.

ABOUT CSL

 Cyber Sprocket Labs (CSL) is and advanced internet technology
 consulting firm based in Charleston South Carolina.   We provide custom
 software, database, and consulting services for small to mid-sized
 businesses.

 For more information, or to schedule a consult, visit our website at
 www.cybersprocket.com

CONTRIBUTIONS

 Like the script and want to contribute?
 You can send payments via credit card or bank transfer using
 PayPal and sending money to our paypal@cybersprocket.com PayPal address.

COPYRIGHT

 (c) 2008, Cyber Sprocket Labs
 This script is covered by the GNU GENERAL PUBLIC LICENSE.
 View the license at http://www.gnu.org/copyleft/gpl.html

REVISION HISTORY

 v0.1 - May 2007
    First go.

Personal tools
Cyber Sprocket Labs
Cyber Sprocket Tech