Syntro\SEO\Forms\SERPField
A Preview of the content in Google
- Author: Matthias Leutenegger <hello@syntro.ch>
Synopsis
class SERPField
extends DatalessField
{
- // constants
- const GOOGLE_MAX_TITLE_LENGTH = 70;
- const GOOGLE_MAX_DESCRIPTION_LENGTH = 160;
- // methods
- public void __construct()
- public string getMetaTitle()
- public string getHostCrumb()
- public string getMetaDescription()
- public mixed highlight()
- public boolean contains()
- public ArrayList getCrumbs()
Hierarchy
Extends
- SilverStripe\Forms\DatalessField
Constants
Name | Value |
---|---|
GOOGLE_MAX_TITLE_LENGTH | 70 |
GOOGLE_MAX_DESCRIPTION_LENGTH | 160 |
Members
private
- $casting
—
array
Ensures that the methods are wrapped in the correct type and values are safely escaped while rendering in the template.
protected
- $focus — string
- $link — string
Methods
public
- __construct() — __construct - constructor
- contains() — Checks if a string is present in a haystack
- getCrumbs() — getCrumbs - returns the crumbs
- getHostCrumb() — getHostCrumb - returns the first crumb
- getMetaDescription() — getMetaDescription - returns the descriptionthat google will show
- getMetaTitle() — getMetaTitle - returns the meta title detected in the page
- highlight() — Highlights parts of the $haystack that match the focus keyword as a whole, case insensitive