PHPackages                             njxzwh/pcsoftsuperview - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. njxzwh/pcsoftsuperview

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

njxzwh/pcsoftsuperview
======================

A simple CMS content helper.

v1(4y ago)021MITPHPPHP ~5.6|~7.0

Since Oct 21Pushed 4y ago2 watchersCompare

[ Source](https://github.com/matnanako/pcsoft_superview)[ Packagist](https://packagist.org/packages/njxzwh/pcsoftsuperview)[ RSS](/packages/njxzwh-pcsoftsuperview/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

superview
=========

[](#superview)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1c312cc80f72ae811cad9b9f5caae47748c0ea1ae409956b31f0f77acadd7c39/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f787a77682f7375706572766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xzwh/superview)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/63da06a4d95f1a8c0704b1823fd64992153773b63f30bf8d26ca434a4240b0a8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f787a77682f7375706572766965772f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/xzwh/superview)[![Coverage Status](https://camo.githubusercontent.com/35a2372fbc6975be1bc9006367ccdc497fd5531f9b1c914a59dae89720aaec94/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f787a77682f7375706572766965772e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/xzwh/superview/code-structure)[![Quality Score](https://camo.githubusercontent.com/a761049bb3f85d22cd77341535890823f8fa0ff106ce849de570241dfc262695/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f787a77682f7375706572766965772e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/xzwh/superview)[![Total Downloads](https://camo.githubusercontent.com/f4160ecf8d55b6b4450b1a353793a68c1efcf2ecfc30c9c4c46a89dc237ccdd6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f787a77682f7375706572766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xzwh/superview)

Install
-------

[](#install)

Via Composer

```
$ composer require "njxzwh/superview @dev"
```

Usage
-----

[](#usage)

```
SuperView::setConfig($configs);
SuperView::get('soft')->recent();
```

### 使用缓存

[](#使用缓存)

缓存默认使用全局配置`cache_minutes`, 如果需要为单独的请求设置缓存时间, 可以使用cache方法, 参数为分钟.

```
SuperView::get('soft')->cache(10)->recent();
```

如果需要修改所有的查询都为设置的缓存时间, 可以使用第二个参数, 缓存时间将一直保留, 直到下一次设置cache.

```
SuperView::get('soft')->cache(10, true)->recent();
SuperView::get('soft')->recent(); //仍然使用上面的缓存时间

SuperView::get('soft')->cache(20)->recent(); //使用新的缓存时间, 并且只在当前调用中
```

### 使用分页

[](#使用分页)

#### 所有支持limit参数的方法都可以使用分页

[](#所有支持limit参数的方法都可以使用分页)

第一个参数用来生成分页的url, 应该与路由格式保持一致. 第二个参数指定当前分页.

```
SuperView::get('soft')->page('list-{page}.html', $page)->recent();
```

使用指定分页和自定义的布局, 第二个参数指定分页, 第三个参数指定是否使用简洁模式(默认`false`), 第四个参数参考Configs下的`pagination`.

```
SuperView::get('soft')->page('list-{page}.html', 2, false,
    [
        'layout' => '{total}{previous}{links}{next}',
        'total' => '共{total}页',
        'previous' => '上一页',
        'links' => '{page}',
        'link_active' => '{page}',
        'next' => '下一页',
        'dots' => '
