Recursive function that writes a parameter or a series of parameters
to the INI file

@param $name string The name of the parameter
@param $parameter mixed The parameter to write
764674
private static function writeParameter($file_handle, $name, $parameter, $depth = 0)
    {
        if ($depth > 1)
            throw new \DomainException("Cannot nest arrays more than once in INI-file");

        $str = "";
        if (WF::is_array_like($parameter))
        {
            foreach ($parameter as $key => $val)
            {
                $prefix = $name . "[" . $key . "]";
                self::writeParameter($file_handle, $prefix, $val, $depth + 1); 
            }
        }
        elseif (is_bool($parameter))
            fwrite($file_handle, "$name = " . ($parameter ? "true" : "false") . "\n");
        elseif (is_null($parameter))
            fwrite($file_handle, "$name = null\n");
        elseif (is_float($parameter) && WF::is_int_val((string)$parameter))
            fwrite($file_handle, "$name = " . sprintf("%.1f", $parameter) . "\n");
        elseif (is_float($parameter))
            fwrite($file_handle, "$name = " . $parameter . "\n");
        elseif (is_numeric($parameter))
            fwrite($file_handle, "$name = " . $parameter . "\n");
        else
            fwrite($file_handle, "$name = \"" . str_replace('"', '\\"', $parameter) . "\"\n");
    }
43240
public function hasParameter(string $name): bool {
		foreach ($this->parameters as $param) {
			if ($param->getName() == $name) {
				return true;
			}
		}

		return false;
	}
1344776
protected function renderBlock($name, $parameters)
    {
        /** @var Twig_TemplateInterface $template */
        foreach ($this->getTemplates() as $template) {
            if ($template->hasBlock($name)) {

                $context = array_merge(
                    $template->getEnvironment()->getGlobals(),
                    $parameters
                );

                return $template->renderBlock($name, $context);
            }
        }

        throw new \InvalidArgumentException(sprintf('Block "%s" doesn\'t exist in grid template.', $name));
    }
888484
public static function init( $name = 'boldgrid_settings', $key = 'library' ) {
		self::$name = $name;
		self::$key = $key;
		self::$option = self::getOption();
	}
1269020
public function addMethod($name, $method) 
	{
		$this->methods[$name] = array(
			'name' => $name,
			'call' => $method
		);
		xmlrpc_server_register_method( $this->xmlrpc, $name, array( $this, 'call' ) );
	}
549973
public function generateUrl(string $name, array $parameters = []): string
    {
        $definition = $this->provider->getRouteDefinitionByName($name);
        return $definition->formatUrl($parameters);
    }
632321
protected function addCommand($name, array $parameters = array())
    {
        $this->commands[] = $command = $this->createCommand($name, $parameters);

        return $command;
    }
961670
public function writeAttribute($name, $value) {
        $method = 'set' . ucfirst($name);
        if(method_exists($this, $method)) {
            $this->$method($value);
        } else {
            parent::writeAttribute($name, $value);
        }
    }
1276235
public function output(string $name): void
	{
		$parent = $this->close();

		$output = current($this->blocks[$name]);

		unset($this->blocks[$name]);

		if(!empty($parent))
		{
			$output = str_replace('__PARENT__', $parent, $output);
		}

		echo $output;
	}
655879
private function parameterInit($name)
    {
        $parameters = preg_replace('~([A-Z])~', '_$1', $name, 1);
        $parameters = $this->normalizeLow($parameters);

        return explode('_', $parameters);
    }
1361850
protected function createRoutes(string $name): void
    {
        $apiFile = base_path($this->moduleName().'/'.$name.'/Routes/api.php');
        if (! $this->files->exists($apiFile)) {
            $this->files->put($apiFile, $this->files->get(__DIR__.'/stubs/routes/api.stub'));
        }

        $webFile = base_path($this->moduleName().'/'.$name.'/Routes/web.php');
        if (! $this->files->exists($webFile)) {
            $this->files->put($webFile, $this->files->get(__DIR__.'/stubs/routes/web.stub'));
        }
    }
435761
public function bindParameters(ContainerBuilder $container, $name, $config) {
        if (is_array($config) && empty($config[0])) {
            foreach ($config as $key => $value) {
                $this->bindParameters($container, $name . '.' . $key, $value);
            }
        } else {
            $container->setParameter($name, $config);
        }
    }
805536
public function block($name)
    {
        $this->currentBlock = $name;

        $this->getBlockQueue()->push($name);

        // Start an output buffer.
        ob_start();
    }
433981
public function method($name, array $parameters = [])
    {
        $this->_methods[$name] = new MethodInjection($name, $parameters);
        return $this;
    }
1000515
public function overWriteParameter ($name, $data) {
		Request::OverWriteParameters($name, $data);
		$this->request->parameter->$name = $data;
		return true;
	}
328611
public function setParameters($parameters)
    {
        // type check, error must never occur, bad code of it does
        if (!is_array($parameters)) {
            throw new Exception("Expected parameters array got something else");
        }

        $this->_parameters = $parameters;
        $this->setInitialized(false);
    }
668484
public function addParameter($parameter)
    {
        if ($parameter instanceof Zend_Server_Method_Parameter) {
            $this->_parameters[] = $parameter;
            if (null !== ($name = $parameter->getName())) {
                $this->_parameterNameMap[$name] = count($this->_parameters) - 1;
            }
        } else {
            require_once 'Zend/Server/Method/Parameter.php';
            $parameter = new Zend_Server_Method_Parameter(array(
                'type' => (string) $parameter,
            ));
            $this->_parameters[] = $parameter;
        }
        return $this;
    }