SilverWare\Twitter\Buttons\TwitterSharingButton
An extension of the sharing button class for a Twitter sharing button.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class TwitterSharingButton
extends SharingButton
{
- // constants
- const SIZE_DEFAULT = 'default';
- const SIZE_LARGE = 'large';
- // members
- private static string $singular_name = 'Twitter Sharing Button';
- private static string $plural_name = 'Twitter Sharing Buttons';
- private static string $description = 'A sharing button to share the current page via Twitter';
- private static string $table_name = 'SilverWare_TwitterSharingButton';
- private static string $hide_ancestor = SharingButton::class;
- private static array $db = ;
- private static array $defaults = ;
- private static array $casting = ;
- private static string $link_href = 'https://twitter.com/intent/tweet';
- // methods
- public FieldList getCMSFields()
- public array fieldLabels()
- public array getButtonAttributes()
- public string getButtonAttributesHTML()
- public array getLinkClassNames()
- public string getButtonLink()
- public array getButtonSizeOptions()
Hierarchy
Extends
- SilverWare\Social\Model\SharingButton
Tasks
Line | Task |
---|---|
224+ | Add via / hashtag params to link. |
Constants
Name | Value |
---|---|
SIZE_DEFAULT | 'default' |
SIZE_LARGE | 'large' |
Members
private
- $casting
—
array
Maps field and method names to the class names of casting objects. - $db
—
array
Maps field names to field types for this object. - $defaults
—
array
Defines the default values for the fields of this object. - $description
—
string
Description of this object. - $hide_ancestor
—
string
Defines an ancestor class to hide from the admin interface. - $link_href
—
string
Defines the link href for the sharing button. - $plural_name
—
string
Human-readable plural name. - $singular_name
—
string
Human-readable singular name. - $table_name
—
string
Defines the table name to use for this object.
Methods
public
- fieldLabels() — Answers the labels for the fields of the receiver.
- getButtonAttributes() — Answers an array of HTML tag attributes for the button.
- getButtonAttributesHTML() — Answers the HTML tag attributes for the button as a string.
- getButtonLink() — Answers the link for the sharing button.
- getButtonSizeOptions() — Answers an array of options for the button size field.
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getLinkClassNames() — Answers an array of link class names for the HTML template.