sanssendecom / lottery-result-bundle
针对土耳其彩票的 Symfony LotteryResultBundle,使用 Curl 操作 millipiyango.gov.tr
1.0.1
2018-07-20 14:05 UTC
This package is not auto-updated.
Last update: 2024-09-28 18:26:36 UTC
README
针对土耳其彩票的 Symfony LotteryResultBundle,使用 Curl 操作 millipiyango.gov.tr
这是一个由 http://www.sanssende.com 创建和开发的 symfony bundle。
当前版本为不稳定(不稳定)版本,即使所有结构都在运行,也可能存在类和/或方法名称不匹配的问题。在后续更新中,类和/或方法名称可能会更改。一旦达到稳定版本,将分享其工作方式。
使用 Composer 安装
在 composer.json 文件中,将以下定义添加到 require 键的下面。
# composer.json "require": { "sanssendecom/lottery-result-bundle": "1.0.*@dev" },
激活 Bundle
# app/AppKernel.php $bundles = array( new Sanssendecom\LotteryResultBundle\LotteryResultBundle() );
服务使用
# app/config/services.yml imports: - { resource: @LotteryResultBundle/Resources/config/services.yml }
在上面的文件中导入服务后,您可以访问该服务,下面有一个使用示例。
$lottery = $this->get('lottery'); $sayisallotoResult = $lottery->setOption('SAYISALLOTO', new \DateTime('2015-04-25'))->getResultClass(); $sanstopuResult = $lottery->setOption('SANSTOPU', new \DateTime('2015-05-06'))->getResultClass()
抽奖券抽取
以下示例中,您可以获取类似以下的全国彩票抽奖结果。
$lottery = $this->get('lottery'); $result = $lottery->setOption('PIYANGO', new \DateTime('2015-05-09'))->getResultClass();
控制器访问
通过以下定义,您可以通过 "/lottery" 地址访问索引页面,从而测试 Bundle。
# app/config/routing.yml _lottey_result_bundle: resource: "@LotteryResultBundle/Resources/config/routing.yml"