PHP 클래스 Twitter\Widgets\Buttons\Follow

부터: 1.0.0
상속: extends Twitter\Widgets\BaseWidget
파일 보기 프로젝트 열기: twitter/wordpress 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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

메소드 상세

__construct() 공개 메소드

Require screen name. Initialize Follow Web Intent
부터: 1.0.0
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

fromArray() 공개 정적인 메소드

Build a Follow button object from an associative array
부터: 1.0.0
public static fromArray ( array $options ) : __CLASS__
$options array associative array of options { @type string option name @type string|int|bool option value }
리턴 __CLASS__ support chaining

getScreenName() 공개 메소드

Return the screen name of the Twitter user
부터: 1.0.0
public getScreenName ( ) : string
리턴 string Twitter screen name, or blank string if no screen name stored

hideCount() 공개 메소드

Show only the Follow button, without a follower count
부터: 1.0.0
public hideCount ( ) : __CLASS__
리턴 __CLASS__ support chaining

hideScreenName() 공개 메소드

Hide the screen name from display inside the Follow button
부터: 1.0.0
public hideScreenName ( ) : __CLASS__
리턴 __CLASS__ support chaining

setSize() 공개 메소드

Set the desired size of the Follow button
부터: 1.0.0
public setSize ( string $size ) : __CLASS__
$size string button size
리턴 __CLASS__ support chaining

showCount() 공개 메소드

Show the number of followers alongside the Follow button
부터: 1.0.0
public showCount ( ) : __CLASS__
리턴 __CLASS__ support chaining

showScreenName() 공개 메소드

Show the screen name to follow inside the Follow button
부터: 1.0.0
public showScreenName ( ) : __CLASS__
리턴 __CLASS__ support chaining

toArray() 공개 메소드

Convert the class object into an array, removing default field values
부터: 1.0.0
public toArray ( ) : array
리턴 array properties as associative array

toHTML() 공개 메소드

Generate HTML to encourage follow behavior and expose data to the Twitter for Websites JavaScript
부터: 1.0.0
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

프로퍼티 상세

$ALLOWED_SIZES 공개적으로 정적으로 프로퍼티

Allowed values for the size property
부터: 1.0.0
public static $ALLOWED_SIZES

$intent 보호되어 있는 프로퍼티

Follow Web Intent
부터: 1.0.0
protected $intent

$show_count 보호되어 있는 프로퍼티

Show the current number of followers alongside the button
부터: 1.0.0
protected $show_count

$show_screen_name 보호되어 있는 프로퍼티

Show or hide the screen name of the account
부터: 1.0.0
protected $show_screen_name

$size 보호되어 있는 프로퍼티

Size of the button
부터: 1.0.0
protected $size