IWL::Object - Base object module for IWL
This is the base object module for IWL. Every other module will inherit from it.
An array of child objects for the current object. Null if there are no children.
The parent for the current object. Null if it has no parent.
Returns the first child of the object
Returns the last child of the object
Obtains the next child of the object. Parameter: CURRENT_CHILD - it's sibling Returns the child object, or null if there is no next child.
Obtains the previous child of the object. Parameter: CURRENT_CHILD - it's sibling Returns the child object, or null if there is no previous child.
Returns the next sibling of the current object.
Returns the previous sibling of the current object.
Appends OBJECT as a child to the current object.
Parameter: OBJECT - the object to be appended (can be an array of objects)
Appends OBJECT as the first child to the current object, and moves the rest afterward.
Parameter: OBJECT - the object to be prepended (can be an array of objects)
Inserts OBJECT after REFERENCE.
Parameter: OBJECT - the object to be inserted (can be an array of objects)
Sets OBJECT as the only child to the current object, replacing any existing children.
Parameter: OBJECT - the object to be set (can be an array of objects)
Returns the markup for the current object and it's children.
Prints the current object and all of it's children.
Prints the HTML content of current object and all of its children, along with an HTML header.
Returns the object and it's children as a new object, with a structure needed for JSON
Returns a JSON object for the current object and it's children.
If the html looks like this: <div attr1="1" attr2="2" style="display: none;"> <child1 /> <child2 attr3="3" /> </div>
The corresponding JSON object will look like this:
{"div":{"attributes":{"attr1":1,"attr2":2,"style":{"display":"none"}},"children":["child1", "child2":{"attributes":{"attr3":3}}]}}
Prints the JSON of current object and all of its children, along with a javascript header.
Prints the JSON Header which is used by IWL
Prints the HTML Header which is used by IWL
Appends an attribute to the opening tag. The value gets automatically URI escaped. The function fails and returns false on an attempt to set an illegal attribute. Illegal attributes are attributes that contain non US-ASCII characters or violate the XML specification.
If STRICT_LEVEL in iwl.conf is set to a value greater than 1, an exception is thrown in case of illlegal attributes.
Use setStyle for setting the style attribute
Parameter: ATTR - the attribute name to be appended VALUE - the value of the attribute ESCAPING - optional, sets the method of escaping the value - html - html entity escaping [default] - uri - uri escaping - none
setAttributes is a wrapper to setAttribute. It sets all the attributes in the provided hash
Parameters: %ATTRS - a hash of attributes, ESCAPING - optionally provide a method of escaping (see setAttribute)
Returns the value of the given attribute. Use getStyle for getting the style attribute
Parameters: ATTR - the attribute name to be returned, UNESCAPED - optional, true if the value should be returned unescaped
Returns true if attribute ATTR exists, false otherwise.
Deletes the given attribute
Parameters: ATTR - the attribute name to be deleted
Appends an object after the current object
Parameters: OBJECT - the object to be appended
Adds the list of urls (relative to JS_DIR) as required by the object
Parameters: URLS - a list of required javascript files
Adds the list of urls inside a conditonal comment (relative to JS_DIR) as required by the object
Parameters: CONDITION - the comment condition, see IWL::Comment(3pm) URLS - a list of required javascript files
Class method that initializes all state data of the library. Stateful data is for example the list of already included javascript helper files. If multiple html pages are generated within one process context, this data has to be cleared, so that new pages will start with fresh data.
You will also need to call this method, when using IWL inside of Catalyst(3pm) when running the application with the built-in http server that does not reload modules for each request.
This method is a class method! You do not need to instantiate an object in order to call it.
In scalar context returns the newline separated contents of the error stack. In list context it returns the error stack as a list.
Like errorList() but empties the error stack and resets the bad state.
Removes trailing newlines from the messages on the error stack.
Empties the error stack.
Returns the current bad state.
Returns the number of messages on the error stack.
The following methods should only be used by classes that inherit from IWL::Object.
Combines _pushError and _setBad to produce a fatal error
Push all strings in STRINGLIST onto the error stack and returns false (can be used to return with an error from arbitrary functions).
STRINGLIST
Sets the current bad state.
Returns the current state of the form as an IWL::Stash(3pm) object. The form state reflects the state of all of its children of type IWL::Input(3pm).
Returns the current state of the form to STATE, an IWL::Stash(3pm) object. The form state reflects the state of all of its children of type IWL::Input(3pm).
Copyright (c) 2006-2007 Viktor Kojouharov. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perldoc perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
'=item' outside of any '=over'
To install IWL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IWL
CPAN shell
perl -MCPAN -e shell install IWL
For more information on module installation, please visit the detailed CPAN module installation guide.