Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.