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

Class: HTMLlinks

Source Location: /HTMLlinks.php

Class Overview

Strings
   |
   --HTML
      |
      --HTMLlinks

This class manages HTMLlinks objects.


Author(s):

Version:

  • 1.2

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTML

HTML::HTMLCloseTag()
HTML closing tag function
HTML::HTMLOpenTag()
HTML opening tag function

Class: Strings

Strings::__construct()
Construction function
Strings::console()
Console function
Strings::IsUTF8()
UTF8 detection function
Strings::QuoteStrip()
Quotes stripping function
Strings::RemoveAccent()
Accents removal function
Strings::RemoveSpaces()
Spaces removal function
Strings::stringHasNumbers()
Numbers detection function
Strings::ToUTF8()
UTF8 conversion function
Strings::ucwordsw()
Special uppercase function

Class Details

[line 35]
This class manages HTMLlinks objects.

Created on 05 jan 07

Changes: 1.1 -> 1.2: 28 jul 09 updated: file is PEAR compatible class has been renamed from Links() to HTMLlinks() 1.0 -> 1.1: 21 jul 09 updated: Relative2Absolute() function no more warning when running PHP in paranoid level




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  1.2
license:  GNU Public License


[ Top ]


Class Variables

$charset_attr =

[line 72]

Variable that contains charset attribute



Tags:

access:  public

Type:   string


[ Top ]

$hreflang_attr =

[line 52]

Variable that contains hreflang attribute



Tags:

access:  public

Type:   string


[ Top ]

$href_attr =

[line 47]

Variable that contains href attribute



Tags:

access:  public

Type:   string


[ Top ]

$rel_attr =

[line 62]

Variable that contains rel attribute



Tags:

access:  public

Type:   string


[ Top ]

$rev_attr =

[line 67]

Variable that contains rev attribute



Tags:

access:  public

Type:   string


[ Top ]

$sLink =

[line 41]

Variable that contains link to be handled



Tags:

access:  public

Type:   string


[ Top ]

$type_attr =

[line 57]

Variable that contains type attribute



Tags:

access:  public

Type:   string


[ Top ]



Class Methods


method AHrefLocator [line 341]

array AHrefLocator( string $this->value)

AHref detection function

This function is used to return Href content from 'a' tags. It does not checks if href content is wellformed or not or if it is valid URL. Result is returned

  1.  <?php
  2.  $oHTMLlinks        new HTMLlinks();
  3.  $oHTMLlinks->value $textcontaininglinks;
  4.  print_r($oHTMLlinks->AHrefLocator());
  5.  // listoflinks
  6.  ?>




Tags:

return:  list of links in $this->value
since:  version 1.0


Parameters:

string   $this->value   text containing links (required)

[ Top ]

method FormatEmail [line 395]

string FormatEmail( [bool $checkemail = false], string $this->value)

Email format function

This function is used to format an email to a mailto link. It can check if value is a right email. Result is stored in $this->value and returned

  1.  <?php
  2.  $oHTMLlinks        new HTMLlinks();
  3.  $oHTMLlinks->value pvienne@me.com;
  4.  $oHTMLlinks->FormatEmail(true);
  5.  // mailto:pvienne@me.com
  6.  ?>




Tags:

return:  email link
since:  version 1.0


Parameters:

string   $this->value   email to be converted into link (required)
bool   $checkemail   switch defining if function needs to check if email is valid.

[ Top ]

method IsAbsolute [line 98]

bool IsAbsolute( string $this->value)

Abslute link detection function

This function is used to check if a link is absolute or not. Result is returned

  1.  <?php
  2.  $oHTMLlinks        new HTMLlinks();
  3.  $oHTMLlinks->value "http://www.foo.com";
  4.  echo $oHTMLlinks->IsAbsolute();
  5.  // 1
  6.  ?>




Tags:

return:  true if link is absolute
since:  Version 1.0


Parameters:

string   $this->value   text to be processed (required)

[ Top ]

method IsMailto [line 299]

bool IsMailto( string $this->value)

Mailto detection function

This function is used to determine if the link is a mailto link. Result is returned

  1.  <?php
  2.  $oHTMLlinks        new HTMLlinks();
  3.  $oHTMLlinks->value "mailto:pvienne@me.com";
  4.  echo $oHTMLlinks->IsMailto();
  5.  // 1
  6.  ?>




Tags:

return:  true if link is a mailto
since:  version 1.0


Parameters:

string   $this->value   link to be checked (required)

[ Top ]

method Protocol [line 254]

string Protocol( string $this->value)

Protocol determination function

This function is used to determine the protocole of a link by its declaration. Result is returned

  1.  <?php
  2.  $oHTMLlinks        new HTMLlinks();
  3.  $oHTMLlinks->value "http://www.foo.com/bar.php";
  4.  echo $oHTMLlinks->Protocol();
  5.  // http
  6.  ?>




Tags:

return:  protocol of the link
since:  version 1.0


Parameters:

string   $this->value   url to be checked (required)

[ Top ]

method Relative2Absolute [line 131]

string Relative2Absolute( string $relative, [string $location = ""])

Relative to absolute transformation function

This function is used to transform a relative link to an absolute. Result is stored in $this->value and returned

  1.  <?php
  2.  $oHTMLlinks new HTMLlinks();
  3.  $relative   "/bar.php";
  4.  $location   "http://www.foo.com/dir1/index.php";
  5.  echo $oHTMLlinks->Relative2Absolute($relative,$location);
  6.  // http://www.foo.com/bar.php
  7.  ?>




Tags:

return:  absolute link
since:  version 1.0


Parameters:

string   $relative   relative link (required)
string   $location   location from which the link is from

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:21 +0200 by phpDocumentor 1.4.1