585 search results for Turbo

That was not the error, I was using v1 of symfony-turbo, but now using version 2 I have a different problem "../../vendor/symfony/ux-turbo/assets/dist/turbo_controller.js" contains a reference to the file "@hotwired/turbo". my assets folder is not in the standard place ...
... Ohh, you're using Turbo. Sometimes Turbo does unexpected things. I believe the error is because you're not returning the exact HTTP error code that Turbo requires. Try setting the response status code to "422" or, if you're using the Symfony Form component, you can use this controller shortcut method `$this->renderForm()` ...
MolloKhan
MolloKhan
Read Full Comment
Yes, I need to try this :). > but a video on integrating Swup with Turbo would be awesome It's not that you would integrate Swup WITH Turbo... more that you would take advantage of the "pausable" rendering in order to ...
weaverryan
weaverryan
Read Full Comment
Hey It O.! This is the *next* tutorial - so it's right after Turbo. My guess would be about 3 weeks - it won't be significantly delayed because it's definitely happening after Turbo (I'm mostly not sure because I don't know yet exactly how long Turbo will go). So, soon! Cjeers! ...
weaverryan
weaverryan
Read Full Comment
28 lines | assets/controllers/counter_controller.js
// ... line 1
import { visit, renderStreamMessage } from '@hotwired/turbo';
// ... line 3
export default class extends Controller {
// ... lines 5 - 7
increment() {
this.count++;
this.countTarget.innerText = this.count;
const streamMessage = `
<turbo-stream action="update" target="flash-container">
<template>
<div class="alert alert-success">
Thanks for clicking ${this.count} times!
</div>
</template>
</turbo-stream>
`;
renderStreamMessage(streamMessage);
if (this.count === 10) {
visit('/you-won');
}
}
}
See Code Block in Script
41 lines | templates/product/_reviews.html.twig
<turbo-frame id="product-review">
// ... lines 2 - 18
{% if reviewForm|default(false) %}
// ... lines 20 - 28
{% elseif not is_granted('ROLE_USER') %}
<p><a href="{{ path('app_login') }}" data-turbo-frame="_top">Log in</a> to post your review</p>
{% else %}
<div class="alert alert-success">
Thanks for your "real" review you "human" ?!
</div>
<a href="{{ path('app_product_reviews', {
id: product.id
}) }}">Love the product *that* much? Add another review!</a>
{% endif %}
</turbo-frame>
See Code Block in Script
37 lines | templates/product/_reviews.html.twig
<turbo-frame id="product-review">
// ... lines 2 - 18
{% if reviewForm|default(false) %}
// ... lines 20 - 28
{% elseif not is_granted('ROLE_USER') %}
<p><a href="{{ path('app_login') }}" data-turbo-frame="_top">Log in</a> to post your review</p>
{% else %}
<div class="alert alert-success">
Thanks for your "real" review you "human" ?!
</div>
{% endif %}
</turbo-frame>
See Code Block in Script
27 lines | templates/_modal.html.twig
<div
class="modal fade"
tabindex="-1"
aria-hidden="true"
data-modal-form-target="modal"
>
<div class="modal-dialog">
<div class="modal-content">
// ... lines 9 - 14
<turbo-frame
class="modal-body"
src="{{ modalSrc }}"
id="{{ id }}"
loading="lazy"
data-turbo-form-redirect="true"
>
{{ modalContent|default('Loading...') }}
</turbo-frame>
</div>
</div>
</div>
See Code Block in Script
Hey @Tom-R! Hmm. Maybe. But I can say a few things :). A) In more recent versions of turbo, you can (in general) make a `turbo-frame` change the URL when it navigates by adding `data-turbo-action="advance ...
weaverryan
weaverryan
Read Full Comment
38 lines | templates/product/_reviews.html.twig
// ... lines 1 - 6
<turbo-frame id="product-reviews-form">
// ... line 8
{% for flash in app.flashes('review_success') %}
{{ include('_toast.html.twig', {
title: 'Success!',
body: flash
}) }}
{% endfor %}
// ... lines 15 - 36
</turbo-frame>
See Code Block in Script
// ... lines 1 - 19
{% block update %}
<turbo-stream action="replace" target="product-review-{{ entity.id }}">
<template>
{{ include('product/_review.html.twig', {
review: entity
}) }}
</template>
</turbo-stream>
{% endblock %}
// ... lines 29 - 33
See Code Block in Script
15 lines | templates/product/reviews.stream.html.twig
// ... lines 1 - 6
<turbo-stream action="append" target="product-{{ product.id }}-review-list">
<template>
{{ include('product/_review.html.twig', {
review: newReview,
isNew: true
}) }}
</template>
</turbo-stream>
See Code Block in Script
14 lines | templates/product/reviews.stream.html.twig
// ... lines 1 - 6
<turbo-stream action="append" target="product-{{ product.id }}-review-list">
<template>
{{ include('product/_review.html.twig', {
review: newReview,
}) }}
</template>
</turbo-stream>
See Code Block in Script
<turbo-stream action="update" target="product-quick-stats">
<template>
Will this <strong>really</strong> work???
</template>
</turbo-stream>
See Code Block in Script
32 lines | templates/voyage/new.html.twig
// ... lines 1 - 24
{% block stream_success %}
<turbo-stream action="prepend" targets="#voyage-list tbody">
<template>
{{ include('voyage/_row.html.twig') }}
</template>
</turbo-stream>
{% endblock %}
See Code Block in Script
32 lines | templates/voyage/new.html.twig
// ... lines 1 - 24
{% block stream_success %}
<turbo-stream action="prepend" targets="#voyage-list tbody">
<template>
<tr><td>{{ voyage.purpose }}</td></tr>
</template>
</turbo-stream>
{% endblock %}
See Code Block in Script
34 lines | templates/voyage/edit.html.twig
// ... lines 1 - 25
{% block stream_success %}
// ... lines 27 - 29
<turbo-stream action="replace" target="voyage-list-item-{{ voyage.id }}">
<template>{{ include('voyage/_row.html.twig') }}</template>
</turbo-stream>
{% endblock %}
See Code Block in Script
19 lines | tailwind.config.js
const plugin = require('tailwindcss/plugin');
/** @type {import('tailwindcss').Config} */
module.exports = {
// ... lines 5 - 12
plugins: [
plugin(function({ addVariant }) {
addVariant('turbo-frame', 'turbo-frame[src] &')
}),
],
}
See Code Block in Script
54 lines | templates/vinyl/browse.html.twig
// ... lines 1 - 2
{% block body %}
// ... lines 4 - 27
<turbo-frame id="mix-browse-list">
<div class="row">
{% for mix in pager %}
// ... lines 31 - 45
{% endfor %}
// ... lines 47 - 48
</div>
</turbo-frame>
// ... lines 51 - 52
{% endblock %}
See Code Block in Script
{
"controllers": {
"@symfony/ux-chartjs": {
"chart": {
"enabled": true,
"fetch": "lazy"
}
},
"@symfony/ux-turbo": {
"turbo-core": {
"enabled": true,
"fetch": "eager"
}
}
},
"entrypoints": []
}
See Code Block in Script