‫Okay, so in the last video, we fetched a single listing we were able to pass in.
‫If we go to the details we passed in the ID through query string, and we were able to grab that and
‫fetch the listing.
‫Now we want to pass it into the view, and we want to show the the actual data from the database.
‫So we already changed the load view to accept an array.
‫So let's go ahead and do that.
‫And we're going to say listing.
‫And we want to set that to listing.
‫Okay.
‫Now since Load View uses that extract function, we'll have a variable called listing that will have
‫that listing data.
‫So let's save that and go over to the view and change what we need to.
‫So let's see where do we want to start.
‫Here.
‫Let's take.
‫So this right here, this edit link.
‫I guess we could change that now.
‫We're not going to do that till later, but it's going to be.
‫Well no we'll just leave that as is.
‫But let's go down here and add the title.
‫So change that to we'll use the shorthand syntax and say listing.
‫So it's singular.
‫And remember we're using the arrow syntax because we're fetching it as an object.
‫So it's going to be listing title.
‫Let's just see if that works.
‫We'll reload and we still get software Engineer.
‫That's what's in the database.
‫Let's grab this and let's do the description.
‫See if that works.
‫We'll reload.
‫Okay.
‫So this is the same data that's in the database.
‫So let's just let's try another one.
‫We'll go over to marketing specialist okay.
‫So we can see that they're all different now at least the title and the description.
‫So now the salary.
‫Let's do that.
‫So right here and remember we have that format salary.
‫So let's call we need our PHP tag.
‫So let's say format salary and then we'll pass in listing.
‫Arrow salary.
‫Okay.
‫So refresh that works for location.
‫We're going to have the city and state.
‫So let's do city.
‫Comma.
‫State again with this local thing.
‫I'm just going to comment that out.
‫And then for tags.
‫Let's get rid of those.
‫And.
‫Let's say.
‫Tags.
‫Okay.
‫So that's that.
‫You can see that changed.
‫Now down here we have the job details.
‫The requirements.
‫So right here we're going to change that to listing requirements.
‫And then this is going to be the benefits.
‫So inside this paragraph here let's get rid of that.
‫And say benefits.
‫And what else?
‫So the email here, right.
‫There's a button that says mail to.
‫And then the email that's going to be the email that's in the database.
‫So let's go ahead and add that here email.
‫And then I think that's it.
‫Yeah, that should do it.
‫So now we're displaying the single.
‫The single listing.
‫All right.
‫So what I want to do now is take a break from the database stuff.
‫Because if we continue and we do the insert, you know, the create, we do the edit delete.
‫Then when we when it comes time to refactor because we're going to refactor our folder structure, it's
‫going to be a lot more work.
‫So I'd rather do that now, get it over with and then continue on with the rest of the database stuff.
‫So that's what we'll do in the next video is we're going to start to work with namespaces.
‫We're going to refactor the router so that we can have controller classes instead of just single files
‫like this, and make it more object oriented and just more clean overall.
‫All right.
‫So we'll do that in the next section.