Applies handler's template render options to default ones.

@param $default
@param $handler
@return array
486796
private function renderWithHandlerOptions($default, $handler)
    {
        if(
            $handler && is_array($handler) && count($handler) &&
            $default && is_array($default) && count($default)
        ){
            if(isset($handler['template'])){
                $default['template'] = $handler['template'];
            }
            if(isset($handler['vars'])) {
                $default['vars'] = $default['vars'] + $handler['vars'];
            }
        }

        return $this->render($default['template'], $default['vars']);
    }
749116
protected function _render($context = null)
    {
        if (is_null($context)) {
            $context = [];
        }

        return $this->_replaceTokens($this->_getPlaceholderTemplate(), $context, $this->_getTokenStart(), $this->_getTokenEnd(), $this->_getDefaultPlaceholderValue());
    }
621710
public static function callback($handler)
    {
        if ($handler instanceof Closure) {
            return $handler;
        }
        if (is_object($handler[0])) {
            return $handler;
        }

        // If the first argument is a class name string,
        // then create the controller object.
        if (is_string($handler[0])) {

            // If users define the constructor arguments in options array.
            $constructArgs = [];
            $rc = new ReflectionClass($handler[0]);
            if (isset($options['constructor_args'])) {
                $con = $handler[0] = $rc->newInstanceArgs($constructArgs);
            } else {
                $con = $handler[0] = $rc->newInstance();
            }

            return $handler;
        }

        throw new LogicException('Unsupported handler type');
    }
1197205
public function filter($handler)
    {
        $result = array();

        foreach ($this as $id => $document) {
            if (!$handler($document)) {
                continue;
            }

            $result[$id] = $document;
        }

        return $result;
    }
673898
public function addPost(
        /*# string */ $pathPattern,
        $handler = null,
        array $defaultValues = []
    ) {
        $this->getCollectors()[0]->addPost(
            $pathPattern,
            $handler,
            $defaultValues
        );
        return $this;
    }
840886
public function defaultViewModeSettings($viewMode)
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->defaultViewModeSettings($this, $viewMode);
        }

        return [];
    }
59000
protected function defaults()
    {
        return [
            'options'       => ['placeholder' => 'Search for a repo ...'],
            'pluginOptions' => [
                'allowClear'              => true,
                'minimumInputLength'      => 0,
                'minimumResultsForSearch' => 'Infinity',
                'ajax'                    => [
                    'dataType'       => 'json',
                    'delay'          => 250,
                    'data'           => new JavaScriptExpression($this->ajaxData()),
                    'processResults' => new JavaScriptExpression($this->processResults()),
                    'cache'          => true
                ],
                'escapeMarkup'            => new JavaScriptExpression($this->escapeMarkup()),
                'templateResult'          => new JavaScriptExpression($this->templateResult()),
                'templateSelection'       => new JavaScriptExpression($this->templateSelection()),
            ],
        ];
    }
585960
private function _renderDefault($mod)
    {
        if(isset($mod['value'])){
            return $mod['value'];
        }elseif($this->data && isset($this->data->$mod['name'])){
            return $this->data->$mod['name'];
        }elseif(isset($mod['default']))
            return $mod['default'];
        else
            return null;
    }
764689
public function map($handler)
    {
        $result = array();

        foreach ($this as $id => $document) {
            $result[$id] = $handler($document);
        }

        return $result;
    }
1339579
public function render(RenderHandler $handler)
    {
        if (!empty($this->version)) {
            $handler->add(self::DIRECTIVE_ROBOT_VERSION, $this->version);
        }
        return true;
    }
182218
public function value($handle = null, $default = '')
    {
        if ($handle && ! $this->get($handle)) {
            return $default;
        }

        if ($handle) {
            return $this->get($handle)->value ?: $this->defaultValue($handle);
        }

        return $this->setting->value ?: $this->setting->default;
    }
1341675
protected function _setDefaultHandlers(Logger &$logger)
    {
        if (empty($this->_handlers)) {
            $socketHandler = new NullHandler();
            array_push($this->_handlers, $socketHandler);
        }

        foreach ($this->_handlers as $handler) {
            $logger->pushHandler($handler);
        }
    }
613856
private function renderCompressed(RenderHandler $handler)
    {
        $pair = $this->cleanParam;
        while (($currentPair = current($pair)) !== false) {
            $equalParams = array_keys($pair, $currentPair);
            foreach ($currentPair as $path) {
                $handler->add(self::DIRECTIVE_CLEAN_PARAM, implode('&', $equalParams) . ' ' . $path);
            }
            foreach ($equalParams as $param) {
                unset($pair[$param]);
            }
        }
        return true;
    }
1085961
protected function getReflectionParameters(callable $handler) {
        if (is_array($handler)) {
            $reflector = new ReflectionMethod($handler[0], $handler[1]);
        } else {
            $reflector = new ReflectionFunction($handler);
        }

        return $reflector->getParameters();
    }
1182121
public function render(array $arguments = [], $renderer = null) {
        if($renderer === null) {
            if(static::$defaultRenderer === null) {
                throw new Exception('No Default Renderer Exists for Class ' . get_class());
            } else {
                if(is_callable(static::$defaultRenderer)) {
                    $callable = static::$defaultRenderer;
                    static::$defaultRenderer = $callable();
                }
                $renderer = static::$defaultRenderer;
            }
        } else {
            if(is_callable($renderer)) {
                $renderer = $renderer();
            }
        }

        return $renderer->render($this, $arguments);
    }
37861
function defaultRenderer (data, callback) {

    linz.api.views.renderPartial('action-record', data, (err, html) => {

        if (err) {
            return callback(err);
        }

        return callback(null, html);

    });

}
779648
protected function getHandler($handler)
    {
        if ($handler instanceof HandlerInterface) {
            return [$handler, 'handleEvent'];
        }

        if (is_callable($handler)) {
            return $handler;
        }

        throw new InvalidArgumentException(
            sprintf('Invalid handler "%s".', is_string($handler) ? $handler : gettype($handler))
        );
    }