mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-09 07:33:06 -06:00
40 lines
921 B
PHP
40 lines
921 B
PHP
<?php
|
|
|
|
use Firefly\Helper\Controllers\SearchInterface as SI;
|
|
|
|
/**
|
|
* Class SearchController
|
|
*/
|
|
class SearchController extends BaseController
|
|
{
|
|
protected $_helper;
|
|
|
|
public function __construct(SI $helper)
|
|
{
|
|
$this->_helper = $helper;
|
|
|
|
}
|
|
|
|
/**
|
|
* Results always come in the form of an array [results, count, fullCount]
|
|
*/
|
|
public function index()
|
|
{
|
|
$subTitle = null;
|
|
if (!is_null(Input::get('q'))) {
|
|
$rawQuery = trim(Input::get('q'));
|
|
$words = explode(' ', $rawQuery);
|
|
$subTitle = 'Results for "' . e($rawQuery) . '"';
|
|
|
|
/*
|
|
* Search for transactions:
|
|
*/
|
|
$result = $this->_helper->transactions($words);
|
|
|
|
}
|
|
|
|
return View::make('search.index')->with('title', 'Search')->with('subTitle', $subTitle)->with(
|
|
'mainTitleIcon', 'fa-search'
|
|
);
|
|
}
|
|
} |