Use
Why do not use blade syntax like this (or similiar)?
{{ Block::put('breadcrumb') }}
or
{{{ Block::put('breadcrumb') }}}
or
{{% Block::put('breadcrumb') %}}
Thank you very much
October uses Twig for its frontend templating language, and PHP for its backend. Blade wouldn't add much to the backend templates.
See https://octobercms.com/forum/post/why-twig and https://github.com/octobercms/october/issues/863 for more information.
@daftspunk this can probably be closed.
Php tags are not twig (). I sayd octobercms could use template engine, not pure php tags. It is mess. I did not write use blade (twig is good), but for this purpose it is better to do it in similiar way (create special brackets for using PHP objects in twig). I do not understand why use pure php tags. For fast development, usibility and readability it could be in some template engine brackets. Also my IDE do not understand if this file is twig or php, or whatever, because of using both in same file.
TY
If @daftspunk is game for it, you could probably look at adding support for using Blade in the backend templates yourself and then make a PR.
Personally I don't care that much because you can use PHP straight up in Blade templates as well, so I don't really care whether I use Blade specific syntax or PHP to accomplish the same thing. Probably wouldn't be that difficult to add support for it, the only thing that I could see a potential issue with is once Blade support is added for the backend templates, then people would want it for the frontend as well, which wouldn't work and isn't going to happen.
.htm files should be parsed as a combination of Twig and PHP. We are working on a syntax highlighter for Sublime that does this. PHP itself is actually a bonafide templating engine. Imposing Blade or even Twig in the back-end adds another layer of complexity that isn't really needed. It is very important that the platform be accessible and unopinionated, if 50% of people know Twig and 50% know Blade, we can assume 99% of people know PHP. In October there is a sharp difference between a theme developer and a plugin developer, both require different skill sets. Every technology has been carefully selected for its purpose, PHP templating in the backend is one of them. Although if you are unfamiliar, it may take some getting used to. We don't have plans to diverge away from the PHP templates in the back-end at the moment.
BTW, PhpStorm don't have problem with mixed languages if you define *.htm file extension as Twig.
@Eoler i defined .html as Twig file, but this is how php looks in .htm file

Well, I moved from having PHP code mixed in CMS elements to (DRY) components, but see if you can make sense of this: https://confluence.jetbrains.com/pages/viewpage.action?pageId=53315225
@Eoler and where you put your php now? (im new in october)
In the component onRun() method for injecting page variables:
https://octobercms.com/docs/plugin/components#page-cycle
or other component methods designed as AJAX handlers:
https://octobercms.com/docs/plugin/components#ajax-handlers
BTW, PhpStorm don't have problem with mixed languages if you define *.htm file extension as Twig.
PHP Storm can support this, but why would we call them .htm files when they are actually twig files? Shouldn't they be called what they are.
You could also set phpstorm to recognise .js files as php, but you shouldn't label the files that way.
@ajslim That decision was made by @daftspunk when October was released; regardless of whether or not people like it - it's not going to change. It's just one of the quirks to get used to when you have the power of October at your disposal :)
I haven't looked into it, but is there a major difficulty in setting it to look for .htm or .twig files?
@ajslim probably, there would probably be a bunch of assumptions throughout the code base based on that assumption.
Most helpful comment
BTW, PhpStorm don't have problem with mixed languages if you define *.htm file extension as Twig.