7. Using Dynamic Data

Share this post on:

I will come back and this video here I’m going to show you how to display the nametags how to use dynamic data with PHP and how to change a couple of sentences on our coeditor. For those of you that know the brackets. So first of all let’s go ahead and open brackets and we have this wide background that I want to change.

You can leave it wide if you want. I’m going to be using a dark background since I’m used to programming in the dark background so I’m going to go ahead and go to file extension manager. Go to the theme Stabb here and get inside Marnell Kai.

And this is just a theme based on sublime teach which is a cool weather tool that I use that I paid for and he has something very similar to that so I want to install that for this coeditor as you can see it change in the background to the black right. You can go back here and change themes on view and you can change to whatever you want. You can come and use that. If you like I’m going to use this one I’m used to it. Even though this one looks good.

All right so if you see me with a different color background later on you know would want to come back here and change if you want. So I was going to use a money card for now.

And other than that I want to do is I want to grab this embed that PHP.

I want to do a Save As and when and when my keyword by the way where you can come here and you can see the key we’re shortcut right there on file.

So I’m going to call this blank that PHP. And you should have this file. You will have this following you of course exercise files.

So for example if I if you see that I have all the Farseer when I’m giving you a lecture and you don’t see it in your course that’s satisfied don’t worry about me as long as you have.

What I’m showing you at the moment if I’m showing you a file like this one blank that PHP finds showing you a lesson in that and you have it that’s what you need to worry about. Don’t look to the left side here.

And in fact, if you look to the left side and you see all the Fauzia don’t get confused. Just pay attention to the one that I’m giving you the lecture on.

So we have this blank that you’re going to build a little structure by putting the exclamation there and clicking tab pressing tab on my keyboard and here I’m not going to do anything that’s going to save it here.

And then on to another save as I’m going to call this dynamic because I wanted to have that blank PHP there so that way we can use it to save as other documents that we’re going to be making.

So I got to call this dynamic tetes that’s what we’re going to be creating here.

This is going to be a little outside the scope of this section here because we’re in that section though this complex is in the beginning because we’re going to be talking about something and we’re not going to be talking about what I’m going to show you variables which I’m going to be showing you later lecture but I want to show you an example how we can display that namak test. So I’m just going to write in H-1 tag and PHP in the amount and this is going to say hello.

I’m going to click here to display in my co-host. Now if you don’t for some reason you don’t have this set up make sure that you go to your file and it’s going to be in your previous settings.

Make sure that you have this file path right here. HTP call and forward slash Lokos forward-slash demo. This is the four that we are working on. Make sure you have that setup.

If you don’t go-ahead to the locals and make that demo on there and keep them. Start following me right.

Make that them a folder and that blank that PHP and start following me for some reason you don’t have that but you haven’t and you exercise files right. So you have to do is go to us as I follow and copy it. We have an H1 tag here and we just you can see it all right.

That is displaying their tetes.

Now, what happens if for some reason I want to display the Centex this is a title, for example, the title Edwin D is the official site. For example Fishell site they say this is a title for a for my website. What am I for I want to display this in 20 pages that I got in my wife’s I would have to physically go there and copy this from this page here and pasting those all the pages right. I would have to do that. And that would be a static text that would be something that will stay there all the time.

What I want to do is produce something dynamically something that I can insert in one page and it would be available in those 10 pages. How can I make that happen. How can that be possible.  We PHP can actually help you create dynamic data that you can use over and over in different pages without needing to add it manually. So let me show you how that works. Let’s say for example I want to change this Tessier on all 10 pages.

So we create a file we included we create a function and we put a function on those pages and then with that function we call another file that has a bunch of data that we can use on that specific page whenever we want.

Now I don’t want to confuse you hereby going to get this example right now. So I have the stats right here what I do is in that scene and I imagine this I mean another page in a house on PHP and on that page I have I create something called a variable and very was a container and I have this data assigned to that variable.

We are saving these data here because I want to I’m actually going to call these data this variable title that title and I have this H-1 in 10 different pages. What I’m going to do is inside this H-1 I’m going to embed some page. And going to echo out the title. Right now if I just echo this I get a problem there I don’t have anything in there. I just take that call.

As you can see I have not been there. If I use echo and I use that title the name you can see that I’m displaying the title right here in this plane that tests inside of you. So you can see here by me including this little PHP here. This PHP function on the pages I create this value here.

Now you might be wondering so what is the purpose of this. As you say you have to go physically and copy and paste this code here and load 10 pages. You see now that I have this variable here on 10 pages right.

Now every time I want to change the value here I want to change these steps. I don’t have to go to those 10 pages.

I can go to that specific page which in most cases call functions that PHP in changed this and I could say Edwins site. Now when I change this value on one page is going to changing all 10 pages in that is dynamic data dynamic tetch rain. In this case, it could be dynamic numbers which can be any data you want. It can be pictures.

So just by having this in one page write with have value there and then having this little function or 10 pages right I create dynamic data because I can I just change it in one place and it would change getting all different pages I could have a thousand different pages which endure for me romantically.

Thank you,

Share this post on:

Leave a Reply