本文整理汇总了PHP中Zend\Filter\FilterChain::addFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP FilterChain::addFilter方法的具体用法?PHP FilterChain::addFilter怎么用?PHP FilterChain::addFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Filter\FilterChain
的用法示例。
在下文中一共展示了FilterChain::addFilter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _convertTableNameToClassName
protected function _convertTableNameToClassName($tableName)
{
if ($this->_nameFilter == null) {
$this->_nameFilter = new \Zend\Filter\FilterChain();
$this->_nameFilter->addFilter(new \Zend\Filter\Word\UnderscoreToCamelCase());
}
return $this->_nameFilter->filter($tableName);
}
示例2: normalizeTag
/**
* Normalize tag
*
* Ensures tag is alphanumeric characters only, and all lowercase.
*
* @param string $tag
* @return string
*/
public function normalizeTag($tag)
{
if (!isset($this->_tagFilter)) {
$this->_tagFilter = new Filter\FilterChain();
$this->_tagFilter->addFilter(new Filter\Alnum())->addFilter(new Filter\StringToLower());
}
return $this->_tagFilter->filter($tag);
}
示例3: testFilterOrder
/**
* Ensures that filters are executed in the expected order (FIFO)
*
* @return void
*/
public function testFilterOrder()
{
$filter = new FilterChain();
$filter->addFilter(new LowerCase())->addFilter(new StripUpperCase());
$value = 'AbC';
$valueExpected = 'abc';
$this->assertEquals($valueExpected, $filter($value));
}
示例4: addDefaultFilter
/**
* Add a default filter
*
* @param string $filter
*
* @return void
*/
public function addDefaultFilter(Filter\Filter $filter, $placement = Filter\FilterChain::CHAIN_APPEND)
{
if (!$this->_defaultFilter instanceof Filter\FilterChain) {
$defaultFilter = new Filter\FilterChain();
$defaultFilter->addFilter($filter);
$this->_defaultFilter = $defaultFilter;
}
$this->_defaultFilter->addFilter($filter, $placement);
}