mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 12:28:46 +00:00
First version of a search interface.
This commit is contained in:
@@ -1,16 +1,40 @@
|
||||
<?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'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user