Skip to content

Instantly share code, notes, and snippets.

@peterfox
Last active June 3, 2017 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterfox/689dd65678cc19f3e1114800a2b864d1 to your computer and use it in GitHub Desktop.
Save peterfox/689dd65678cc19f3e1114800a2b864d1 to your computer and use it in GitHub Desktop.
Terms and Conditions example
<p>These are the default terms</p>
sylius:
ui:
your_store: Awesome Store
our_terms: 'Using our store is subject to the following terms'
# 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
services:
app.controller.shop.termspage:
class: AppBundle\Controller\TermsPageController
arguments: ['@templating']
{% 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 %}
<?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