Great, now what to We does with it? I ' m glad you asked. We need to create a few more functions within Style to actually accomplish. The the "I" thing I ' d "is" set up me page body so I did this:
This sets to the page body for us. It also illustrates a new variable "$this." When used inside of a class function it lets the interpreter know we are referring to a variable of this instance. In other words, it's assigned the value of the name of the instance in the calling line (e.g. $this would to = = $Basic whe n $Basic->body () is the calling statement.) Also, notice we are doing something here that's much simpler than are possible in regular functions. We ' re referring to variables which were not passed to the function. Remember, all functions and variables of a instance are available to all functions of this. To does this with regular functions for you ' d have to set up several global arrays.
Try this in your PHP script (assuming you ' ve included the style class, created the style objects above and sent the <HT Ml> and <HEAD></HEAD> tags):
<?php $Basic->body ();?>
Now, we ' re ready to print something out. We could do it the old fashioned way, but I ' m going to do something different ... that's right another function:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service