dear friends welcome to bifumes again in this episode we are going to learn
about the view data and blade in the last episode I have told you about
played something ok now so in some cases we just need to transfer some data from
our something array or something variable to our last episode we have
created the route for about thee and this is the about page I have told you
every view has dot plate dot PHP extension okay so in this case if you
want to pass and data in the view so let's see how we can do that for that I
will just create an array name ok bit fumes and Harry help something like this
this is and wait fumes okay and it has three elements okay now I want to pass
this array into my view of what I will do I will just do like this variable
name that means bit fumes and the array name her name is also bit fumes okay
okay let's see we will go to the about blade dot PHP page and we will echo it
out but if you done a PHP Copiah T then you will do something like this mmm PHP
for each and then okay bit fumes as it few only without s then you will do like
this and lots of things and let's see what will happen okay here semicolon
okay now this is bit fumes okay that means we have successfully passed the
data from this rough web fire into the route to the our to our view okay but
here is something interesting you just do not have only one way you can do it
in multiples way like another way with is this you can use wit okay with this
width function you can do same thing and we will refresh and seen result no
change because it is also the way to pass the data to our view another ways
with bit fumes and we will delete all these and the only thing remains is the
variable okay this will also removed and again there is no change because this is
all this is another way of transferring the data to the view okay the next thing
is the final thing is there you know with compact compact compact it and like
this okay now the lap when i refresh the same
thing again there is no change okay so these are the four ways I will
type in the comment views one is width the cane is with big fumes and third is
like direct way oops and the fourth is compact okay now these
are the four way to pass the data to a view okay in this view we just need to
equate out with T's PHP but it's not so good because we are using wherever and
level has when the great thing and that thing is plate and for blade you can
just remove the stirs you're from here and just add act
at the beginning and remove everything and for echoing you have to make your
variable inside the curly braces and two curly braces okay now again there will
be no change and here I have a refresh you can see here I am refreshing and
there is no change because this is the correct way so blade is very powerful it
will do this clear so I think this is very clear and the old school days PHP
that this one is at don't thing it is good ok so this is the correct way okay
but what happened if you don't have any data inside the array so just empty this
array empty out this array and just check then no nothing ok but for this
you can do like this okay act unless and bit fumes okay
unless bit fumes and then end endless and unless okay and what we'll do what
we'll do there is no data good so let's check it out refresh and there is no
data yes because I have no data in my array but when I have some data then it
will show the data so these are the cool stuff you can do with this plate
template engine very powerful thing and and you can get also something different
thing you can do with the blade from this little website you can do level
docks slash five point four because the area
fuck remover okay if you frequent four then scroll it down then plate template
in the blade template you will find components no not sub components yeah
control structures you can see here if statement
Lutz okay we use this for each loop okay and you can do this I am empty also and
I have used unless again nested is nested loops spectra okay
so just read this documentation and you will find lots of new things of cool
things and we will meet in the next episode where we will do lots of cool
thing again and follow me I will show you each and every steps and do
subscribe don't forward to subscribe I think you will do for okay I think you
already subscribed if not just subscribe and if you have any doubt just please
comment below I will surely surely reply you okay so bye bye