blob: 927be0c391d4323a132f385de1694a7c6f3474e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php
/**
* Created by PhpStorm.
* User: marcin
* Date: 07/12/17
* Time: 10:33
*/
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use SoapClient;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class TrainScheduleController extends Controller
{
/**
* @Route("/TrainSchedule")
*/
public function GetSchedule()
{
$client = new SoapClient( "http://traindata.dsb.dk/stationdeparture/Service.asmx?WSDL" );
$params = array( 'request' => array( 'UICNumber' => '8600617' ) );
$response = $client->GetStationQueue( $params );
$data = $response->GetStationQueueResult->Trains->Queue;
$parametersToTwig = array("data" => $data);
return $this->render('default/TrainSchedule.html.twig',$parametersToTwig);
}
}
|