openbuildings / jam-generated-feed
此包已被废弃且不再维护。未建议替代包。
一个基于 jam 集合生成 xml 文件的模块
0.1.5
2016-09-18 09:02 UTC
Requires
- php: >=5.3.0
- composer/installers: *
- kohana/minion: ^3.3
Requires (Dev)
- openbuildings/environment-backup: 0.1.*
- openbuildings/jam: ^0.5.13
- openbuildings/kohana-test-bootstrap: ^0.2.0
- phpunit/phpunit: ^4.0, <4.5
This package is not auto-updated.
Last update: 2020-01-24 15:11:13 UTC
README
一个模块,用于通过 minion 任务根据 jam 集合生成 xml 文件
使用方法
您需要将配置添加到 config/jam-generated-feed.php 文件中
return array( // Each key is a "name" of the feed, will be used when generating a new one 'products-uk' => array( // Jam model for the collection 'model' => 'product' // Optional filter that will be applied to the collection (in the form of $collection->{$filter_name}()) 'filter' => 'feed_products_uk', // What view to use to generate the feed. It would be passed a $collection variable with the Jam Collection 'view' => 'feeds/products-uk', // Where to output the file, prepends DOCROOT, overwrites 'file' => 'feeds/products-uk.xml', ), );
使用任务
minion feed:generate --name=products-uk
Generating {"model":"product","filter":"feed_products_uk","view":"feeds\/products-uk","file":"feeds/products-uk.xml","name":"products-uk"}
Done.
Saving feed content to DOCROOT/test_file.xml
Done.
许可证
版权所有 (c) 2012-2013, OpenBuildings Ltd. 由 Ivan Kerin 在 clippings.com 开发
在 BSD-3-Clause 许可下,请参阅 LICENSE 文件。