本文整理匯總了PHP中Widget::onBeforeWrite方法的典型用法代碼示例。如果您正苦於以下問題:PHP Widget::onBeforeWrite方法的具體用法?PHP Widget::onBeforeWrite怎麽用?PHP Widget::onBeforeWrite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Widget
的用法示例。
在下文中一共展示了Widget::onBeforeWrite方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onBeforeWrite
public function onBeforeWrite()
{
parent::onBeforeWrite();
if (!$this->Title) {
$this->Title = Config::inst()->get($this->class, 'title');
}
}
示例2: onBeforeWrite
public function onBeforeWrite()
{
parent::onBeforeWrite();
if ($this->TwitterHTML) {
$hrefAndId = array();
preg_match_all('/<a.*href="(.+)".*data-widget-id="([0-9]*)".*>.*<\\/a>/U', $this->TwitterHTML, $hrefAndId);
$this->Href = isset($hrefAndId[1][0]) ? $hrefAndId[1][0] : "";
$this->TwitterWidgetID = isset($hrefAndId[2][0]) ? $hrefAndId[2][0] : "";
}
}
開發者ID:helpfulrobot,項目名稱:gdmedia-silverstripe-widget-twitter-widgets,代碼行數:10,代碼來源:TwitterWidgetsWidget.php
示例3: onBeforeWrite
public function onBeforeWrite()
{
parent::onBeforeWrite();
if (!$this->Title) {
$this->Title = Config::inst()->get($this->class, 'title');
}
if (Widget::has_extension('Versioned') && Versioned::current_stage() == 'Stage') {
$this->publishAfterWrite = true;
}
}
示例4: onBeforeWrite
public function onBeforeWrite()
{
parent::onBeforeWrite();
if (!$this->Sort) {
$parentID = $this->ParentID ? $this->ParentID : 0;
$this->Sort = DB::query("SELECT MAX(\"Sort\") + 1 FROM \"Widget\" WHERE \"ParentID\" = {$parentID}")->value();
}
if ($this->MoveToListID) {
$this->ListID = $this->MoveToListID;
}
}