See http://github.com/josegonzalez/sanction for more details
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
<?php | |
class SearchableHelper extends AppHelper { | |
var $helpers = array('Html', 'Text'); | |
function snippets($data) { | |
$data = json_decode($data, true); | |
$term = (isset($this->data['SearchIndex']['term'])) ? trim($this->data['SearchIndex']['term']) : ''; | |
$snippets = ''; | |
while (strlen($snippets) < 255 && $value = next($data)) { | |
$snippets .= $this->Text->highlight($this->Text->excerpt($value, $term, 20), $term); |
See http://github.com/josegonzalez/inflection for more details
See http://github.com/josegonzalez/stylish_errors for more details
See http://github.com/josegonzalez/codebasehq-plugin for more details
NewerOlder