Class SimplePage

Description

A wrapper for a web page.

Located in /page.php (line 334)


	
			
Variable Summary
 mixed $_base
 mixed $_frames
 mixed $_frameset
 mixed $_headers
 mixed $_label
 mixed $_links
 mixed $_method
 mixed $_open_forms
 mixed $_raw
 mixed $_sent
 mixed $_text
 mixed $_title
 mixed $_url
Method Summary
 SimplePage SimplePage ([SimpleHttpResponse $response = false])
 void acceptFormEnd ()
 void acceptFormStart ( &$tag, SimpleFormTag $tag)
 void acceptFrame ( &$tag, SimpleFrameTag $tag)
 void acceptFramesetStart ( &$tag, SimpleFramesetTag $tag)
 void acceptLabelEnd ()
 void acceptLabelStart ( &$tag, SimpleFormTag $tag)
 void acceptPageEnd ()
 void acceptTag ( &$tag, SimpleTag $tag)
 void clearFrameFocus ()
 string getAuthentication ()
 string/boolean getField (SimpleSelector $selector)
 SimpleForm &getFormById (string $id)
 SimpleForm &getFormByImage (SimpleSelector $selector)
 SimpleForm &getFormBySubmit (SimpleSelector $selector)
 array getFrameFocus ()
 array/string getFrames ()
 boolean/array getFrameset ()
 string getHeaders ()
 string getMethod ()
 string getMimeType ()
 string getRaw ()
 string getRealm ()
 mixed getRequest ()
 mixed getRequestData ()
 integer getResponseCode ()
 string getText ()
 string getTitle ()
 string getTransportError ()
 SimpleUrl getUrlById (string $id)
 array getUrls ()
 array getUrlsByLabel (string $label)
 boolean hasFrames ()
 boolean setField (SimpleSelector $selector, string $value, [ $position = false])
 boolean setFrameFocus (string $name)
 boolean setFrameFocusByIndex (integer $choice)
 void _addLink (SimpleAnchorTag $tag)
 boolean _linkIsAbsolute (string $url)
 void _setBase ( &$tag, SimpleTag $tag)
 void _setTitle ( &$tag, SimpleTitleTag $tag)
Variables
mixed $_base = false (line 352)
mixed $_complete_forms (line 341)
mixed $_frames (line 343)
mixed $_frameset (line 342)
mixed $_frameset_nesting_level (line 344)
mixed $_headers (line 349)
mixed $_label (line 338)
mixed $_last_widget (line 337)
mixed $_left_over_labels (line 339)
mixed $_links (line 335)
mixed $_method (line 350)
mixed $_open_forms (line 340)
mixed $_raw (line 346)
mixed $_request_data (line 353)
mixed $_sent (line 348)
mixed $_text (line 347)
mixed $_title (line 336)
mixed $_transport_error (line 345)
mixed $_url (line 351)
Methods
Constructor SimplePage (line 360)

Parses a page ready to access it's contents.

  • access: public
SimplePage SimplePage ([SimpleHttpResponse $response = false])
acceptFormEnd (line 651)

Closes the most recently opened form.

  • access: public
void acceptFormEnd ()
acceptFormStart (line 643)

Opens a form. New widgets go here.

  • access: public
void acceptFormStart ( &$tag, SimpleFormTag $tag)
acceptFrame (line 686)

Takes a single frame tag and stashes it in the current frame set.

  • access: public
void acceptFrame ( &$tag, SimpleFrameTag $tag)
acceptFramesetEnd (line 674)

Closes the most recently opened frameset.

  • access: public
void acceptFramesetEnd ()
acceptFramesetStart (line 663)

Opens a frameset. A frameset may contain nested frameset tags.

  • access: public
void acceptFramesetStart ( &$tag, SimpleFramesetTag $tag)
  • SimpleFramesetTag $tag: Tag to accept.
  • &$tag
acceptLabelEnd (line 615)

Closes the most recently opened label.

  • access: public
void acceptLabelEnd ()
acceptLabelStart (line 606)

Opens a label for a described widget.

  • access: public
void acceptLabelStart ( &$tag, SimpleFormTag $tag)
acceptPageEnd (line 732)

Marker for end of complete page. Any work in progress can now be closed.

  • access: public
void acceptPageEnd ()
acceptTag (line 586)

Adds a tag to the page.

  • access: public
void acceptTag ( &$tag, SimpleTag $tag)
clearFrameFocus (line 578)

Clears the frame focus. Does nothing for a leaf page.

  • access: public
void clearFrameFocus ()
expandUrl (line 854)

Expands expandomatic URLs into fully qualified URLs.

  • return: Absolute URL.
  • access: public
SimpleUrl expandUrl (SimpleUrl $url)
getAuthentication (line 524)

Accessor for last Authentication type. Only valid straight after a challenge (401).

  • return: Description of challenge type.
  • access: public
string getAuthentication ()
getBaseUrl (line 472)

Base URL if set via BASE tag page url otherwise

  • return: Base url.
  • access: public
SimpleUrl getBaseUrl ()
getField (line 973)

Accessor for a form element value within a page.

  • return: A string if the field is present, false if unchecked and null if missing.
  • access: public
string/boolean getField (SimpleSelector $selector)
  • SimpleSelector $selector: Field finder.
getFormById (line 937)

Finds a held form by the form ID. A way of identifying a specific form when we have control of the HTML code.

  • return: Form object containing the matching ID.
  • access: public
SimpleForm &getFormById (string $id)
  • string $id: Form label.
getFormByImage (line 919)

Finds a held form by image using a selector.

Will only search correctly built forms.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImage (SimpleSelector $selector)
  • SimpleSelector $selector: Image finder.
getFormBySubmit (line 901)

Finds a held form by button label. Will only search correctly built forms.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmit (SimpleSelector $selector)
  • SimpleSelector $selector: Button finder.
getFrameFocus (line 550)

Accessor for current frame focus. Will be false as no frames.

  • return: Always empty.
  • access: public
array getFrameFocus ()
getFrames (line 781)

Fetches a list of loaded frames.

  • return: Just the URL for a single page.
  • access: public
array/string getFrames ()
getFrameset (line 763)

Accessor for frame name and source URL for every frame that will need to be loaded. Immediate children only.

  • return: False if no frameset or otherwise a hash of frame URLs. The key is either a numerical base one index or the name attribute.
  • access: public
boolean/array getFrameset ()
getHeaders (line 442)

Accessor for raw headers of page.

  • return: Header block as text.
  • access: public
string getHeaders ()
getMethod (line 454)

Original request method.

  • return: GET, POST or HEAD.
  • access: public
string getMethod ()
getMimeType (line 499)

Accessor for current MIME type.

  • return: MIME type as string; e.g. 'text/html'
  • access: public
string getMimeType ()
getRaw (line 420)

Accessor for raw text of page.

  • return: Raw unparsed content.
  • access: public
string getRaw ()
getRealm (line 537)

Accessor for last Authentication realm. Only valid straight after a challenge (401).

  • return: Name of security realm.
  • access: public
string getRealm ()
getRequest (line 411)

Original request as bytes sent down the wire.

  • return: Sent content.
  • access: public
mixed getRequest ()
getRequestData (line 481)

Original request data.

  • return: Sent content.
  • access: public
mixed getRequestData ()
getResponseCode (line 511)

Accessor for HTTP response code.

  • return: HTTP response code received.
  • access: public
integer getResponseCode ()
getText (line 430)

Accessor for plain text of page as a text browser would see it.

  • return: Plain text of page.
  • access: public
string getText ()
getTitle (line 886)

Accessor for parsed title.

  • return: Title or false if no title is present.
  • access: public
string getTitle ()
getTransportError (line 490)

Accessor for last error.

  • return: Error from last response.
  • access: public
string getTransportError ()
getUrl (line 463)

Original resource name.

  • return: Current url.
  • access: public
SimpleUrl getUrl ()
getUrlById (line 824)

Accessor for a URL by the id attribute.

  • return: URL with that id of false if none.
  • access: public
SimpleUrl getUrlById (string $id)
  • string $id: Id attribute of link.
getUrls (line 792)

Accessor for a list of all links.

  • return: List of urls with scheme of http or https and hostname.
  • access: public
array getUrls ()
getUrlsByLabel (line 808)

Accessor for URLs by the link label. Label will match regardess of whitespace issues and case.

  • return: List of links with that label.
  • access: public
array getUrlsByLabel (string $label)
  • string $label: Text of link.
hasFrames (line 750)

Test for the presence of a frameset.

  • return: True if frameset.
  • access: public
boolean hasFrames ()
setField (line 955)

Sets a field on each form in which the field is available.

  • return: True if value is valid.
  • access: public
boolean setField (SimpleSelector $selector, string $value, [ $position = false])
  • SimpleSelector $selector: Field finder.
  • string $value: Value to set field to.
  • $position
setFrameFocus (line 570)

Sets the focus by name. Always fails for a leaf page.

  • return: False as no frames.
  • access: public
boolean setFrameFocus (string $name)
  • string $name: Chosen frame.
setFrameFocusByIndex (line 560)

Sets the focus by index. The integer index starts from 1.

  • return: Always false.
  • access: public
boolean setFrameFocusByIndex (integer $choice)
  • integer $choice: Chosen frame.
_addLink (line 723)

Adds a link to the page.

  • access: protected
void _addLink (SimpleAnchorTag $tag)
_linkIsAbsolute (line 713)

Test to see if link is an absolute one.

  • return: True if absolute.
  • access: protected
boolean _linkIsAbsolute (string $url)
  • string $url: Url to test.
_setBase (line 867)

Sets the base url for the page.

  • access: protected
void _setBase ( &$tag, SimpleTag $tag)
_setTitle (line 877)

Sets the title tag contents.

  • access: protected
void _setTitle ( &$tag, SimpleTitleTag $tag)

Documentation generated on Sun, 04 May 2008 09:21:53 -0500 by phpDocumentor 1.3.0