
Jenk
Members-
Posts
778 -
Joined
-
Last visited
Never
Everything posted by Jenk
-
[SOLVED] remove [square brackets and contents] from string
Jenk replied to andyd34's topic in Regex Help
/\[.*(?!<\])\]/mg -
Kind of answers the question for you..
-
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.
-
[SOLVED] Variables in a string inputted into Class Method
Jenk replied to WBSKI's topic in PHP Coding Help
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.
-
Building an efficient PHP framework/modular structure - how??
Jenk replied to LemonInflux's topic in Application Design
"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.
-
No, Dependency Injection is much, much more than Type Hinting.
-
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! 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.
-
Singleton abstract DB class, with mysql, etc extends...
Jenk replied to Naez's topic in PHP Coding Help
If only that were true. -
Depends on your structure of session storage.
-
Almost, they are specific to the currently active session. Users change within the same session.
-
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.
-
How to decode a "%u05D0%u05D9%u05D9%u05DC" string?
Jenk replied to eyalrosen123rulezz's topic in PHP Coding Help
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.