本文整理匯總了PHP中Campaign::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP Campaign::load方法的具體用法?PHP Campaign::load怎麽用?PHP Campaign::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Campaign
的用法示例。
在下文中一共展示了Campaign::load方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: build
/**
* @param Campaign $campaign
* @param $locale
* @return string
*/
public function build(Campaign $campaign, $locale)
{
//it's simple, just load all the shit! :-)
$campaign->load(['translations', 'widgets', 'widgets.translations', 'widgets.resource', 'widgets.otherResource', 'widgets.image', 'widgets.imageLeft', 'widgets.imageRight']);
$campaign->widgets->setData();
$translation = $campaign->translate($locale);
return view('marketing::newsletter.campaign', ['translation' => $translation, 'campaign' => $campaign, 'locale' => $locale])->render();
}
示例2: loadModel
/**
* Override of {@link CommonControllerBehavior::loadModel()}; expected
* behavior is in this case deference to the campaign model's
* {@link Campagin::load()} function.
*
* @param type $id
* @return type
*/
public function loadModel($id)
{
return Campaign::load($id);
}