Outputs the widget content
@param  array $args     Widget arguments
@param  array $instance Widget instance
@return void
779728
public function widget($args, $instance)
    {
        if (!isset($instance['module_id']) || !is_numeric($instance['module_id'])) {
            return false;
        }

        $display = \Modularity\App::$display;

        $columnWidth = (isset($instance['module_size'])) ? $instance['module_size'] : 'grid-md-4';

        if (isset($instance['module_type']) && $instance['module_type'] == 'mod-slider') {
           $columnWidth = '';
        }

        $columnWidth = apply_filters('Modularity/Widget/ColumnWidth', $columnWidth, $instance);

        $module = \Modularity\Editor::getModule(
            $instance['module_id'],
            array(
                'hidden' => false,
                'columnWidth' => $columnWidth
            )
        );

        $display->outputModule($module, $args);
    }
836507
public function output($args) {
		$args += ['', '', 63];
		$this->_consoleOutput->write($this->_getState($args[0], $args[1], $args[2]));
	}
1313470
public function display(array $args = array()) {
        if (empty($args)) {
            Garp_Cli::errorOut('The least you can do is provide a text...');
        } else {
            $text = implode(' ', $args);
            $figlet = new Zend_Text_Figlet();
            Garp_Cli::lineOut($figlet->render($text));
        }
        return true;
    }
1265693
public function execute(array $args, array $options = [])
    {
        $this->bootstrap($args, $options);

        // get the seed path from the config
        $path = $this->getConfig()->getSeedPath();

        if (!file_exists($path)) {
            $ask = new Dialog();
            if ($ask->confirm(Colour::colour('Create seeds directory?', [Colour::RED, Colour::HIGHLIGHT]))) {
                mkdir($path, 0755, true);
            }
        }

        $this->verifySeedDirectory($path);
        $path = realpath($path);

        $className = $args[0];

        if (!Util::isValidPhinxClassName($className)) {
            throw new \InvalidArgumentException(sprintf(
                'The seed class name "%s" is invalid. Please use CamelCase format',
                $className
            ));
        }

        // Compute the file path
        $filePath = $path . DIRECTORY_SEPARATOR . $className . '.php';

        if (is_file($filePath)) {
            throw new \InvalidArgumentException(sprintf(
                'The file "%s" already exists',
                basename($filePath)
            ));
        }

        // inject the class names appropriate to this seeder
        $contents = file_get_contents($this->getSeedTemplateFilename());
        $classes = [
            '$useClassName' => 'Phinx\Seed\AbstractSeed',
            '$className' => $className,
            '$baseClassName' => 'AbstractSeed',
        ];
        $contents = strtr($contents, $classes);

        if (false === file_put_contents($filePath, $contents)) {
            throw new \RuntimeException(sprintf(
                'The file "%s" could not be written to',
                $path
            ));
        }

        Output::writeln('using seed base class ' . $classes['$useClassName']);
        Output::writeln('created ' . str_replace(Cml::getApplicationDir('secure_src'), '{secure_src}', $filePath));
    }
58281
public function writeCommand($command, $args = [])
    {
        if (OutputInterface::VERBOSITY_VERBOSE > $this->getOutput()->getVerbosity()) {
            return;
        }

        if (count($args)) {
            $outArr = [];
            foreach ($args as $arg) {
                if (is_array($arg)) {
                    $arg = array_map(
                        function ($value) {
                            return '\'' . $value . '\'';
                        },
                        $arg
                    );
                    $outArr[] = '[' . implode(', ', $arg) . ']';
                    continue;
                }

                $outArr[] = '\'' . $arg . '\'';
            }
            $this->getOutput()->writeln(' -- ' . $command . '(' . implode(', ', $outArr) . ')');

            return;
        }

        $this->getOutput()->writeln(' -- ' . $command);
    }
289506
public function widget($args, $instance)
    {
        $this->mustacheRender = App::get(MustacheRender::class);
        $this->i18n = App::get(I18n::class);
        $instance['active'] = $this->isActive();
        echo $this->renderFrontendWidget($args, $instance);
    }
565119
public function main(array $args = array()) {
        Garp_Cli::lineOut('Welcome to the Garp interactive shell.', Garp_Cli::YELLOW);
        Garp_Cli::lineOut('Use Ctrl-C to quit.');

        $this->_setErrorHandler();
        $this->_tick();
    }
431900
public function copyfrom($args) {
        if (($args || \Base::instance()->exists($args,$args))
        && is_array($args))
            foreach ($args as $arg => $val)
                $this->{$arg} = $val;
    }
673391
public function widget($args, $instance)
    {
        global $wpdb;

        // Try to get cached widget.
        $cache = wp_cache_get($this->getModel()->getIdentifier(), 'widget');

        if (!is_array($cache)) {
            $cache = [];
        }

        if (!isset($args['widget_id'])) {
            $args['widget_id'] = null;
        }

        // If all elements are in cache, no need to construct the output again.
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }

        // Start output buffering.
        ob_start();

        // Extract data.
        extract($args, EXTR_SKIP);

        // Title
        $title = empty($instance['title']) ? '' : $instance['title'];
        $title = apply_filters('widget_title', $title, $instance, $this->getModel()->getIdentifier());

        // Display content widget
        $this->widget_start($args, $instance, $title);
        $this->display($instance);
        $this->widget_end($args);

        // Renew the cache.
        $cache[$args['widget_id']] = ob_get_flush();
        wp_cache_set($this->getModel()->getIdentifier(), $cache, 'widget');
    }
349299
public static function PrintValue($arg1, $arg2 = null)
	{
		if (self::$_logger == null)
			self::$_logger = new LogWrapper('debug.output');

		for ($i = 0, $numArgs = func_num_args(); $i < $numArgs ; $i++)
		{
			$var = func_get_arg($i);
			ErrorHandler::getInstance()->addExtraInfo('DEBUG_' . (Debug::$count++), $var);

			if (array_key_exists("raw", $_REQUEST))
			{
				continue;
			}

			if (is_array($var))
			{
				self::writeLog(null, print_r($var, true), true);
			}
			elseif ($var instanceof SingleRow)
			{
				self::writeLog('SingleRow', print_r($var->toArray(), true), true);
			}
			elseif ($var instanceof AnyDataset)
			{
				Debug::PrintValue($var->getIterator());
			}
			elseif ( ($var instanceof IteratorInterface) || ($var instanceof AnyIterator) )
			{
				$it = $var;
				if (!$it->hasNext())
				{
					self::writeLog('IteratorInterface', "Não trouxe registros.", false);
				}
				else
				{
					$result = "<style>.devdebug {border: 1px solid silver; padding: 2px;} table.devdebug {border-collapse:collapse;} th.devdebug {background-color: silver}</style>"
							. "<table class='devdebug'>";
					$arr = null;
					while ($it->hasNext())
					{
						$i++;
						$sr = $it->moveNext();
						if ($i>100)
							break;

						if (is_null($arr))
						{
							$arr = $sr->getFieldNames();
							$result .= '<tr><th class="devdebug">' . implode('</b></th><th class="devdebug">', $arr) . '</th></tr>';
						}

						$raw = $sr->toArray();
						$result .= '<tr>';
						foreach($raw as $item)
						{
							$result .= '<td class="devdebug">';
							if (is_array($item))
							{
								$result .= implode(',', $item);
							}
							else
							{
								$result .= $item;
							}
							$result .= '</td>';
						}
						$result .= '</tr>';
					}
					$result .= "</table>";
					self::writeLog('IteratorInterface', $result, false);
				}
			}
			elseif ($var instanceof IteratorFilter)
			{
				$filter = $var->getSql("ANYTABLE", $param, "*");
				$filter = substr($filter, strpos($filter, "where") + 6);
				$result = array(
					"XPath" => $var->getXPath(),
					"Filter" => $filter
				) + $param;

				self::writeLog(get_class($var), print_r($result, true), true);
			}
			elseif ($var instanceof FilenameProcessor)
			{
				$result = array(
					"PathSuggested()" => $var->PathSuggested(),
					"PrivatePath()" => $var->PrivatePath(),
					"SharedPath()" => $var->SharedPath(),
					"Name" => $var->ToString(),
					"Extension()" => $var->Extension(),
					"FullQualifiedName()" => $var->FullQualifiedName(),
					"FullQualifiedNameAndPath()" => $var->FullQualifiedNameAndPath(),
					"getFilenameLocation()" =>  $var->getFilenameLocation(),
					"File Exists?" => file_exists($var->FullQualifiedNameAndPath()) ? "yes" : "no"
				);

				self::writeLog(get_class($var), print_r($result, true), true);
			}
			elseif ($var instanceof LanguageCollection)
			{
				self::writeLog("", get_class($var) . ": Is Loaded? " . ($var->loadedFromFile() ? 'yes' : 'no'), false);
				$var->Debug();
			}
			elseif (is_object($var))
			{
				if ($var instanceof DOMDocument)
				{
					$var->formatOutput = true;
					self::writeLog(get_class($var), htmlentities($var->saveXML()), true);
				}
				elseif ( ($var instanceof DOMElement) || ($var instanceof DOMNode) )
				{
					$doc = $var->ownerDocument;
					$doc->formatOutput = true;
					echo htmlentities($doc->saveXML($var)) . "</pre>";
					self::writeLog(get_class($var), htmlentities('[' . $var->nodeName . "]") . "\n" . htmlentities($doc->saveXML()), true);
				}
				else
				{
					self::writeLog(get_class($var), print_r($var, true), true);
				}
			}
			elseif (gettype($var) == "boolean")
			{
				self::writeLog("", '(boolean) ' . ($var ? "true":"false"), true);
			}
			else
			{
				self::writeLog("", gettype($var) . ": ". $var, true);
			}
		}
	}
1231400
public function form($instance)
    {
        $title = (isset($instance[ 'title' ])) ? $instance[ 'title' ] : __('New title', 'municipio');

        $output = '';
        $output .= '<p>';
        $output .= '<label for ="' . $this->get_field_id('title') . '">' . _e('Title:') . '</label>';
        $output .= '<input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_id('title') . '" type="text" value="' . esc_attr($title) . '">';
        $output .= '</p>';

        echo $output;
    }
156953
public function appendArg($arg)
    {
        Assertion::string($arg);
        $this->args = $this->args->append($arg);
    }
1318055
public function emit($event, $args=null)
    {
        if (is_array($this->listeners)){
            foreach($this->listeners as $event_key => $listers_of_event){
                if ($event_key == $event){
                    foreach ($listers_of_event as $listener){
                        call_user_func($listener,$args,$event);
                    }
                }
                else {
                    $reg_exp = $this->getRegExp($event_key);
                    if ($reg_exp && preg_match($reg_exp,$event)){
                        foreach ($listers_of_event as $listener){
                            call_user_func($listener,$args,$event);
                        }
                    }
                }
            }
        }
        }
1087333
public function form( $instance ) 
    {
        // Reset the names so that the form's update function works properly
        foreach ( $this->config->fields as $field )
        {
            $field->name = $field->init_name;
        }
        // Update values
        $this->form->updater->set_new_instance( $instance );
        $this->form->updater->update();
        
        // Set the widget specific field names and ids
        foreach ( $this->config->fields as $field )
        {
            $field->id   = $this->get_field_id( $field->init_name );
            $field->name = $this->get_field_name( $field->init_name );
        }
        
        // Print the form
        $this->form->render(true);
    }
164090
private function callInitMethod($instance)
    {
        $args = [];
        foreach ($this->init_method_args as $arg) {
            if (is_string($arg) && preg_match('/^\$([\w_]+)$/', $arg, $matches)) {
                $arg = $this->container->get($matches[1]);
            }
            $args[] = $arg;
        }
        call_user_func_array(array($instance, $this->init_method_name), $args);
    }
223427
public function executeCommand(array $args, OutputInterface $output, $message)
    {
        $name = $args[0];
        $cmd = $this->getCmd($args);

        $output->writeln('');
        $output->writeln(
            sprintf(
                '<info>Running %s</info>',
                $name
            )
        );

        $output->writeln(
            sprintf(
                '<comment>%s</comment>',
                $cmd
            )
        );

        $this->process->setCommandLine($cmd);
        $this->process->run(
            function ($type, $buffer) use ($output, $cmd) {
                if (Process::ERR === $type) {
                    $output->writeln(
                        sprintf(
                            '<error>%s</error>',
                            $buffer
                        )
                    );
                } else {
                    $output->writeln(
                        sprintf(
                            '<comment>%s</comment>',
                            $buffer
                        )
                    );
                }
            }
        );

        if (!$this->process->isSuccessful()) {
            throw new \RuntimeException($message . '<error>' . $this->process->getErrorOutput() . '</error>');
        }
    }
462636
public function execute(array $args, array $options = [])
    {
        $template = isset($options['template']) ? $options['template'] : false;
        $template || $template = __DIR__ . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'Controller.php.dist';

        $name = $args[0];
        $name = explode('-', $name);
        if (count($name) < 1) {
            throw new \InvalidArgumentException(sprintf(
                'The arg name "%s" is invalid. eg: adminbase-Blog/Category',
                $name
            ));
        }
        $namespace = str_replace('/', '\\', trim(trim($name[0], '\\/')));

        $path = Cml::getApplicationDir('apps_path') . DIRECTORY_SEPARATOR . $namespace . DIRECTORY_SEPARATOR
            . Cml::getApplicationDir('app_controller_path_name') . DIRECTORY_SEPARATOR;
        $component = explode('/', trim(trim($name[1], '/')));

        if (count($component) > 1) {
            $className = ucfirst(array_pop($component)) . Config::get('controller_suffix');
            $component = implode(DIRECTORY_SEPARATOR, $component);
            $path .= $component . DIRECTORY_SEPARATOR;
            $component = '\\' . $component;
        } else {
            $className = ucfirst($component[0]) . Config::get('controller_suffix');
            $component = '';
        }

        if (!is_dir($path) && false == mkdir($path, 0700, true)) {
            throw new \RuntimeException(sprintf(
                'The path "%s" could not be create',
                $path
            ));
        }

        $contents = strtr(file_get_contents($template), ['$namespace' => $namespace, '$component' => $component, '$className' => $className]);

        $file = $path . $className . '.php';
        if (is_file($file)) {
            throw new \RuntimeException(sprintf(
                'The file "%s" is exist',
                $file
            ));
        }

        if (false === file_put_contents($file, $contents)) {
            throw new \RuntimeException(sprintf(
                'The file "%s" could not be written to',
                $path
            ));
        }

        Output::writeln(Colour::colour('Controller created successfully. ', Colour::GREEN));
    }