All language subtitles for 003 Passing and Rendering Data in Templates_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
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

Let's see how we can pass some additional data to the blade template and then how do you output this

data inside the template for the purpose of this lecture?

Let's define our simple poster that will hold the data we want to pass onto the template.

So this code chunk is available as a download under this lecture.

So download it and paste it inside the root.

It's on the right holding a race.

And unless Iterate also has keys, which we will try to match against the ID root parameter.

Now, let's render the new template we are yet to create

and pass the array containing blog post data for a given ID.

Then let's create the proper template for displaying a blog post.

Again, let's follow the route naming convention and create our posts folder and then show Blade B inside

it.

For the most part, we can copy paste from previously created templates.

The difference here is the section's content.

If you would, take a look at how we have passed the data, every Iraqi defined in the controller becomes

Arpège variable available in the template.

Now, let me coat and of course, you can coat along how we would outpoured past the data and then we

will go through it step by step.

So first, let's have a specific title for this page.

Then I'll add an age one element for a blog, post title and paragraph for the content.

Now, let's use this special syntax first to output the title.

Secondly, to output the content.

Now, the new thing here is the double bass syntax, sometimes also called the mustache.

If you take a closer look, you can see a mustache there between this bracers.

You can put any data or variables that are available in the template.

Since we are passing on the rate, we can access its elements by key using bracket syntax.

It's important to note that everything put through their mustache syntax is passed through HDMI special

char speech function that converts special characters to HDMI entities for security reasons.

You can influence how the data is rendered, though, there is a separate lecture about that.

So let's try it out, go to the browser and visit post one, you should get some output and let's go

visit the second blog post.

It works to also the title is Being Adjusted.

Finally, if you will try out what happens if you provide an invalid ID, you get an error page are

pretty useful error page.

So be sure to look around at what info is available here.

But I don't want to let you go with a code that is unfinished, so let's go back to where you've been

and you can use this handy board E Floraville helper function.

What it does is it can generate an error when a condition is met.

In our case, it's the missing array key for the given I.D. route parameter.

So let's implement it.

So if it's not set posts array with our specific ID, we could return for or for error, which means

not found.

Save the changes, remember this helper function as it is often coming handy.

So let's finally try it out.

Now, let's refresh this page with an invalid I.D. and you can see we are directed to a nice 404 not

found.

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