Proper way to pass along many variables in an OOP design (PHP) -


How do I pass correctly the data referenced in this structure:

 - main For example the index, but I would like to avoid it: 

New Page Operational ('' Page-Builder) '' Top, 'How To Cook', $ Keywords, $ Details, $ Script, $ css);

The above control looks and sounds terrible. And that figure has so much data, which should not be passed!

The data needs to be supplied by many users to class, head, body and leg, but what is the best way to send it along with the data that some data should be hard-coded , While some have to be set on a database basis or in some cases should depend on the default settings.

Why does an object not display your parameter set? So you pass only one object, but there are your personal criteria in it. One advantage is that you can easily reapply the method to add / remove the data, but the method does not change invocations because they are still handling parameter objects.

A (contrived) example is in the following (in Java), because I'm not PHP-aware)

parameters command-line arguments // (You can create a database or XML or whatever) PageParameters p = PageParameters.fromArgs (args); PageSection page = new page sign (p); There are properties needed to create an PageSection object in some form in the

page parameter - not necessarily the form PageSection < The / code> will store itself in the Page Parameter which may not be in the PageSection (such as command line arguments parsing, sanity checking, etc.).


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -