本文整理汇总了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;
}