superrb/kunstmaan-stockists-finder
最新稳定版本:0.1.1
Composer 安装命令:
composer require superrb/kunstmaan-stockists-finder
包简介
Stockists finder bundle for use with the KunstmaanBundles CMS
关键字:
README 文档
README
The KunstmaanStockistsFinderBundle is for adding a postcode search, with a list of stockists and their pins on a map.
Installation
Step 1: Install the Bundle
composer require superrb/kunstmaan-stockists-finder
Step 2: Enable the Bundle
Enable the bundle in your app/AppKernel.php for your project
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Superrb\KunstmaanStockistsFinderBundle\SuperrbKunstmaanStockistsFinderBundle(), ); // ... } // ... }
Step 3: Add the routes
Add the following to your app/config/routes.yml
superrbkunstmaanstockistsfinderbundle_stockist_admin_list: resource: "@SuperrbKunstmaanStockistsFinderBundle/Controller/StockistAdminListController.php" type: annotation prefix: /{_locale}/admin/stockist/
Remember to remove the /{_locale}/ from the admin list route if you are using single language.
Step 4: Generate Database Tables
You can use Doctrine Migrations or a schema update, it is your choice
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate
or
bin/console doctrine:schema:update --force
Step 5: Add required config
Turn on the timestampable Doctrine extension in app/config/config.yml
stof_doctrine_extensions: orm: default: timestampable: true
Usage
Outputting Stockists on the front end
bin/console assets:install --symlink
load the new js file - add the following to .groundcontrolrc
"footer": [ "web/bundles/superrbkunstmaanstockistsfinder/js/stockists-finder.js", ],
add the route
superrbkunstmaanstockistsfinderbundle_stockists_form:
pattern: /stockistsFormSubmission
defaults: { _controller: SuperrbKunstmaanStockistsFinderBundle:StockistsFinder:stockists }
Call the js function from your page
{% block scripts %}
stockistsMap();
{% endblock %}
Make sure the map dimensions are set
#map_wrapper { height: 400px; } #map_canvas { width: 100%; height: 100%; }
Add the Search parameters to your parameters.yml
stockistsfindersearchby: 'limit' stockistsfindersearchbyvalue: '4'
You can output a list of stockists on the front end simply be rendering a controller action. This could also be added to a page part template to allow more control.
{{ render_esi(controller('SuperrbKunstmaanStockistsFinderBundle:StockistsFinder:stockists', { 'limit' : 12, 'template' : 'SuperrbKunstmaanStockistsFinderBundle:StockistsFinder:stockists.html.twig' } )) }}
Issues and Troubleshooting
All issues: tech@superrb.com
统计信息
- 总下载量: 86
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-26