Свойство | Type | Description | |
---|---|---|---|
$class_cash | string | CSS class for auto-linked cashtag URLs. | |
$class_hash | string | CSS class for auto-linked hashtag URLs. | |
$class_list | string | CSS class for auto-linked list URLs. | |
$class_url | string | CSS class for auto-linked URLs. | |
$class_user | string | CSS class for auto-linked username URLs. | |
$external | boolean | Often this is used to be matched on in JavaScript for dynamically adding the 'target' attribute which is deprecated in HTML 4.01. In HTML 5 it has been undeprecated and thus the 'target' attribute can be used. If this is set to false then the 'target' attribute will be output. | |
$nofollow | boolean | Whether to include the value 'nofollow' in the 'rel' attribute. | |
$target | string | Support for the 'target' attribute was deprecated in HTML 4.01 but has since been reinstated in HTML 5. To output the 'target' attribute you must disable the adding of the string 'external' to the 'rel' attribute. | |
$url_base_cash | string | URL base for cashtag links (the hashtag without the $ will be appended). | |
$url_base_hash | string | URL base for hashtag links (the hashtag without the # will be appended). | |
$url_base_list | string | URL base for list links (the username/list without the @ will be appended). | |
$url_base_user | string | URL base for username links (the username without the @ will be appended). |
Méthode | Description | |
---|---|---|
__construct ( string $tweet, boolean $escape = true, boolean $full_encode = false ) | Reads in a tweet to be parsed and converted to contain links. | |
addLinks ( ) : string | Adds links to all elements in the tweet. | |
addLinksToCashtags ( ) : string | Adds links to cashtag elements in the tweet. | |
addLinksToHashtags ( ) : string | Adds links to hashtag elements in the tweet. | |
addLinksToURLs ( ) : string | Adds links to URL elements in the tweet. | |
addLinksToUsernamesAndLists ( ) : string | Adds links to username/list elements in the tweet. | |
create ( string $tweet, boolean $full_encode = false ) : Twitter_Autolink | Provides fluent method chaining. | |
getCashtagClass ( ) : string | CSS class for auto-linked cashtag URLs. | |
getExternal ( ) : boolean | Whether to include the value 'external' in the 'rel' attribute. | |
getHashtagClass ( ) : string | CSS class for auto-linked hashtag URLs. | |
getListClass ( ) : string | CSS class for auto-linked username/list URLs. | |
getNoFollow ( ) : boolean | Whether to include the value 'nofollow' in the 'rel' attribute. | |
getTarget ( ) : string | The scope to open the link in. | |
getURLClass ( ) : string | CSS class for auto-linked URLs. | |
getUsernameClass ( ) : string | CSS class for auto-linked username URLs. | |
setCashtagClass ( string $v ) : Twitter_Autolink | CSS class for auto-linked cashtag URLs. | |
setExternal ( boolean $v ) : Twitter_Autolink | Whether to include the value 'external' in the 'rel' attribute. | |
setHashtagClass ( string $v ) : Twitter_Autolink | CSS class for auto-linked hashtag URLs. | |
setListClass ( string $v ) : Twitter_Autolink | CSS class for auto-linked username/list URLs. | |
setNoFollow ( boolean $v ) : Twitter_Autolink | Whether to include the value 'nofollow' in the 'rel' attribute. | |
setTarget ( string $v ) : Twitter_Autolink | The scope to open the link in. | |
setURLClass ( string $v ) : Twitter_Autolink | CSS class for auto-linked URLs. | |
setUsernameClass ( string $v ) : Twitter_Autolink | CSS class for auto-linked username URLs. |
Méthode | Description | |
---|---|---|
_addLinksToCashtags ( array $matches ) : string | Callback used by the method that adds links to cashtags. | |
_addLinksToHashtags ( array $matches ) : string | Callback used by the method that adds links to hashtags. | |
_addLinksToURLs ( array $matches ) : string | Callback used by the method that adds links to URLs. | |
_addLinksToUsernamesAndLists ( array $matches ) : string | Callback used by the method that adds links to username/list pairs. | |
wrap ( string $url, string $class, string $element ) : string | Wraps a tweet element in an HTML anchor tag using the provided URL. | |
wrapHash ( string $url, string $class, string $element ) : string | Wraps a tweet element in an HTML anchor tag using the provided URL. |
protected _addLinksToCashtags ( array $matches ) : string | ||
$matches | array | The regular expression matches. |
Résultat | string | The link-wrapped cashtag. |
protected _addLinksToHashtags ( array $matches ) : string | ||
$matches | array | The regular expression matches. |
Résultat | string | The link-wrapped hashtag. |
protected _addLinksToURLs ( array $matches ) : string | ||
$matches | array | The regular expression matches. |
Résultat | string | The link-wrapped URL. |
protected _addLinksToUsernamesAndLists ( array $matches ) : string | ||
$matches | array | The regular expression matches. |
Résultat | string | The link-wrapped username/list pair. |
public addLinksToCashtags ( ) : string | ||
Résultat | string | The modified tweet. |
public addLinksToHashtags ( ) : string | ||
Résultat | string | The modified tweet. |
public addLinksToURLs ( ) : string | ||
Résultat | string | The modified tweet. |
public addLinksToUsernamesAndLists ( ) : string | ||
Résultat | string | The modified tweet. |
public getCashtagClass ( ) : string | ||
Résultat | string | CSS class for cashtag links. |
public getExternal ( ) : boolean | ||
Résultat | boolean | Whether to add 'external' to the 'rel' attribute. |
public getHashtagClass ( ) : string | ||
Résultat | string | CSS class for hashtag links. |
public getListClass ( ) : string | ||
Résultat | string | CSS class for username/list links. |
public getNoFollow ( ) : boolean | ||
Résultat | boolean | Whether to add 'nofollow' to the 'rel' attribute. |
public getURLClass ( ) : string | ||
Résultat | string | CSS class for URL links. |
public getUsernameClass ( ) : string | ||
Résultat | string | CSS class for username links. |
public setCashtagClass ( string $v ) : Twitter_Autolink | ||
$v | string | CSS class for cashtag links. |
Résultat | Twitter_Autolink | Fluid method chaining. |
public setExternal ( boolean $v ) : Twitter_Autolink | ||
$v | boolean | The value to add to the 'target' attribute. |
Résultat | Twitter_Autolink | Fluid method chaining. |
public setHashtagClass ( string $v ) : Twitter_Autolink | ||
$v | string | CSS class for hashtag links. |
Résultat | Twitter_Autolink | Fluid method chaining. |
public setListClass ( string $v ) : Twitter_Autolink | ||
$v | string | CSS class for username/list links. |
Résultat | Twitter_Autolink | Fluid method chaining. |
public setNoFollow ( boolean $v ) : Twitter_Autolink | ||
$v | boolean | The value to add to the 'target' attribute. |
Résultat | Twitter_Autolink | Fluid method chaining. |
public setURLClass ( string $v ) : Twitter_Autolink | ||
$v | string | CSS class for URL links. |
Résultat | Twitter_Autolink | Fluid method chaining. |
public setUsernameClass ( string $v ) : Twitter_Autolink | ||
$v | string | CSS class for username links. |
Résultat | Twitter_Autolink | Fluid method chaining. |
protected string $class_cash | ||
Résultat | string |
protected string $class_hash | ||
Résultat | string |
protected string $class_list | ||
Résultat | string |
protected string $class_url | ||
Résultat | string |
protected string $class_user | ||
Résultat | string |
protected bool $external | ||
Résultat | boolean |
protected bool $nofollow | ||
Résultat | boolean |
protected string $target | ||
Résultat | string |
protected string $url_base_cash | ||
Résultat | string |
protected string $url_base_hash | ||
Résultat | string |
protected string $url_base_list | ||
Résultat | string |
protected string $url_base_user | ||
Résultat | string |