Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
ipf committed Feb 27, 2017
0 parents commit f4d8b08
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Controller/DefaultController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Subugoe\IIIFBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
public function indexAction()
{
return $this->render('SubugoeIIIFBundle:Default:index.html.twig');
}
}
29 changes: 29 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Subugoe\IIIFBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('subugoe_iiif');

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.

return $treeBuilder;
}
}
28 changes: 28 additions & 0 deletions DependencyInjection/SubugoeIIIFExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Subugoe\IIIFBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
* This is the class that loads and manages your bundle configuration.
*
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
*/
class SubugoeIIIFExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
3 changes: 3 additions & 0 deletions Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
subugoe_iiif_homepage:
path: /
defaults: { _controller: SubugoeIIIFBundle:Default:index }
4 changes: 4 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
# subugoe_iiif.example:
# class: Subugoe\IIIFBundle\Example
# arguments: ["@service_id", "plain_value", "%parameter%"]
1 change: 1 addition & 0 deletions Resources/views/Default/index.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!
9 changes: 9 additions & 0 deletions SubugoeIIIFBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Subugoe\IIIFBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class SubugoeIIIFBundle extends Bundle
{
}
17 changes: 17 additions & 0 deletions Tests/Controller/DefaultControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Subugoe\IIIFBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();

$crawler = $client->request('GET', '/');

$this->assertContains('Hello World', $client->getResponse()->getContent());
}
}

0 comments on commit f4d8b08

Please sign in to comment.