I'm building a new framework and beneath all the work I'm suffering a strange question aroused my mind. Is it worth creating a jquery-like nesting syntax like this ?
core->component->...->method()
Assuming all "components" expand an abstract class and the core is like
class core {
public $components = array();
public load ($component) {
//Assuming component exists
include($component);
$this->component = new component_name($parameters);
//This last line might be as well included in "component"'s constructor
$this->component->core_link = $this;
$components[] = $component;
}
}
Is this "architecture" right or does it sound weird in PHP ? Is it easy to read/learn ? Is there any tip you'd give me ?
Thanks