Created
May 29, 2011 14:15
-
-
Save mehlah/997806 to your computer and use it in GitHub Desktop.
Li3 custom filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dispatcher::applyFilter('_callable', function($self, $params, $chain) { | |
$chain = $chain->next($self, $params, $chain); | |
$chain->applyFilter('custom_filter', function($self, $params, $chain) { | |
$params['text'] = 'filtered text'; | |
return $chain->next($self, $params, $chain); | |
}); | |
return $chain; | |
}); | |
//controller action | |
public function custom_filter() { | |
$params = array('text' => 'context text'); | |
$filteredParams = $this->_filter(__METHOD__, $params, function($self, $params) { | |
return $params; | |
}); | |
var_dump($filteredParams);die; | |
return $params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment