Jenk
-
Posts
778 -
Joined
-
Last visited
Never
Posts posted by Jenk
-
-
Kind of answers the question for you..object oriented -
Use a RESTful protocol of your own design. Much quicker than the highly bloated SOAP protocol.
Failing that, ditch the PHP code for Java, or vice versa.
-
Too vague a problem to fully assist, but you are calling a function on something that is not an object.
-
I would strongly reconsider your design implementation. You should not know what properties are within an object if they are not public.
-
static methods are not bound by inheritance. What you are doing is calling a method as if it were a function, i.e. not in a class at all. A class to a static method is nothing more than a namespace.
-
"Modular" just means that every class/object is concise and only encapsulates one type of behaviour, so that this maximises reusability. If you have an object that is too specific in the way it must be used, you'll be very restricted.
-
If you have a large application, with many different features, there is. Otherwise it can generally be considered superfluous to use both.
-
AJAX has absolutely nothing to do with this topic.you are loading alot of unnecessary data whenever someone goes to the page.
the only way I can see that this would benefit you, is if your page is controlled with AJAX
Otherwise, I would put everything in their own modules and include them, that way you only display what you need when you need it.
-
No, Dependency Injection is much, much more than Type Hinting.
-
Try reading it first.
-
Why not use DOM? php.net/dom
-
So what happens if you need to change your database class? Oops! You've got lots of finding/replacing to do!i am, that's my point, no need for a registry pattern.
and on platforms that are stateful (i.e. not PHP) the registry is also much more usefull than a singleton, because it can be maintained within the session, and as it's nature is to maintain single instances of objects, it allows you to create instances unique to each session, but maintain the same "singleton" effect.
-
If only that were true.But nobody is using 5.0, so it's not a problem! -
Depends on your structure of session storage.
-
Almost, they are specific to the currently active session. Users change within the same session.If these settings aren't user specific there is no point storing them in the $_SESSION array. Sessions are specifically designed to store data relating to a particular user.
-
I decided to be more verbose.
-
class B extends A { public function A () { // leave this blank to stop parent constructor executing if it's a php4 syntax class } public function __construct () { //this is your new constructor } }
-
Singletons are restrictive, and can (but don't neccessarily do) lead to problems later in application life. Just be more disciplined and only instantiate the object once if you want to maintain only once instance.
As for the variable/object name argument (which has already been addressed I see,) you are mistaken. An example:
<?php $foo = new db(); function foobar ($bar) { $bar->connect(); } foobar($foo); ?>
-
You either use MVC, or you don't. You don't have to use anything. MVC is a design pattern, a guide for a commonly occuring situation or scenario. If you are setting out to design an application with MVC, you have already caused yourself problems as you do not yet know if MVC is right for your situation.
-
urldecode();
-
use
$this->forms
, not
$forms
within the create method.
-
Your application may have a Model component, a View component and a Controller component, but is not a "ModelViewController"
-
No, you build an application that satisfies the pattern, should the pattern be applicable to your needs. You do not build a pattern.
-
You still didn't read the first reply properly.
empty($var) will return true if either $var is undefined, or contains the value of null, 0, "" (empty string) or an empty array.
I suggest you read that line very carefully, then read it again carefully, and once more for luck, before replying again.
[SOLVED] remove [square brackets and contents] from string
in Regex Help
Posted