/** * Cerca els grups per nom i descripció segons el text introduit */ public function cercaGrups() { $text = Input::get('text'); $text = strip_tags($text); $text = trim($text); $num_gr = Grup::num_resultat($text); $grups = Grup::resultat($text); $this->layout->title = 'Workshome - Búsqueda ' . $text; $this->layout->description = 'Búsqueda de grupos'; $this->layout->content = View::make('cerca/resultat_grups', array('text' => $text, 'num_gr' => $num_gr, 'grups' => $grups)); }
public static function num_resultat($text) { return Grup::resultat($text)->count(); }