+ zin: add backBtn widget.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The backBtn widget class file of zin module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author sunhao<sunhao@easycorp.ltd>
|
||||
* @package zin
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
require_once dirname(__DIR__) . DS . 'btn' . DS . 'v1.php';
|
||||
|
||||
/**
|
||||
* 后退按钮(backBtn)部件类。
|
||||
* The back button widget class.
|
||||
*
|
||||
* @author Hao Sun
|
||||
*/
|
||||
class backBtn extends btn
|
||||
{
|
||||
/**
|
||||
* Define widget properties.
|
||||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
*/
|
||||
static $defineProps = array
|
||||
(
|
||||
'back?: string="back"' // 定义返回行为,可以为 `'back'`(返回打开当前页面时的上一个历史记录)、 `'global'`(返回上一个全局历史记录)、`'moduleName-methodName'`(从历史记录中向后查找符合指定路径的历史记录)。
|
||||
);
|
||||
|
||||
/**
|
||||
* Override the getProps method.
|
||||
*
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function getProps(): array
|
||||
{
|
||||
$props = parent::getProps();
|
||||
$props['data-back'] = $this->prop('back');
|
||||
return $props;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user