& Quot; Demo01.phppublicstaticfunctionbuildFullPage () {$ data [[& #39; type & #39; & gt; & #39; header & #39;], [& #39; type & #39; & gt; & #39; companys & #39;, & #39; com_id & #39; & gt; & #39; Beijing & #39 ;, defines many variables. the layout of each content is the same], [& #39; type & #39; & gt; & #39; company php
// Demo01.php public static function buildFullPage () {$ data = [['type' => 'header'], ['type' => 'companys ', 'com _ id' => 'Beijing', // defines a lot of variables. the layout of each content is the same], ['type' => 'companys ', 'com _ id' => 'Shanghai',], ['type' => 'companys', 'com _ id' => 'shenzhen',], ['type' => 'companys', 'com _ id' => 'hangzhou',], ['type' => 'footer ']; foreach ($ data as $ type => $ type_value) {switch ($ type) {case 'header': echo Demo01: buildHeader (); case 'companys': echo Demo01:: buildCom ($ data); case 'footer ': echo Demo01: buildFooter ();}}}
The page layout is usually a header with four content (that is, each content is a company introduction, and the template is the same) and a footer. in this way, only one content is displayed each time, what should I do if I want to display all of them?
//index.php