mothership-ec / cog-mothership-cp
此包已弃用且不再维护。未建议替代包。
Mothership控制面板的Cog模块
3.5.5
2015-10-23 15:07 UTC
Requires
- php: >=5.4.0
- mothership-ec/cog: ~4.0
- mothership-ec/cog-user: ~2.0
Requires (Dev)
- mockery/mockery: dev-master
- dev-develop
- 3.5.5
- 3.5.4
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 1.8.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-feature/ux/admin-rebuild
- dev-fulfillment-button-fix
- dev-master
- dev-refer-a-friend
- dev-revert-287-revert-270-feature/ux/product-create
- dev-revert-270-feature/ux/product-create
- dev-feature/ux/product-create
- dev-compatibility/stoneham
- dev-feature/ux/flash-bug
- dev-feature/ux/blog-comments
- dev-feature/ux/overhaul
- dev-feature/ajax-modal-for-forms
- dev-feature/ux/261-font-rendering
- dev-feature/ux/product-process
- dev-reports-totals
- dev-nested-accordian-collapsible
- dev-asset-relocating
- dev-sidebar-js
This package is not auto-updated.
Last update: 2021-03-22 11:07:57 UTC
README
主菜单构建
分组标记
这是内容组、可重复的组和双列组所需标记。
<!-- Normal group -->
<section class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</section>
<!-- Group grid layout -->
<section class="group-grid">
<div class="row">
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
</div>
</section>
<!-- Repeatable group -->
<section class="repeatable-group">
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
<div class="group">
<h2 class="title">Group title</h2>
<div class="content">
...
</div>
</div>
</section>
<!-- Dual column -->
<section class="dual-column">
<h2 class="title">Test title</h2>
<div class="content">
<div class="column">
...
</div>
<div class="column">
...
</div>
</div>
</section>
仪表板和统计
数据集
注册新数据集
$services->extend('statistics', function($statistics, $c) { // Simple value counter $statistics->add(new MyDataset($c['db.query'], $c['statistics.counter'], $c['statistics.range.date'])); // Key based counter $statistics->add(new MyKeyDataset($c['db.query'], $c['statistics.counter.key'], $c['statistics.range.date'])); });
class MyDataset extends AbstractDataset { public function getName() { return 'my.dataset'; } public function getPeriodLength() { return static::DAILY; } public function rebuild() { // add rebuilding sql to transaction and commit if not overridden } }
获取数据集
$dataset = $this->get('statistics')->get('my.dataset');
推送值
$dataset->counter->push($value);
通过键设置值
$dataset->counter->set($key, $value);
获取当前计数器
$dataset->counter->get(); $dataset->counter->get($key);
增加/减少
$dataset->counter->increment(); $dataset->counter->decrement($step); $dataset->counter->decrement($key); $dataset->counter->increment($key, $step);
获取值范围
// From the beginning of time $values = $dataset->range->getValues(0); // From a week ago $values = $dataset->range->getValues( $dataset->range->getWeekAgo() ); // Previous month $values = $dataset->range->getValues( $dataset->range->getMonthAgo(1), $dataset->range->getMonthAgo() );
通过键获取值范围
$data = $dataset->range->getKeyValues(0);
获取值的平均值
$monthAverage = $dataset->range->getAverage( $dataset->range->getMonthAgo() );
获取值的总和
$yearToDate = $dataset->range->getTotal( $dataset->range->getYearAgo() );