Last active
June 3, 2017 20:37
-
-
Save peterfox/689dd65678cc19f3e1114800a2b864d1 to your computer and use it in GitHub Desktop.
Terms and Conditions example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>These are the default terms</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sylius: | |
ui: | |
your_store: Awesome Store | |
our_terms: 'Using our store is subject to the following terms' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# keep your other routes, just add the following. | |
app_terms_and_conditions: | |
path: /terms-and-condition | |
prefix: /{_locale} | |
defaults: | |
_controller: app.controller.shop.termspage:indexAction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
app.controller.shop.termspage: | |
class: AppBundle\Controller\TermsPageController | |
arguments: ['@templating'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends '@SyliusShop/layout.html.twig' %} | |
{% block content %} | |
<div class="ui hidden divider"></div> | |
<div class="ui two column centered grid"> | |
<div class="column"> | |
<h1 class="ui header"> | |
<i class="circular handshake icon"></i> | |
<div class="content"> | |
{{ 'sylius.ui.terms_and_conditions'|trans }} | |
<div class="sub header">{{ 'sylius.ui.our_terms'|trans }}</div> | |
{{ sonata_block_render_event('sylius.shop.terms_and_conditions.after_content_header') }} | |
</div> | |
</h1> | |
<div class="ui segment"> | |
{{ include(["@AppBundle/terms_and_conditions/#{sylius.channel.code}.html.twig",'terms_and_conditions/default.html.twig']) }} | |
</div> | |
</div> | |
</div> | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
final class TermsPageController | |
{ | |
/** | |
* @var EngineInterface | |
*/ | |
private $templatingEngine; | |
/** | |
* @param EngineInterface $templatingEngine | |
*/ | |
public function __construct(EngineInterface $templatingEngine) | |
{ | |
$this->templatingEngine = $templatingEngine; | |
} | |
/** | |
* @param Request $request | |
* | |
* @return Response | |
*/ | |
public function indexAction(Request $request) | |
{ | |
return $this->templatingEngine->renderResponse('terms_and_conditions_page.html.twig'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment