<?php
/**
* card 卡片显示控制
*/
class DisplayService
{
const DISPLAY_NONE = 'none';#隐藏
const DISPLAY_BLOCK = 'block';#显示
private $pipe_rst = [];
private $return;
public function getReturn()
{
return $this->return;
}
/**
* 获取运行结果
* @return array
*/
public function getRunRst()
{
return $this->pipe_rst;
}
/**
* 查看是否全部为true
* @return bool
*/
public function accordTrue()
{
foreach ($this->pipe_rst as $rst)
{
if(!$rst) return false;
}
return true;
}
/**
* 柔和函数 参数是 逗号分割的字符串 且函数 自己保证存在性
* @param $filter
*/
public function parseFilterPipe($filter)
{
if (empty($filter) || !($filter_arr = explode(',', $filter))) {
return false;
}
$filter_arr = array_reverse($filter_arr);
return array_reduce($fil
card控制显示函数类
最新推荐文章于 2022-07-22 11:14:06 发布
本文介绍如何在PHP中创建一个函数,用于控制卡片式的数据显示。通过这个函数,你可以轻松地实现显示或隐藏卡片内容,提升网页动态交互体验。
摘要由CSDN通过智能技术生成