has('config') ? $container->get('config') : []; assert(is_array($config) || $config instanceof ArrayAccess); // The expected location in config for the base path in an MVC application // is config.view_manager.base_path // @link https://docs.laminas.dev/laminas-mvc/services/#viewmanager $viewConfig = $config['view_manager'] ?? []; assert(is_array($viewConfig)); $basePath = $viewConfig['base_path'] ?? null; assert(is_string($basePath) || $basePath === null); return new BasePath($basePath); } }