Blade engine: print triple curly braces
I know how to print double curly braces in Laravel: @{{ }}.
But how can I print triple curly braces? My first thought of adding an @ before does not work, Laravel still tries to interpret it.
Is there an easy way without encoding the braces to HTML entities?
laravel blade
add a comment |
I know how to print double curly braces in Laravel: @{{ }}.
But how can I print triple curly braces? My first thought of adding an @ before does not work, Laravel still tries to interpret it.
Is there an easy way without encoding the braces to HTML entities?
laravel blade
can u provide an example of what you are trying to achieve (especially your current code snippet and the expected vs. real output)?
– nozzleman
Apr 14 '15 at 8:07
I want to print triple curly braces in a view. Wanted output:{{{text}}}Not working code:@{{{text}}}
– Tim
Apr 14 '15 at 8:15
This has been fixed in the framework. See my answer below for more information.
– lukasgeiter
Jul 12 '15 at 18:57
add a comment |
I know how to print double curly braces in Laravel: @{{ }}.
But how can I print triple curly braces? My first thought of adding an @ before does not work, Laravel still tries to interpret it.
Is there an easy way without encoding the braces to HTML entities?
laravel blade
I know how to print double curly braces in Laravel: @{{ }}.
But how can I print triple curly braces? My first thought of adding an @ before does not work, Laravel still tries to interpret it.
Is there an easy way without encoding the braces to HTML entities?
laravel blade
laravel blade
asked Apr 14 '15 at 7:56
TimTim
4,71912758
4,71912758
can u provide an example of what you are trying to achieve (especially your current code snippet and the expected vs. real output)?
– nozzleman
Apr 14 '15 at 8:07
I want to print triple curly braces in a view. Wanted output:{{{text}}}Not working code:@{{{text}}}
– Tim
Apr 14 '15 at 8:15
This has been fixed in the framework. See my answer below for more information.
– lukasgeiter
Jul 12 '15 at 18:57
add a comment |
can u provide an example of what you are trying to achieve (especially your current code snippet and the expected vs. real output)?
– nozzleman
Apr 14 '15 at 8:07
I want to print triple curly braces in a view. Wanted output:{{{text}}}Not working code:@{{{text}}}
– Tim
Apr 14 '15 at 8:15
This has been fixed in the framework. See my answer below for more information.
– lukasgeiter
Jul 12 '15 at 18:57
can u provide an example of what you are trying to achieve (especially your current code snippet and the expected vs. real output)?
– nozzleman
Apr 14 '15 at 8:07
can u provide an example of what you are trying to achieve (especially your current code snippet and the expected vs. real output)?
– nozzleman
Apr 14 '15 at 8:07
I want to print triple curly braces in a view. Wanted output:
{{{text}}} Not working code: @{{{text}}}– Tim
Apr 14 '15 at 8:15
I want to print triple curly braces in a view. Wanted output:
{{{text}}} Not working code: @{{{text}}}– Tim
Apr 14 '15 at 8:15
This has been fixed in the framework. See my answer below for more information.
– lukasgeiter
Jul 12 '15 at 18:57
This has been fixed in the framework. See my answer below for more information.
– lukasgeiter
Jul 12 '15 at 18:57
add a comment |
5 Answers
5
active
oldest
votes
This is the easiest way. Use HTML entities to escape curly braces. Tested in Laravel 5.
See here for the list of HTML entities. HTML Entities
Code
{{ '{{{' . 'text'. '}}}' }}
Output
{{{text}}}
4
I'll just use{{{text}}}without the curly brackets. Seems to be the easiest solution to me. Thanks!
– Tim
Apr 14 '15 at 10:48
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
add a comment |
Update
Very recently, a pull request was merged that fixes this problem!!
As of Laravel 5.1.7 it is possible to use the @ sign as expected:
@{{{ ... }}}
Original Answer
The least ugly workaround I found up until now is to escape the first two brackets as normal and adding an invisible between them and the third bracket:
@{{‌{test}}}
I'll investigate further and update this answer if I find something better...
add a comment |
Use this if you just want to print them:
{{ '{{{' }}
Thanks for your superfast answer. But this is not working correctly:{{ '{{{text}}}' }}. Nothing gets printed.
– Tim
Apr 14 '15 at 8:00
1
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
add a comment |
I ran into the same issue trying to render some raw HTML using Vue.js in laravel 4.2. For me the easiest solution was to just to use a simple php echo statement in the blade template:
<?php echo '{{{ text }}}'; ?>
Did the trick for me.
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
add a comment |
One more way is as following
{@{{Text}}}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29621970%2fblade-engine-print-triple-curly-braces%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is the easiest way. Use HTML entities to escape curly braces. Tested in Laravel 5.
See here for the list of HTML entities. HTML Entities
Code
{{ '{{{' . 'text'. '}}}' }}
Output
{{{text}}}
4
I'll just use{{{text}}}without the curly brackets. Seems to be the easiest solution to me. Thanks!
– Tim
Apr 14 '15 at 10:48
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
add a comment |
This is the easiest way. Use HTML entities to escape curly braces. Tested in Laravel 5.
See here for the list of HTML entities. HTML Entities
Code
{{ '{{{' . 'text'. '}}}' }}
Output
{{{text}}}
4
I'll just use{{{text}}}without the curly brackets. Seems to be the easiest solution to me. Thanks!
– Tim
Apr 14 '15 at 10:48
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
add a comment |
This is the easiest way. Use HTML entities to escape curly braces. Tested in Laravel 5.
See here for the list of HTML entities. HTML Entities
Code
{{ '{{{' . 'text'. '}}}' }}
Output
{{{text}}}
This is the easiest way. Use HTML entities to escape curly braces. Tested in Laravel 5.
See here for the list of HTML entities. HTML Entities
Code
{{ '{{{' . 'text'. '}}}' }}
Output
{{{text}}}
edited May 30 '16 at 6:07
shankshera
3751730
3751730
answered Apr 14 '15 at 10:08
FaizFaiz
86668
86668
4
I'll just use{{{text}}}without the curly brackets. Seems to be the easiest solution to me. Thanks!
– Tim
Apr 14 '15 at 10:48
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
add a comment |
4
I'll just use{{{text}}}without the curly brackets. Seems to be the easiest solution to me. Thanks!
– Tim
Apr 14 '15 at 10:48
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
4
4
I'll just use
{{{text}}} without the curly brackets. Seems to be the easiest solution to me. Thanks!– Tim
Apr 14 '15 at 10:48
I'll just use
{{{text}}} without the curly brackets. Seems to be the easiest solution to me. Thanks!– Tim
Apr 14 '15 at 10:48
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
This doesn't work for me, it simply outputs the characters as they are escaped...
– Petar Vasilev
Apr 12 '18 at 9:53
add a comment |
Update
Very recently, a pull request was merged that fixes this problem!!
As of Laravel 5.1.7 it is possible to use the @ sign as expected:
@{{{ ... }}}
Original Answer
The least ugly workaround I found up until now is to escape the first two brackets as normal and adding an invisible between them and the third bracket:
@{{‌{test}}}
I'll investigate further and update this answer if I find something better...
add a comment |
Update
Very recently, a pull request was merged that fixes this problem!!
As of Laravel 5.1.7 it is possible to use the @ sign as expected:
@{{{ ... }}}
Original Answer
The least ugly workaround I found up until now is to escape the first two brackets as normal and adding an invisible between them and the third bracket:
@{{‌{test}}}
I'll investigate further and update this answer if I find something better...
add a comment |
Update
Very recently, a pull request was merged that fixes this problem!!
As of Laravel 5.1.7 it is possible to use the @ sign as expected:
@{{{ ... }}}
Original Answer
The least ugly workaround I found up until now is to escape the first two brackets as normal and adding an invisible between them and the third bracket:
@{{‌{test}}}
I'll investigate further and update this answer if I find something better...
Update
Very recently, a pull request was merged that fixes this problem!!
As of Laravel 5.1.7 it is possible to use the @ sign as expected:
@{{{ ... }}}
Original Answer
The least ugly workaround I found up until now is to escape the first two brackets as normal and adding an invisible between them and the third bracket:
@{{‌{test}}}
I'll investigate further and update this answer if I find something better...
edited Jul 12 '15 at 18:56
answered Apr 14 '15 at 9:52
lukasgeiterlukasgeiter
86.6k15204195
86.6k15204195
add a comment |
add a comment |
Use this if you just want to print them:
{{ '{{{' }}
Thanks for your superfast answer. But this is not working correctly:{{ '{{{text}}}' }}. Nothing gets printed.
– Tim
Apr 14 '15 at 8:00
1
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
add a comment |
Use this if you just want to print them:
{{ '{{{' }}
Thanks for your superfast answer. But this is not working correctly:{{ '{{{text}}}' }}. Nothing gets printed.
– Tim
Apr 14 '15 at 8:00
1
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
add a comment |
Use this if you just want to print them:
{{ '{{{' }}
Use this if you just want to print them:
{{ '{{{' }}
answered Apr 14 '15 at 7:57
Hamid MohayejiHamid Mohayeji
96321225
96321225
Thanks for your superfast answer. But this is not working correctly:{{ '{{{text}}}' }}. Nothing gets printed.
– Tim
Apr 14 '15 at 8:00
1
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
add a comment |
Thanks for your superfast answer. But this is not working correctly:{{ '{{{text}}}' }}. Nothing gets printed.
– Tim
Apr 14 '15 at 8:00
1
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
Thanks for your superfast answer. But this is not working correctly:
{{ '{{{text}}}' }}. Nothing gets printed.– Tim
Apr 14 '15 at 8:00
Thanks for your superfast answer. But this is not working correctly:
{{ '{{{text}}}' }}. Nothing gets printed.– Tim
Apr 14 '15 at 8:00
1
1
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
Maybe a little weird but this works: {{ '{{{text' . '}' . '}' . '}' }}
– Hamid Mohayeji
Apr 14 '15 at 8:06
add a comment |
I ran into the same issue trying to render some raw HTML using Vue.js in laravel 4.2. For me the easiest solution was to just to use a simple php echo statement in the blade template:
<?php echo '{{{ text }}}'; ?>
Did the trick for me.
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
add a comment |
I ran into the same issue trying to render some raw HTML using Vue.js in laravel 4.2. For me the easiest solution was to just to use a simple php echo statement in the blade template:
<?php echo '{{{ text }}}'; ?>
Did the trick for me.
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
add a comment |
I ran into the same issue trying to render some raw HTML using Vue.js in laravel 4.2. For me the easiest solution was to just to use a simple php echo statement in the blade template:
<?php echo '{{{ text }}}'; ?>
Did the trick for me.
I ran into the same issue trying to render some raw HTML using Vue.js in laravel 4.2. For me the easiest solution was to just to use a simple php echo statement in the blade template:
<?php echo '{{{ text }}}'; ?>
Did the trick for me.
answered Jul 7 '16 at 0:08
LyleKLyleK
26125
26125
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
add a comment |
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
Also if the php rendering engine still picks them up inside the echo (as ours did yesterday) you can break it up: <?php echo '{' . '{' . '{ text }' .'}' . '}'; ?> to pass {{{ text }}} to your JavaScript
– Chris Adams
Nov 3 '16 at 13:23
add a comment |
One more way is as following
{@{{Text}}}
add a comment |
One more way is as following
{@{{Text}}}
add a comment |
One more way is as following
{@{{Text}}}
One more way is as following
{@{{Text}}}
answered Jan 1 at 8:16
umar_umar_
305414
305414
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29621970%2fblade-engine-print-triple-curly-braces%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
can u provide an example of what you are trying to achieve (especially your current code snippet and the expected vs. real output)?
– nozzleman
Apr 14 '15 at 8:07
I want to print triple curly braces in a view. Wanted output:
{{{text}}}Not working code:@{{{text}}}– Tim
Apr 14 '15 at 8:15
This has been fixed in the framework. See my answer below for more information.
– lukasgeiter
Jul 12 '15 at 18:57