Template skeleton!

Nao

  • Dadman with a boy
  • Posts: 16,078

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Template skeleton!
« Reply #136, on November 26th, 2011, 10:32 AM »
For example, if we were to rename Class-Editor.php to Class-wedit, we wouldn't ever need to put a loadSource call in for it again. We could just refer to wedit, and if the class hasn't been already loaded, PHP can load it for us.

Stops you worrying so much about cross-dependencies by encouraging you to split things up and have them loaded on demand.

Mind you, I find it interesting that the general policy of Zend is to break things down to an atomic level; Zend stuff and stuff written to Zend standards generates a *lot* of small files. (xenForo has many 1-2KB source files for example)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,078
Re: Template skeleton!
« Reply #137, on November 26th, 2011, 10:44 AM »
Hmm, the only way it could work for me in terms in file naming would be to have a Class or Classes folder with files named 'wedit.php' and such in it.
I'm not sure it'd be beneficial in the long run, though. For example in terms of ease of update (if you do it via FTP.)

Would like to get more opinions...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Template skeleton!
« Reply #138, on November 26th, 2011, 10:51 AM »
Quote
Hmm, the only way it could work for me in terms in file naming would be to have a Class or Classes folder with files named 'wedit.php' and such in it.
Here's the thing. When the autoload is invoked, you get to provide a function that dictates how it should load the relevant class, so you can set it up how you like. I'm more just throwing it out there really to see whether it might be useful in cases like this.

Nao

  • Dadman with a boy
  • Posts: 16,078