use partialresolver to resolve partial, return the partial content

@param array<string,array|string|integer> $context Current context of compiler progress.
@param string $name partial name

@return string|null $content partial content
171555
public static function resolver(&$context, &$name) {
        if ($context['partialresolver']) {
            $cnt = $context['partialresolver']($context, $name);
            return static::prePartial($context, $cnt, $name);
        }
    }
1172978
public function getSourceContext($name): Twig_Source
    {
        return new Twig_Source(Container::getCache()->get($this->getCacheKey($name)), $name);
    }
1003004
public static function getArrayDotValue( array $context , $name )
	{
		$pieces = explode( '.' , $name );
		foreach ( $pieces as $piece )
		{
			if ( ! is_array( $context ) || ! array_key_exists( $piece , $context ) )
			{
				return null;
			}
			$context = $context[ $piece ];
		}

		return $context;
	}
367216
public function getComponent($name)
    {
        if (!$this->activePartial) {
            return null;
        }

        $component = $this->findComponentFromStack($name, $this->activePartial);
        if ($component !== null) {
            return $component;
        }

        foreach ($this->partialStack as $stack) {
            $component = $this->findComponentFromStack($name, $stack);
            if ($component !== null) {
                return $component;
            }
        }

        return null;
    }
463845
public function getPartial(string $name)
    {
        if (isset($this->partials[$name])) {
            return $this->partials[$name];
        }

        return null;
    }
686953
protected function getMenuByName(string $name, $context = null): MenuInterface
    {
        // validate menu name
        $this->validateName($name);

        // get menu
        $menuEntity = null;
        try {
            $menuEntity = $this->Menus
                ->find('all')
                ->where(['name' => $name])
                ->firstOrFail();
            if (!($menuEntity instanceof EntityInterface)) {
                throw new RuntimeException(sprintf(
                    'Expected value of type "Cake\Datasource\EntityInterface", got "%s" instead',
                    gettype($menuEntity)
                ));
            }

            $menuInstance = $menuEntity->get('default') ?
                $this->getMenuItemsFromEvent($name, [], $context) :
                $this->getMenuItemsFromTable($menuEntity);
        } catch (RecordNotFoundException $e) {
            $menuInstance = static::getMenuItemsFromEvent($name, [], $context);
        }

        // maintain backwards compatibility for menu arrays
        if (is_array($menuInstance)) {
            $menuInstance = self::normaliseItems($menuInstance);
            if ($menuEntity instanceof EntityInterface && $menuEntity->get('default')) {
                $menuInstance = $this->sortItems($menuInstance);
            }

            $menuInstance = self::createMenu($menuInstance);
        }

        return $menuInstance;
    }
401922
public static function prepareDefault($name)
    {
        $default = static::defaultContent($name);
        if (empty($default)) {
            return false;
        }

        $content = new static;
        $content->topic = $default['topic'];
        $content->content = $default['content'];
        return $content;
    }
353186
public function renderContent($name, $parameters = [])
    {
        /**
         * @event cms.page.beforeRenderContent
         * Provides an oportunity to manipulate the name of the content file being rendered before it renders
         *
         * Example usage:
         *
         *     Event::listen('cms.page.beforeRenderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.beforeRenderContent', function ((string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.beforeRenderContent', [$name])) {
            $content = $event;
        }
        /*
         * Load content from theme
         */
        elseif (($content = Content::loadCached($this->theme, $name)) === null) {
            throw new CmsException(Lang::get('cms::lang.content.not_found_name', ['name'=>$name]));
        }

        $fileContent = $content->parsedMarkup;

        /*
         * Inject global view variables
         */
        $globalVars = ViewHelper::getGlobalVars();
        if (!empty($globalVars)) {
            $parameters = (array) $parameters + $globalVars;
        }

        /*
         * Parse basic template variables
         */
        if (!empty($parameters)) {
            $fileContent = TextParser::parse($fileContent, $parameters);
        }

        /**
         * @event cms.page.renderContent
         * Provides an oportunity to manipulate the output of a content file after being rendered
         *
         * Example usage:
         *
         *     Event::listen('cms.page.renderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.renderContent', function ((string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.renderContent', [$name, &$fileContent])) {
            return $event;
        }

        return $fileContent;
    }
1124069
public function build($definition, $context = null, $name = null)
    {
        if ($definition instanceof ProviderInterface) {
            return $this->getProviderValue($definition, $context);
        } elseif ($definition instanceof FieldInterface) {
            return $definition->getResult($context);
        } elseif (is_array($definition)) {
            $result = [];
            foreach ($definition as $key => $value) {
                $result[$key] = $this->build($value, $context);
            }

            return new Record(
                $name === null ? 'record' : $name, 
                $result
            );
        } elseif (is_string($definition)) {
            if ($context !== null) {
                if (is_array($context)) {
                    if (array_key_exists($definition, $context)) {
                        return $context[$definition];
                    } else {
                        throw new RuntimeException('Referenced unknown key "' . $definition . '" in context');
                    }
                } elseif ($context instanceof \ArrayAccess) {
                    if ($context->offsetExists($definition)) {
                        return $context->offsetGet($definition);
                    } else {
                        throw new RuntimeException('Referenced unknown key "' . $definition . '" in context');
                    }
                } else {
                    throw new RuntimeException('Context must be either an array or instance of ArrayAccess');
                }
            } else {
                return $definition;
            }
        } else {
            return $definition;
        }
    }
714085
public function __callResolver(string $name, array $args)
    {
        //get the handler
        $handler = $this->getResolverHandler();

        //can it be resolved?
        if ($handler->canResolve($name)) {
            //is it shared ?
            if ($handler->isShared($name)) {
                //resolve the shared
                return $this->resolveShared($name, ...$args);
            }

            //resolve it the regular way
            return $this->resolve($name, ...$args);
        }

        //oops ?
        throw ResolverException::forMethodNotFound(get_class($this), $name);
    }
1175159
public static function getPartial($name)
    {
        if (isset(self::$partials[$name])) {
            return self::$partials[$name];
        }
        
        return null;
    }
231702
public function getCacheRepository($name) {
    return array_key_exists($name, $this->cacheRepositories) ? $this->cacheRepositories[$name] : null;
  }
359597
protected function _getLayoutPartialPath($name)
    {
        list($plugin, $name) = $this->pluginSplit($name);

        $paths       = $this->_paths($plugin);
        $layoutPaths = $this->_getSubPaths('Layout' . DS . 'Partial');

        foreach ($paths as $path) {
            foreach ($layoutPaths as $layoutPath) {
                $partial = $path . $layoutPath . DS . $name . $this->_ext;
                if (FS::isFile($partial)) {
                    return $partial;
                }
            }
        }

        return false;
    }
1148622
public static function getConfig($name = 'application', $context = null)
    {
        if($context == null)
            $context = getenv('ERDIKO_CONTEXT');

        $filename = ERDIKO_APP."/config/{$context}/{$name}.json";
        return static::getConfigFile($filename);
    }
4203
public function getFile(string $name)
    {
        return $this->fileContentAreas->where(function (FileContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        })->first();
    }
573223
public function partial($name, array $data = [])
    {
        $file = $this->_getLayoutPartialPath($name);

        if (FS::isFile($file)) {
            return $this->_render($file, $data);
        }

        return null;
    }
1308722
private function getEnabled(array $context, string $resourceClass = null, string $operationName = null, bool $partial = false): bool
    {
        $enabled = $this->options[$partial ? 'partial' : 'enabled'];
        $clientEnabled = $this->options[$partial ? 'client_partial' : 'client_enabled'];

        if (null !== $resourceClass) {
            $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
            $enabled = $resourceMetadata->getCollectionOperationAttribute($operationName, $partial ? 'pagination_partial' : 'pagination_enabled', $enabled, true);

            $clientEnabled = $resourceMetadata->getCollectionOperationAttribute($operationName, $partial ? 'pagination_client_partial' : 'pagination_client_enabled', $clientEnabled, true);
        }

        if ($clientEnabled) {
            return filter_var($this->getParameterFromContext($context, $this->options[$partial ? 'partial_parameter_name' : 'enabled_parameter_name'], $enabled), FILTER_VALIDATE_BOOLEAN);
        }

        return $enabled;
    }