프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$ALLOWED_SIZES | Allowed values for the size property |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$intent | Follow Web Intent | ||
$show_count | Show the current number of followers alongside the button | ||
$show_screen_name | Show or hide the screen name of the account | ||
$size | Size of the button |
메소드 | 설명 | |
---|---|---|
__construct ( string $screen_name, boolean $validate = true ) | Require screen name. Initialize Follow Web Intent | |
fromArray ( array $options ) : __CLASS__ | Build a Follow button object from an associative array | |
getScreenName ( ) : string | Return the screen name of the Twitter user | |
hideCount ( ) : __CLASS__ | Show only the Follow button, without a follower count | |
hideScreenName ( ) : __CLASS__ | Hide the screen name from display inside the Follow button | |
setSize ( string $size ) : __CLASS__ | Set the desired size of the Follow button | |
showCount ( ) : __CLASS__ | Show the number of followers alongside the Follow button | |
showScreenName ( ) : __CLASS__ | Show the screen name to follow inside the Follow button | |
toArray ( ) : array | Convert the class object into an array, removing default field values | |
toHTML ( string $anchor_text = 'Follow %s', string $html_builder_class = '\Twitter\Helpers\HTMLBuilder' ) : string | Generate HTML to encourage follow behavior and expose data to the Twitter for Websites JavaScript |
public __construct ( string $screen_name, boolean $validate = true ) | ||
$screen_name | string | Twitter account name |
$validate | boolean | validate screen name matches Twitter username allowed characters and length before saving |
public getScreenName ( ) : string | ||
리턴 | string | Twitter screen name, or blank string if no screen name stored |
public hideCount ( ) : __CLASS__ | ||
리턴 | __CLASS__ | support chaining |
public hideScreenName ( ) : __CLASS__ | ||
리턴 | __CLASS__ | support chaining |
public showCount ( ) : __CLASS__ | ||
리턴 | __CLASS__ | support chaining |
public showScreenName ( ) : __CLASS__ | ||
리턴 | __CLASS__ | support chaining |
public toHTML ( string $anchor_text = 'Follow %s', string $html_builder_class = '\Twitter\Helpers\HTMLBuilder' ) : string | ||
$anchor_text | string | inner text of the generated anchor element. Supports a single '%s' screen name passed through sprintf. Default: Follow %s |
$html_builder_class | string | callable HTML builder with a static anchorElement class |
리턴 | string | HTML markup or empty string if minimum requirements not met |
protected $show_count |
protected $show_screen_name |