Class: LinkHelper

Source Location: /CORE/system/classes/util/LinkHelper.php

Class LinkHelper

Class Overview

This class has static methods, that can be used to create and parse BIGACE URLs.

These links are all related to the top Class:

  1. classes.util.CMSLink

Whenever you link to a Page, inside your Modul or to BIGACE Applications... you should use the methods of this class, to make sure the link works properly in all future versions!

Located in /CORE/system/classes/util/LinkHelper.php [line 43]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: LinkHelper.php,v 1.18 2009/03/12 01:11:04 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Method Summary
static String   createLink()   Appends Parameter to a given URL. It takes care about the ? separator and appends the Session ID if required (in case of inaccepted Cookies).
static null   getCMSLinkFromItem()   Creates an CMSLink instance for the given Item.
static null   getUrlFromCMSLink()   Gets the URL for the given CMSLink.
static string   itemUrl()   Shorthand for LinkHelper::getUrlFromCMSLink(LinkHelper::getCMSLinkFromItem($item,$params)).
static string   url()   Create a URL to a unique name.

[ Top ]
Methods
static method createLink  [line 134]

  static String createLink( String $adress, [array $params = array()]  )

Appends Parameter to a given URL. It takes care about the ? separator and appends the Session ID if required (in case of inaccepted Cookies).

Parameters:
String   $adress:  adress the URL (if empty a link like ?foo=bar will be created)
array   $params:  params the URL Parameter as key-value mapped array

API Tags:
Return:  the created URL
Access:  public


[ Top ]
static method getCMSLinkFromItem  [line 166]

  static null getCMSLinkFromItem( Item $item  )

Creates an CMSLink instance for the given Item.

Parameters:
Item   $item:  item the Item to link to

API Tags:
Return:  if the first argument is of wrong class type
Access:  public


[ Top ]
static method getUrlFromCMSLink  [line 83]

  static null getUrlFromCMSLink( CMSLink $cmsLink, [array $params = array()], [ $unique = true]  )

Gets the URL for the given CMSLink.

This method takes care about the Rewrite settings.

If you want to link to an Item (e.g. a Menu), you can call something like this:

  1.  $link LinkHelper::getCMSLinkFromItem($menu);

Parameters:
CMSLink   $cmsLink:  cmsLink the CMSLink to get the URL for
array   $params:  params extended URL Parameter (like http://url?foo=bar)
   $unique: 

API Tags:
Return:  if the first argument is of wrong class type
Access:  public


[ Top ]
static method itemUrl  [line 65]

  static string itemUrl( $item $item, [$params $params = array()]  )

Shorthand for LinkHelper::getUrlFromCMSLink(LinkHelper::getCMSLinkFromItem($item,$params)).

Parameters:
$item   $item:  the item to create the URL for
$params   $params:  array of parameter to add to the URĂ–

API Tags:
Return:  the full URL to the unique name
Access:  public


[ Top ]
static method url  [line 53]

  static string url( $uniqueURL $uniqueURL, [$params $params = array()]  )

Create a URL to a unique name.

Parameters:
$uniqueURL   $uniqueURL:  the unique name to link to
$params   $params:  the parameter to add to the url

API Tags:
Return:  the full URL to the unique name
Access:  public


[ Top ]