Blade templating engine syntax issues on Laravel 4 - laravel

I'm currently starting a project on the beta version of Laravel 4
When i try to use the templating engine some tags work and some doesn't. e.g:
#layout('layouts.master')
#section('container')
<h1>About US</h1>
#endsection
is displayed as:
#layout('layouts.master')
About US
#endsection
which means that the #section tag is parsed, but the other are referred to as plain text.
also if i change the #layout to #include, it does include the template.
Has anyone run into a similar issue? Have there been any syntax changes I'm unaware of?

#layout has been changed to #extends in Laravel 4. Also, #endsection has been changed to #stop

The source of the problem is that a lot of tutorials online (youtube and blogs) still use the #layout and #endsection. And these tutorials usually claim to be Laravel4 tutorials as well.
So a lot of people fall in to this little trap starting their first Laravel4 app.
Tip: I use this guy's cheat sheet page while developing (propers to Jesse O'Brien). It's how I found out myself I was using outdated blade tags.

If you come across problems with Laravel or in case you don't know if Laravel has built in a functionality you'd need, allways check out the docs for the Laravel version you use.
The online documentation of the current released version (4 at the time of writing): http://laravel.com/docs/
and the Laravel API to dive into the source online with explanation of e.g. function arguments: http://laravel.com/api/

Related

Simple html DOM parser on Laravel 8

I have controller, which worked on Laravel 5.2 and used library yangqi/Htmldom (based on simple HTML DOM parser). Now I need to make the same logic on Laravel 8 and I can't find a library, which is based on simple HTML dom parser and working on Laravel 8 (yangqi/Htmldom - not working with Laravel 8).
I have all the need for logic based on simple HTML dom and I don't want to make it again with another library (for example Goutte).
Maybe someone can help me connect a simple HTML dom parser to Laravel 8?
Problem was fixed to next steps:
We need to change one part of code in package yangqi/Html Dom, instruction here.
We need hyphen need to be escaped in all places like wrote here.

how to use charts package in laravel?

I want to use a chart package to create a chart using real time data from my database. I tried a package.The link i am providing bellow.But i am not successful.Can anyone provide me a full tutorial about this ?
https://charts.erik.cat/getting_started.html#screenshots
If you want to use charts in your laravel app, I believe you will need to do this in blade view (frontend)
Here are very good JS chat libraries with good documentation
I am currently using
https://www.chartjs.org/
Another good one
http://morrisjs.github.io/morris.js/
Chart solely for laravel http://lavacharts.com
Check these examples on adminlte
https://adminlte.io/themes/AdminLTE/pages/charts/chartjs.html
Another thing, you will need to learn how to use their API. This is universal, everyone has to learn. However, there are a lot of examples you could extract and use as a baseline.
Hope This helped you.

What do all the blade options do?

Looking at the laravel blade source code, I see there appear to be a lot of different commands, like #show, #append, or #endunless, that don't appear in the official laravel docs. Can someone give me a list of all the #- options in blade, and what they do?
You could try digging around in the online API docs and see if that yields the answers you're looking for. Possibly some of them are internal methods?
Illuminate\View\Compilers\BladeCompiler

Laravel 4 Blade templates documentation

I'm new to Laravel 4. I don't seem to find adequate documentation on the Blade templating system.
I see some examples at http://laravel.com/docs/templates with no explanation.
Another example at Laravel 4 Controller Templating / Blade - Correct method?
Where are #section, #yield, #show, etc defined and documented? Where is the Blade templating system actually explained?
Or is it so new, or so "intuitive", that it needs no explanation? Or I could use another templating system that is better documented?
I would say Blade is so easy that it doesn’t need documentation.
Follow this link great tutorial by Jeffrey Way which will take you through everything you need to know.
https://tutsplus.com/lesson/templating-changes/
I am totally convinced that the original documentation about has many areas of opportunity. Anyway, Dayle Rees has done an excellent job through the pages of Code Bright. The Blade section of the book has some great examples that perfectly complement the original documentation. I find it strange that wasn't previously mentioned. You should give it a look.
Regards!
The documentation for Blade isn't in the laravel.com docs. No, they tucked it away in their readthedocs.io account:
https://laravel-guide.readthedocs.io/en/latest/blade/

Codeigniter: How can I use codeigniter's default view system along with smarty templates

I don't want to remove smarty templates from controllers. In some actions of controllers, I want to use default view system of codeigniter, while on other actions, I want to keep SMARTY templates as display medium. How can I achieve this?
Thanks in advance
I've been developing a CI Smarty library for Codeigniter. It lets you use default Codeigniter views and lets you render Smarty templates using the Codeigniter template parser as I am extending it.
Here is the repository: https://github.com/Vheissu/Ci-Smarty
As it stands, it works really well. If you have any problems, log an issue on Github and I'll fix it usually within 24 hours. Other solutions are mostly outdated, my library lets you use new Smarty 3 features like template inheritance, etc.
Look in the CodeIgniter Wiki - http://codeigniter.com/wiki/Smarty/
And a thread in the official forum:
http://ellislab.com/forums/viewthread/60050/

Resources