本文整理汇总了PHP中Filter::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::run方法的具体用法?PHP Filter::run怎么用?PHP Filter::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter
private function filter()
{
$input = Filter::run(strip_tags(parent::getVar('input')));
$find = array(' ', '#', '?', '&', '.', '!', '"', '§', '$', '%', '(', ')', '=', '*', '+', '~', '-', ':', ';', '>');
$input = str_replace($find, '', $input);
echo $input;
}
示例2: testrunArrayClassStaticMethod
public function testrunArrayClassStaticMethod()
{
Filter::register('test_filter2', array('TestFilterClass', 'testArrayFilter'));
$testvalues = array('testvalue1', 'testvalue2');
$temp = Filter::run('test_filter2', array($testvalues));
$this->assertEquals(3, sizeof($temp));
$this->assertEquals('testvalue3', $temp[2]);
}
示例3: make
public static function make($results, $filters)
{
$filter = new Filter($results, $filters);
$filter->run();
return $filter->getResults();
}
示例4: data
public function data()
{
$data = array();
if (property_exists($this->info, 'filters')) {
foreach ($this->info->filters as $filter) {
// Make the params to pass to the filter
$params = array();
// See if the filter has params available
if (property_exists($filter, 'params')) {
foreach ($filter->params as $param) {
if (property_exists($param, 'pageParam')) {
$params[dash($param->filterParam)] = $this->params[$param->pageParam];
}
// If we're basing this off a filter, param the ID
if (property_exists($param, 'fromFilter')) {
$value = $data[dash($param->fromFilter)];
// If the previous filter returned a group of records
if (is_array($value)) {
$ids = array();
foreach ($value as $record) {
$ids[] = $record->id;
}
$params[dash($param->filterParam)] = $ids;
} else {
$params[dash($param->filterParam)] = $value->id;
}
}
}
}
// Initialize a filter
$filter = new Filter($filter->name);
$data[$filter->varName()] = $filter->run($params);
}
}
return $data;
}