True, however as we all know, Frameworks are built to work with a large variety of applications - which means there can be alot of stuff you just don't need in there.
Not sure how that's the ultimate solution. Instead of finding a truly meaningful place for something, your goal is to dump it off in some global god area for later confusion.
Yes, but the question is - where is that?
Here's my point with a little more clarification:
Very bad:
PHP Code:
class SomeClass{
public $One, $Two, $Three;
function __Construct(){
$this->One = 1;
$this->Two = 2;
$this->Three = 3;
echo $this->HelloWorld();
}
function HelloWorld(){
return 'Hello World'; //Nothing to do with members or methods
}
}
Not quite so bad:
PHP Code:
class SomeClass{
public $One, $Two, $Three;
function __Construct(){
$this->One = 1;
$this->Two = 2;
$this->Three = 3;
echo self::HelloWorld();
}
static function HelloWorld(){
return 'Hello World'; //Nothing to do with members or methods
}
}
Better:
PHP Code:
class SomeClass{
public $One, $Two, $Three;
function __Construct(){
$this->One = 1;
$this->Two = 2;
$this->Three = 3;
echo HelloWorld();
}
}
function HelloWorld(){
return 'Hello World'; //Nothing to do with members or methods
}
(Btw, it's an example - I know such a function wouldn't be in the class in the first place, but there can be occurances where this isn't the case)
Bookmarks