Get plain text for a given text
public static convertToPlainText ( string $text, boolean $includeAHrefs = true, boolean $includeImgAlts = true ) : string | ||
$text | string | The text to convert. |
$includeAHrefs | boolean | Should the url be appended after the link-text? |
$includeImgAlts | boolean | Should the alt tag be inserted for images? |
return | string |
/** * Default constructor. * * @param string $title The title for the item. * @param string $link The link for the item. * @param string $description The content for the item. */ public function __construct($title, $link, $description) { // set UTM-campaign $this->utm['utm_campaign'] = CommonUri::getUrl($title); // convert to plain text $description = FrontendModel::convertToPlainText($description); // set title $this->setSummary($title); // set url $this->setUrl(FrontendModel::addURLParameters($link, $this->utm)); // set description $this->setDescription($this->processLinks($description)); // set identifier $this->setUniqueIdentifier(md5($link)); // build properties $properties['X-GOOGLE-CALENDAR-CONTENT-TITLE'] = $title; $properties['X-GOOGLE-CALENDAR-CONTENT-ICON'] = SITE_URL . '/favicon.ico'; $properties['X-GOOGLE-CALENDAR-CONTENT-URL'] = $this->getUrl(); // set properties $this->setXProperties($properties); }