本文整理匯總了PHP中ProductCategory::config方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProductCategory::config方法的具體用法?PHP ProductCategory::config怎麽用?PHP ProductCategory::config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProductCategory
的用法示例。
在下文中一共展示了ProductCategory::config方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
public function setUp()
{
parent::setUp();
ProductCategory::config()->must_have_price = false;
$this->products = $this->objFromFixture('ProductCategory', 'products');
$this->products->publish('Stage', 'Live');
$this->clothing = $this->objFromFixture('ProductCategory', 'clothing');
$this->clothing->publish('Stage', 'Live');
$this->electronics = $this->objFromFixture('ProductCategory', 'electronics');
$this->electronics->publish('Stage', 'Live');
$this->socks = $this->objFromFixture('Product', 'socks');
$this->socks->publish('Stage', 'Live');
$this->tshirt = $this->objFromFixture('Product', 'tshirt');
$this->tshirt->publish('Stage', 'Live');
$this->hdtv = $this->objFromFixture('Product', 'hdtv');
$this->hdtv->publish('Stage', 'Live');
$this->beachball = $this->objFromFixture('Product', 'beachball');
$this->beachball->publish('Stage', 'Live');
$this->mp3player = $this->objFromFixture('Product', 'mp3player');
$this->mp3player->publish('Stage', 'Live');
Versioned::reading_stage('Live');
}
示例2: getSorter
/**
* Sorting controls
*
* @return ListSorter sorter
*/
public function getSorter()
{
$options = array();
foreach (ProductCategory::config()->sort_options as $k => $v) {
// make the label translatable
$k = _t("ProductCategory.{$k}", $k);
$options[$k] = $v;
}
$sorter = ListSorter::create($this->request, $options);
$this->extend('updateSorter', $sorter);
return $sorter;
}
示例3: getSorter
/**
* Sorting controls
* @return ListSorter sorter
*/
public function getSorter()
{
$sorter = new ListSorter($this->request, ProductCategory::config()->sort_options);
$this->extend('updateSorter', $sorter);
return $sorter;
}