HTML_QuickForm2
[ class tree: HTML_QuickForm2 ] [ index: HTML_QuickForm2 ] [ all elements ]

Class: HTML_QuickForm2_Container_Repeat_JavascriptBuilder

Source Location: /HTML_QuickForm2-2.1.0/HTML/QuickForm2/Container/Repeat/JavascriptBuilder.php

Class Overview

HTML_QuickForm2_JavascriptBuilder
   |
   --HTML_QuickForm2_Container_Repeat_JavascriptBuilder

Javascript builder used when rendering a repeat prototype


Author(s):

Version:

  • Release: 2.1.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTML_QuickForm2_JavascriptBuilder

HTML_QuickForm2_JavascriptBuilder::__construct()
Constructor, sets default web path to JS library files and default filesystem path
HTML_QuickForm2_JavascriptBuilder::addElementJavascript()
Adds element's setup code to form's Javascript
HTML_QuickForm2_JavascriptBuilder::addLibrary()
Adds a Javascript library file to the list
HTML_QuickForm2_JavascriptBuilder::addRule()
Adds the Rule javascript to the list of current form Rules
HTML_QuickForm2_JavascriptBuilder::encode()
Encodes a value for use as Javascript literal
HTML_QuickForm2_JavascriptBuilder::encodeNameValue()
Callback for array_map used to generate name-value pairs
HTML_QuickForm2_JavascriptBuilder::forceValidator()
Enables generating a validator for the current form even if no rules are present
HTML_QuickForm2_JavascriptBuilder::getFormJavascript()
Returns per-form javascript (client-side validation and elements' setup)
HTML_QuickForm2_JavascriptBuilder::getLibraries()
Returns Javascript libraries
HTML_QuickForm2_JavascriptBuilder::getSetupCode()
Returns setup code for form elements
HTML_QuickForm2_JavascriptBuilder::getValidator()
Returns client-side validation code
HTML_QuickForm2_JavascriptBuilder::setFormId()
Sets ID of the form currently being processed
HTML_QuickForm2_JavascriptBuilder::wrapScript()
Wraps the given Javascript code in <script> tags

Class Details

[line 43]
Javascript builder used when rendering a repeat prototype

Instead of returning form setup code and client-side rules as normal Javascript code, it returns them as Javascript string literals. These are expected to be eval()'d when adding a new repeat item.

This class is not intended for normal use.



[ Top ]


Class Variables

$formId =  'repeat'

[line 50]

Fake "current form" ID
  • Access: protected

Type:   string
Overrides:   Array


[ Top ]

$libraries = array()

[line 56]

Empty list of javascript libraries, base one(s) are in original builder
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]



Method Detail

getFormJavascriptAsStrings   [line 64]

array getFormJavascriptAsStrings( )

Returns rules and element setup code as Javascript string literals
  • Return: array('rules', 'setup code')
  • Access: public

[ Top ]

passLibraries   [line 83]

void passLibraries( HTML_QuickForm2_JavascriptBuilder $recipient)

Passes Javascript libraries added by repeat prototype
  • Access: public

Parameters:

HTML_QuickForm2_JavascriptBuilder   $recipient   —  original Javascript builder

[ Top ]


Documentation generated on Wed, 10 Apr 2019 08:56:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.