Свойство | Type | Description | |
---|---|---|---|
$intent | Tweet Web Intent | ||
$size | Large is currently the only supported size. |
Méthode | Description | |
---|---|---|
__construct ( boolean $validate = true ) | Create a new button. Initialize the web intent. | |
addHashtag ( string $hashtag ) : __CLASS__ | Add a hashtag | |
addRelated ( string $username, string $label = '' ) : __CLASS__ | Add a related Twitter account | |
fromArray ( array $options ) : __CLASS__ | Create a Tweet button from an associative array | |
setInReplyTo ( string $tweet_id ) : __CLASS__ | Define a parent Tweet by ID | |
setIntent ( |
Set a new intent | |
setSize ( string $size ) : __CLASS__ | Set the size of the Tweet button | |
setText ( string $text ) : __CLASS__ | Pre-populate Tweet text | |
setURL ( string $url ) : __CLASS__ | Share a URL | |
setVia ( string $username ) : __CLASS__ | Associate Tweet with a source account | |
toArray ( ) : array | Return Tweet button parameters suitable | |
toHTML ( string $anchor_text = 'Tweet', string $html_builder_class = '\Twitter\Helpers\HTMLBuilder' ) : string | Tweet button HTML |
public __construct ( boolean $validate = true ) | ||
$validate | boolean | Validate inputs such as screen |
public addHashtag ( string $hashtag ) : __CLASS__ | ||
$hashtag | string | hashtag |
Résultat | __CLASS__ | support chaining |
public addRelated ( string $username, string $label = '' ) : __CLASS__ | ||
$username | string | Twitter username |
$label | string | brief description of how the account relates to the Tweet content |
Résultat | __CLASS__ | support chaining |
public setInReplyTo ( string $tweet_id ) : __CLASS__ | ||
$tweet_id | string | Parent Tweet ID |
Résultat | __CLASS__ | support chaining |
public setIntent ( |
||
$intent | Tweet Intent | |
Résultat | __CLASS__ | support chaining |
public toHTML ( string $anchor_text = 'Tweet', string $html_builder_class = '\Twitter\Helpers\HTMLBuilder' ) : string | ||
$anchor_text | string | inner text of the generated anchor element. Default: Tweet |
$html_builder_class | string | callable HTML builder with a static anchorElement class |
Résultat | string | HTML markup |