/** Add module into queue * @param string $module Module path * @param array $locals Local variables * @param array $parents List of ids of parent modules - can inherit data by DataBus * @uses \System\DataBus * @return void */ public function add($module, array $locals = array(), array $parents = array()) { if (empty($locals['mod-conds']) || is_array($locals['mod-conds']) && Module::eval_conds($locals['mod-conds'])) { if (!empty($locals['module_id'])) { $id = $locals['module_id']; } else { $id = \System\Module::get_new_id(); } $mod = \System\Module::from_path($module, array("module_id" => $id, "dbus" => $this->dbus(), "flow" => $this, "parents" => $parents, "renderer" => $this->response->renderer, "response" => $this->response, "request" => $this->response->request)); $mod->update_attrs($locals); $this->enqueue($mod); } }