All language subtitles for 001 Understanding Templating, Views and Blade_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In the first lecture, we will talk about how do you return HTML from your roots and the spoiler alert

we will be doing that using the blade templating engine.

But before we get to what is our templating engine, let's look at the naive way it can be done so you

can try to surround the text you are returning using HTML, for example, with an H1 tag, save the

changes refresh and indeed that works.

The whole page text is now surrounded with an H1 tag.

Now, I will tell you immediately that this is not a good idea in 2020, you care about the separation

of concerns and generating HTML is our responsibility of the view.

So what is the view?

Let's take a look at the diagram that we have here.

So it all starts with a request to your website.

So there is a request.

It gets routed to our controller.

So, controller, that's your function here.

And then controller is using both model and view, model is some kind of data abstraction, usually

on the database and view in our case.

Well, this is a blade templating engine.

So the view layer is responsible for generating output or more specifically, generating the HDMI and

your pages render.

So we said that that blade is a powerful templating engine in Laravel.

And those templates let you use special template language that works well inside HTML.

Do, for example, conditionally render use loops or to have common layout on different pages.

So it's much more practical and easy to use than mixing up logic with HTML directly.

Now, separating the view layer makes it easy to change what is being rendered without making any changes

to the model and controller logic.

Now, you should also know that the blade templates are compiled and cached until you make any changes

to them.

So they give almost zero overhead by convention.

Blade templates are stored inside resources reviews folder and they are basically HTML5 with extra blade

syntax called directive's and they should be given a Blade BCP extension to render a response using

the Blades template return the result of the view function with the template name as the first parameter.

And optionally and the extra data that you might want to pass through the template in the second parameter

that is unary, will get to plussing data to templates later.

Now, the view function assumes that the template name you give is based inside the resources views

folder.

And when specifying our template name, make sure not to add the Blade BHB extension.

Now, here is a hint, you should name your plate templates exactly the same as are the names of the

routes in which they are used later.

This would be very easy to figure out which template belongs to which route.

So we need to create our template file that we have referenced here, the home index.

Now, you should know that when you are using DOT in the name of the blade template, this actually

means that there is some nested folder structure.

So instead of creating column DOT Index Dot Blade HP, we would create a home folder inside the views

folder and in it we will make an index, a sort of index blade file.

There it is now let's have some HTML boilerplate.

And inside the body, let's put H1 and Hello World, or whatever you would like, save the changes and

now the contents of this blade template should be rendered whenever we go to this page.

So let's save all the changes, go back to the browser.

And indeed, there it is.

You can see some additional attacks that were added and also the structure of the document.

So that was the introduction to the blade template, we will be, of course, talking about all the

aspects of using and creating blade templates in your applications in the next lecture's.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.