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
public function apiApartmentsAction(Request $request) | |
{ | |
$appState = new AppState(); | |
$em = $this->get('doctrine.orm.default_entity_manager'); | |
$apartments = $em->getRepository('AppBundle:Apartment')->getRandom(10); | |
$appState->setApartments($apartments); | |
$response = new JsonResponse(); |
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
var ApartmentListing = Vue.extend({ | |
template: ` | |
<div> | |
<h2>Hello from Vue</h2> | |
<table> | |
<tr v-for="apartment in apartments"> | |
<td> | |
{{ apartment.streetaddress }}<br /> | |
{{ apartment.city }}<br /> | |
{{ apartment.zipcode }} |
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
<script type="text/javascript"> | |
var initialAppState = {{ appstate_serialized|raw }}; | |
</script> | |
<script src="{{ asset('bundles/app/js/vue/vue.js') }}"></script> | |
<script src="{{ asset('bundles/app/js/vue/app.js') }}"></script> |
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
<h2>Hello from Twig</h2> | |
<table> | |
{% for apartment in appstate.apartments %} | |
<tr> | |
<td> | |
{{ apartment.streetaddress }}<br /> | |
{{ apartment.city }}<br /> | |
{{ apartment.zipcode }} | |
</td> | |
<td>{{ apartment.country }}</td> |
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 | |
public function indexAction(Request $request ) | |
{ | |
$appState = new AppState(); | |
$em = $this->get('doctrine.orm.default_entity_manager'); | |
$apartments = $em->getRepository('AppBundle:Apartment')->findByLimit(3); | |
$appState->setApartments($apartments); | |
$appState->setFetchMore(true); |
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\State; | |
use Symfony\Component\Serializer\Serializer; | |
use Symfony\Component\Serializer\Encoder\JsonEncoder; | |
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; | |
class AppState implements \JsonSerializable { | |
public $fetchMore = false; |
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
{{ render_esi( | |
controller( | |
"Foo:Default:bar", | |
{ | |
'bar': foo, | |
} | |
) | |
) }} |
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
cd /var/www/html/ezstudio/ | |
php app/console assets:install --symlink | |
php app/console assetic:dump --env=dev |
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 | |
/** | |
* @Route("/test",name="testroute") | |
* @Template | |
*/ | |
public function testAction(Request $request, Checkout $checkout) | |
{ | |
$repository = $this->get('ezpublish.api.repository'); |
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
c78e3b0f3d9244ed8c6d1c29464bdff9 |