Class Horde_View_Helper_Url

Description

View helper for URLs

Located in /View/lib/Horde/View/Helper/Url.php (line 17)

Horde_View_Helper
   |
   --Horde_View_Helper_Url
Method Summary
 string escapeOnce (string $html)
 void isCurrentPage ( $url)
 void linkTo ( $name,  $url, [ $htmlOptions = array()])
 void linkToIf ( $condition,  $name,  $url, [ $htmlOptions = array()])
 void linkToUnless ( $condition,  $name,  $url, [ $htmlOptions = array()])
 void linkToUnlessCurrent ( $name,  $url, [ $htmlOptions = array()])
 void tagOptions (array $options, string 1)
Variables

Inherited Variables

Inherited from Horde_View_Helper

Horde_View_Helper::$_view
Methods
escapeOnce (line 163)

Returns the escaped $html without affecting existing escaped entities.

$this->escapeOnce("1 > 2 & 3") => "1 < 2 & 3"

  • return: Escaped HTML without affecting existing escaped entities
  • access: public
string escapeOnce (string $html)
  • string $html: HTML to be escaped
isCurrentPage (line 108)

True if the current request URI is the same as the current URL.

  • TODO: Get REQUEST_URI from somewhere other than the global environment.
  • access: public
void isCurrentPage ( $url)
  • $url
linkTo (line 53)

Creates a link tag of the given +name+ using a URL created by the set

of +options+. See the valid options in the documentation for url_for. It's also possible to pass a string instead of an options hash to get a link tag that uses the value of the string as the href for the link, or use +:back+ to link to the referrer - a JavaScript back link will be used in place of a referrer if none exists. If nil is passed as a name, the link itself will become the name.

==== Options * <tt>:confirm => 'question?'</tt> -- This will add a JavaScript confirm prompt with the question specified. If the user accepts, the link is processed normally, otherwise no action is taken. * <tt>:popup => true || array of window options</tt> -- This will force the link to open in a popup window. By passing true, a default browser window will be opened with the URL. You can also specify an array of options that are passed-thru to JavaScripts window.open method. * <tt>:method => symbol of HTTP verb</tt> -- This modifier will dynamically create an HTML form and immediately submit the form for processing using the HTTP verb specified. Useful for having links perform a POST operation in dangerous actions like deleting a record (which search bots can follow while spidering your site). Supported verbs are :post, :delete and :put. Note that if the user has JavaScript disabled, the request will fall back to using GET. If you are relying on the POST behavior, you should check for it in your controller's action by using the request object's methods for post?, delete? or put?. * The +html_options+ will accept a hash of html attributes for the link tag.

Note that if the user has JavaScript disabled, the request will fall back to using GET. If :href=>'#' is used and the user has JavaScript disabled clicking the link will have no effect. If you are relying on the POST behavior, your should check for it in your controller's action by using the request object's methods for post?, delete? or put?.

  • access: public
void linkTo ( $name,  $url, [ $htmlOptions = array()])
  • $name
  • $url
  • $htmlOptions
linkToIf (line 98)

Creates a link tag of the given +name+ using a URL created by the set of

+options+ if +condition+ is true, in which case only the name is returned. To specialize the default behavior, you can pass a block that accepts the name or the full argument list for link_to_unless (see the examples in link_to_unless).

  • access: public
void linkToIf ( $condition,  $name,  $url, [ $htmlOptions = array()])
  • $condition
  • $name
  • $url
  • $htmlOptions
linkToUnless (line 86)

Creates a link tag of the given +name+ using a URL created by the set of

+options+ unless +condition+ is true, in which case only the name is returned. To specialize the default behavior (i.e., show a login link rather than just the plaintext link text), you can pass a block that accepts the name or the full argument list for link_to_unless.

  • access: public
void linkToUnless ( $condition,  $name,  $url, [ $htmlOptions = array()])
  • $condition
  • $name
  • $url
  • $htmlOptions
linkToUnlessCurrent (line 73)

Creates a link tag of the given $name using $url unless the current request URI is the same as the links, in which case only the name is returned.

  • access: public
void linkToUnlessCurrent ( $name,  $url, [ $htmlOptions = array()])
  • $name
  • $url
  • $htmlOptions
tagOptions (line 130)

Converts an associative array of $options into a string of HTML attributes

  • access: public
void tagOptions (array $options, string 1)
  • array $options: key/value pairs
  • string 1: key1="value1" key2="value2"

Inherited Methods

Inherited From Horde_View_Helper

 Horde_View_Helper::__construct()
 Horde_View_Helper::__call()

Documentation generated on Sun, 30 Jan 2011 05:23:00 +0000 by phpDocumentor 1.4.3