wbe / searchland
该软件包最新版本(0.0.6)没有可用的许可证信息。
实时搜索
0.0.6
2018-01-30 09:33 UTC
Requires
- php: ^7.0
This package is not auto-updated.
Last update: 2024-09-22 15:05:46 UTC
README
在 Laravel 5.5 中安装
添加到 config/app.php 中
'providers' => [ Wbe\Searchland\SearchlandServiceProvider::class,
DO
php artisan vendor:publish --provider="Wbe\Searchland\SearchlandServiceProvider"
在脚本部分添加到 blade 中
@include('searchland::search.titleSearch')
添加到搜索输入类 "searchGlobal"
在输入后添加打开列表
<div class="dropdown dropdown-lg"> <div class="dropdown-menu dropdown-menu-right resultlist" role="menu" id="searchbox"> </div> </div>
如果您想自定义打开列表,请在视图文件夹中创建带有 blade 模板的 search_template.blade.php
config/search
count - 弹出搜索 URL 中的最大行数,urlname - 页面上链接的字段,datacol - 默认数据列
创建文件 config/search_tables
search_tables 文件示例
"news"=>[ "columns"=>["title", "description", "alias" ], "join"=>["news_description"=>[ "news_description.content_id", "news.id" ] ], "link"=>[ "url_add"=>"/news/", "column"=>"alias" ] ],
"table_name"=>[ "columns"=>["first_column","second_column","thread_column","link_column"], "join"=>["table_what_need_to_join"=>["what","to_what"]], - if needed "link"=>["url_add"=>"if need echo on start link","column"=>"what_column_is_link"]
如果您有两个或更多表,并且列的数量不同,则将使用具有最多列数的搜索列名称,例如
"table_1"=>["1","2","3"]
"table_2"=>["a","b","c","d"]
结果已被
需要安装 Bootstrap
composer require twbs/bootstrap