Renders JS chain arguments.

@param array $args

@return string
979815
private function _renderArgs($args = [])
    {
        return '('.
            implode(',', array_map(function ($arg) {
                if ($arg instanceof jsExpressionable) {
                    return $arg->jsRender();
                }

                return $this->_json_encode($arg);
            }, $args)).
            ')';
    }
1209439
public function minifyJs(array $args = array()) {
        $ini = Zend_Registry::get('config');
        if (empty($ini->assets->js)) {
            Garp_Cli::errorOut(
                "You do not have a valid asset configuration specified in application.ini.\n" .
                "Configure like this:\n" .
                'assets.js.main_js.filename = "main.min.js"' . "\n" .
                'assets.js.main_js.sourcefiles[] = "libs/myplugin.js"' . "\n" .
                'assets.js.main_js.sourcefiles[] = "main.js"' . "\n" .
                "This will combine libs/myplugin.js and main.js into main.min.js."
            );
            return false;
        }

        $jsRoot = ltrim($ini->assets->js->basePath ?: 'js', '/');
        $assets = $ini->assets->js->toArray();
        unset($assets['basePath']);

        $selectedKey = null;
        if (!empty($args)) {
            $selectedKey = $args[0];
        }

        foreach ($assets as $key => $assetSettings) {
            if (!is_null($selectedKey) && $key != $selectedKey) {
                continue;
            }
            if (empty($assetSettings['sourcefiles'])
                || empty($assetSettings['filename'])
            ) {
                Garp_Cli::errorOut(
                    $key .
                    ' is not configured correctly. "sourcefiles" and "filename" are required keys.'
                );
                return false;
            }
            $minifier = new Garp_Assets_Minifier(APPLICATION_PATH . '/../public/' . $jsRoot);
            $minifier->minifyJs($assetSettings['sourcefiles'], $assetSettings['filename']);
        }
        Garp_Cli::lineOut('Done.');
        return true;
    }
107996
private function preserveOldArgFormat(array $args)
    {
        if (isset($args[0]) && !is_array($args[0])) {
            $args = [$args];
        } elseif (empty($args)) {
            $args = [[]];
        }

        return $args;
    }
1329734
static public function renderTag($args){
        $attr = $args['@attrib'];
        $tmp = Template::instance();
        foreach($attr as &$att)
            $att = $tmp->token($att);
        $pn_code = '$pn = new Pagination('.$attr['items'].');';
        if(array_key_exists('limit',$attr))
            $pn_code .= '$pn->setLimit('.$attr['limit'].');';
        if(array_key_exists('range',$attr))
            $pn_code .= '$pn->setRange('.$attr['range'].');';
        if(array_key_exists('src',$attr))
            $pn_code .= '$pn->setTemplate("'.$attr['src'].'");';
        if(array_key_exists('token',$attr))
            $pn_code .= '$pn->setRouteKey("'.$attr['token'].'");';
        if(array_key_exists('link-path',$attr))
            $pn_code .= '$pn->setLinkPath("'.$attr['link-path'].'");';
        if(array_key_exists('token-prefix',$attr))
            $pn_code .= '$pn->setRouteKeyPrefix("'.$attr['token-prefix'].'");';
        $pn_code .= 'echo $pn->serve();';
        return '<?php '.$pn_code.' ?>';
    }
1135051
protected function renderTemplateString( $template, array $args = [] )
	{
		foreach( $args as $key => $value ) {
			$template = str_replace( '{'.$key.'}', $value, $template );
		}
		return trim( $template );
	}
73388
protected function renderTemplate( $templatePath, array $args = [] )
	{
		$file = $this->template->get( 'castor/email/'.$templatePath );

		if( !file_exists( $file )) {
			$file = sprintf( '%s/templates/email/%s.php', dirname( dirname( __DIR__ )), $templatePath );
		}
		if( !file_exists( $file ))return;

		ob_start();
		include $file;
		$template = ob_get_clean();

		return $this->renderTemplateString( $template, $args );
	}
1131697
function renderAllowCloning( $args ) {
		$options = get_site_option( $this->getSlug() );
		$this->renderCheckbox(
			[
				'id' => 'enable_cloning',
				'name' => $this->getSlug(),
				'option' => 'enable_cloning',
				'value' => ( isset( $options['enable_cloning'] ) ) ? $options['enable_cloning'] : '',
				'label' => $args[0],
			]
		);
	}
986959
protected function getArgumentOutput(array $args) : string
    {
        $out = '  Original arguments:' . PHP_EOL;
        foreach ($args as $name => $value) {
            $out .= '    ' . $name . ' => <comment>' . $value . '</comment>' . PHP_EOL;
        }
        return $out;
    }
686914
protected function serializeArguments(array $args)
    {
        // first we have to sort the args by key to avoid that different orders
        // lead to different cache entries!
        ksort($args);

        $result = '';
        $invalidKeys = array('userid', 'apikey', 'keyid', 'vcode');
        foreach ($args as $key => $value) {
            $key   = trim($key);
            $value = trim($value);
            if (empty($value) || in_array($key, $invalidKeys)) {
                // ignore the invalid keys...
                continue;
            }
            $result .= ';' . $key . '=' . $value;
        }

        return $result;
    }
148209
function renderCompressImagesField( $args ) {
		unset( $args['label_for'], $args['class'] );
		$this->renderCheckbox(
			[
				'id' => 'ebook_compress_images',
				'name' => 'pressbooks_theme_options_' . $this->getSlug(),
				'option' => 'ebook_compress_images',
				'value' => ( isset( $this->options['ebook_compress_images'] ) ) ? $this->options['ebook_compress_images'] : '',
				'label' => $args[0],
			]
		);
	}
1262910
public function url( array $args = [] ) {
		$url = $this->siteurl;
		if ( $args ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;
	}
1226867
public function render($name, array $args = array())
    {
        if ($this->has($name)) {
            $callback = $this->widgets[$name];

            return $this->executeCallback($callback, $args);
        }

        return '';
    }
1091000
public static function serialize(array $args)
    {
        return array_reduce(
            $args,
            function ($msg, $arg) {
                return $msg.'$'.strlen($arg)."\r\n".$arg."\r\n";
            },
            '*'.count($args)."\r\n"
        );
    }
390796
protected function renderRaw($content, $args = array(), $templateDir = null)
    {
        if (\is_array($content)) {
            $content = json_encode($content);
        }

        return $content;
    }
156123
public function url( array $args = []) {
		$url = get_term_link( $this->term );
		if ( $args ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;
	}
345993
public function output($args = null) {
        $i = 0;
        foreach ($this->jobs as $job)
            if($job['function']($job['msg']) === TRUE)
                $i++;

        $this->jobs = [];
        return $i;
    }
16574
public static function formatString($str, $args)
    {
        foreach ($args as $k => $v) {
            $str = preg_replace('/:'. $k. ':/', $v, $str);
        }
        return $str;
    }