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
When your application gets bigger, also the HDMI in your templates gets more clunky with time, it
might feel it's getting less and less manageable.
Sometimes you might also feel you are repeating yourself in your blade templates far too often.
This is what include directives after I said directives are there actually is a whole family of those
directives, they let you create some views and partial views which can be reused across different layouts
and pages.
They also help you extract parts of your templates into smaller chunks, which is easier to manage in
the long term.
Let's see an example, we can extract a blog post on the list to an external partial template, since
this particular partial template will only be used once and in a specific place.
It's not really a reusable code.
It is rather for making our individual template files smaller and focused.
In such cases, it's a good idea to keep partial folder that is specific to the domain.
In this case, the domain is posts.
So let's create a new Parshall's folder inside the posts.
Now, let me create a new partial file and call it post blade BHP.
Let's move all the content from within the four hours directive into this new partial.
Now, the include the directive itself.
You just need to specify the template name, so this would be posts Parshall's Post.
You might be wondering if it will work.
How does the partial template know about the loop variable or the post variable?
Well, don't worry, include inherits all the variables that were available in the place where it was
called.
So if that was within a four hour slope, every variable that was available within the loop will be
available inside the partial.
So you can see this still works.
Notice if you would use this partial template outside the loop, it will break down.
As basically it is expecting variables that are not normally available and just happen to be available
inside this loop.
So the partial template that is rendered using the include directive will inherit all the variables
from within the context where it was used, but also it is possible to pass some additional variables
to the include directive.
So this would be the second parameter and an array of keys and values representing those variables.
Exactly like you pass data inside the roots.
So in such cases, you might be able to provide this look variable or the post variable.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.