I have two simple questions but correct and correct can not be found to me How should define? Can I define a line or not? Both work, but what is right?
How do I define multiplication properties with the same value?
class pages {private $ value; Public $ title, $ footer, $ content; // This way? // Or this way? Public $ title; Public $ footer $ public content; // Multiply a line with the same value? Public $ name, $ age, $ location = "none"; Public $ name = $ age = $ place = "none"; // Error Public Function __ Composition ($ value) {$ this- & gt; Value = $ value; } Private Function Header () {$ q = "& lt ;! DOCTYPE html & gt; \ n"; $ Q. = "& Lt; html> \ n"; $ Q. = "& Lt; principal> gt; title & gt;" $ The- & gt; Title. "& Lt; / title> & lt; / head & gt; \ n"; $ Q. = "& Lt; body & gt; \ n \ n"; Return $ q; } Personal Function Footer ($ q = "\ n \ n Footer =" This footer is "; $ page- & gt; content =" Homepage Ipsum is just a dummy text. "; $ Page-> DrawPage (); Some" quick and Dirty ", it is ok to use many definitions as per line. As long as you can understand it later. To define you one line per line for more formal code Especially if you are planning to write at some point or if others are reading it .
No comments:
Post a Comment