@param string|null $url
@param string|null $addPostUrl
@param string|null $view
@param string|null $text
@param string|null $confirmText
@param string|null $class
@param string|null $icon

@return \Illuminate\Contracts\Support\Renderable
549911
public function setButtonCheckboxAction(
        string $url = null,
        string $addPostUrl = null,
        string $text = null,
        string $confirmText = null,
        string $class = null,
        string $icon = ''
    ): ButtonInterface {
        $addPostUrl = $addPostUrl ?: '?deleted=';
        $class = $class ?: 'btn btn-default btn-outline-primary js_btnCustomAction js_linkDelete';
        $text = $text ?: GridView::trans('grid.selectDelete');
        $confirmText = $confirmText ?: GridView::trans('grid.clickDelete');

        return $this->setActionCustom($url . $addPostUrl, $text, $class, $icon)
            ->setAction(self::TYPE_ACTION_CUSTOM)
            ->setConfirmText($confirmText)
            ->setOptions([
                'data-url'     => $this->getUrl(),
                'data-confirm' => $confirmText,
            ]);
    }
654559
public function render()
    {
        $this->formActionUri = null;
        if ($this->arguments['action'] === null && $this->arguments['actionUri'] === null) {
            throw new ViewHelper\Exception('FormViewHelper requires "actionUri" or "action" argument to be specified', 1355243748);
        }
        $this->tag->addAttribute('action', $this->getFormActionUri());

        if (strtolower($this->arguments['method']) === 'get') {
            $this->tag->addAttribute('method', 'get');
        } elseif (strtolower($this->arguments['method']) === 'dialog') {
            $this->tag->addAttribute('method', 'dialog');
        } else {
            $this->tag->addAttribute('method', 'post');
        }

        $this->addFormObjectNameToViewHelperVariableContainer();
        $this->addFormObjectToViewHelperVariableContainer();
        $this->addFieldNamePrefixToViewHelperVariableContainer();
        $this->addFormFieldNamesToViewHelperVariableContainer();
        $this->addEmptyHiddenFieldNamesToViewHelperVariableContainer();
        $this->viewHelperVariableContainer->addOrUpdate(FormViewHelper::class, 'required-enctype', '');

        $formContent = $this->renderChildren();

        $requiredEnctype = $this->viewHelperVariableContainer->get(FormViewHelper::class, 'required-enctype');
        if ($requiredEnctype !== '' && $requiredEnctype !== strtolower($this->arguments['enctype'])) {
            throw new WrongEnctypeException('The form you are trying to render requires an enctype of "' . $requiredEnctype . '". Please specify the correct enctype when using file uploads.', 1522706399);
        }

        // wrap hidden field in div container in order to create XHTML valid output
        $content = chr(10) . '<div style="display: none">';
        if (strtolower($this->arguments['method']) === 'get') {
            $content .= $this->renderHiddenActionUriQueryParameters();
        }
        $content .= $this->renderHiddenIdentityField($this->arguments['object'], $this->getFormObjectName());
        $content .= $this->renderAdditionalIdentityFields();
        $content .= $this->renderHiddenReferrerFields();
        $content .= $this->renderEmptyHiddenFields();
        // Render the trusted list of all properties after everything else has been rendered
        $content .= $this->renderTrustedPropertiesField();
        $content .= $this->renderCsrfTokenField();
        $content .= '</div>' . chr(10);
        $content .= $formContent;

        $this->tag->setContent($content);

        $this->removeFieldNamePrefixFromViewHelperVariableContainer();
        $this->removeFormObjectFromViewHelperVariableContainer();
        $this->removeFormObjectNameFromViewHelperVariableContainer();
        $this->removeFormFieldNamesFromViewHelperVariableContainer();
        $this->removeEmptyHiddenFieldNamesFromViewHelperVariableContainer();

        return $this->tag->render();
    }
1211414
function put($http_method = null, $ext = null) {
        static::$icons[$this->getAs()] = $this->getIcon();
        \Route::group([
            'middleware' => $this->getMiddleware(),
            'domain'     => $this->getDomain(),
            'prefix'     => $this->getPrefix(),
        ], function () use ($http_method, $ext) {
            $method = self::normalizeMethod($http_method);
            /** @var $route \Illuminate\Routing\Route */
            $route = \Route::$method($this->getUrl() . ($ext ? '.' . $ext : ''), [
                'as'   => $this->getAs(),
                'uses' => $this->getUses(),
            ]);
            if(count($this->getPatterns())) {
                $route->where($this->getPatterns());
            }
        });

        $this->action = null;
        $this->icon   = null;

        return $this;
    }
817582
public function pick_action_icon(moodle_url $url, $text, $icon = '', $class = '') {

        $img = $this->output->pix_icon($icon, '');
        $txt = html_writer::tag('div', $text, array('class' => 'action-text'));
        return html_writer::link($url, $img . $txt, array('class' => 'action '.$class));
    }
994687
public function display($tpl = null)
    {
        $attributes = array();
        $query = array();

        $app = JFactory::getApplication();
        $input = $app->input;

        $routeName = $input->get('route', null, 'string');
        $path = $input->get('path', null, 'string');

        $route = self::$router->getRouteCollection()->get($routeName);
        $defaults = $route->getDefaults();

        if ($path !== null) {
            $path = rtrim($route->getPath(), '/') . '/' . $path;
            $defaults = self::$router->match($path, null, false);
        }

        unset($attributes['_controller']);

        foreach ($defaults as $key => $default) {
            if (!isset($attributes[$key])) {
                $attributes[$key] = $default;
            }
        }

        $subRequest = self::$requestStack->getCurrentRequest()->duplicate($query, null, $attributes);

        $this->response = self::$kernel->handle(
            $subRequest,
            \Symfony\Component\HttpKernel\HttpKernelInterface::SUB_REQUEST,
            false
        );

            // Display the view
        parent::display($tpl);
    }
608823
public static function add($text, $class = 'warning', $icon = null, $buttons = null)
    {
        add_filter('Municipio/viewData', function ($data) use ($text, $class, $icon, $buttons) {
            $data['notice'][] = array(
                'class' => $class,
                'icon' => $icon,
                'text' => $text,
                'buttons' => $buttons
            );
            return $data;
        });
    }
598273
public function button($text, $url, $class = 'default', $parameters = array())
    {
        $this->message['buttons'][] = array(
            'text' => $this->container->translate($text, $parameters),
            'url' => $url,
            'class' => $class,
        );
        return $this;
    }
666953
public function showAction(Request $request, $url = '')
    {
        $response = $this->get('victoire_page.page_helper')->renderPageByUrl(
            $request->getUri(),
            $url,
            $request->getLocale(),
            $request->isXmlHttpRequest() ? $request->query->get('modalLayout', null) : null
        );

        return $response;
    }
309698
public static function urlLink($text, $url, $parameters = [], $secure = null)
    {
        return $this->createElement('a')->text($text)
            ->href(url($url, $parameters, $secure));
    }
142687
public function addImageFromUrl($url) {
        if (is_string($url)) {
            // URL specified as a string. Create a URL instance
            $url = GuzzleUrl::factory($url);
        }

        if (!($url instanceof GuzzleUrl)) {
            // Invalid argument
            throw new InvalidArgumentException(
                'Parameter must be a string or an instance of Guzzle\Http\Url'
            );
        }

        if (!$url->getScheme()) {
            throw new InvalidArgumentException('URL is missing scheme: ' . (string) $url);
        }

        // Fetch the image we want to add
        $image = (string) $this->get($url)->send()->getBody();

        return $this->addImageFromString($image);
    }
153973
public function renderForm($options = NULL) {

	//Verify if user send options if not I declare
	if(is_null($options))
	{
	  	$options = array(
		  	'button_type' => 'image',
		  	'button_class' => 'btn-paid-khipu',
		  	'button_submit' => array( 'options' => array(
										
										'value' => 'Pagar con Khipu'
										)),
		  	'button_image' => array( 'options' => array(
										'size' => '100x50',
										'url' => NULL,
										))


	  );
	}

	$values = $this->getFormLabels();
	$html = new \DOMDocument();
	$html->formatOutput = true;

	$form = $html->createElement('form');
	$form->setAttribute('action', $this->getApiUrl());
	$form->setAttribute('method', 'POST');
	foreach($values as $name => $value) {
	  	$input_hidden = $html->createElement('input');
	  	$input_hidden->setAttribute('type', 'hidden');
	  	$input_hidden->setAttribute('name', $name);
	  	$input_hidden->setAttribute('value', $value);
	  	$form->appendChild($input_hidden);
	}
	$input_hidden = $html->createElement('input');
	$input_hidden->setAttribute('type', 'hidden');
	$input_hidden->setAttribute('name', 'agent');
	$input_hidden->setAttribute('value', $this->agent);
	$form->appendChild($input_hidden);

	if($options['button_type'] === 'image')
	{
	  	//Verify if user use custom URL
	  	if(! is_null($options['button_image']['options']['url']) )
	  	{
			$submit = $html->createElement('input');
	  		$submit->setAttribute('class', $options['button_class']);
			$submit->setAttribute('type', 'image');
			$submit->setAttribute('src', $options['button_image']['options']['url']);
	  	}
	  	else
	  	{
	  		//We use default khipu button
		  	$buttons = Khipu::getButtonsKhipu();
		  	if (isset($buttons[$options['button_image']['options']['size']])) {
				$button = $buttons[$options['button_image']['options']['size']];
		  	}
		  	else {
				$button = $buttons['100x50'];
		  	}
		  	$submit = $html->createElement('input');
	  		$submit->setAttribute('class', $options['button_class']);
		  	$submit->setAttribute('type', 'image');
		  	$submit->setAttribute('src', $button);
	  	}
	  
	}
	else
	{
	  	$submit = $html->createElement('input');
	  	$submit->setAttribute('type', 'submit');
	  	$submit->setAttribute('class', $options['button_class']);
	  	$submit->setAttribute('value', $options['button_submit']['options']['value']);
	}

	$form->appendChild($submit);

	$html->appendChild($form);

	return $html->saveHTML();
  }
169333
function http($url, $post_data = null) {/*{{{*/
    $ch = curl_init();
    if (defined("CURL_CA_BUNDLE_PATH")) curl_setopt($ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    //////////////////////////////////////////////////
    ///// Set to 1 to verify Server's SSL Cert //////
    //////////////////////////////////////////////////
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    if (isset($post_data)) {
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }

    $response = curl_exec($ch);
    $this->http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $this->last_api_call = $url;
    curl_close ($ch);

	/**
    echo "<pre>";
    echo $url . "\n";
    print_r(explode("&", $post_data)) . "\n";
    print_r($response) . "\n";
    echo "---\n</pre>";
	 */

    return $response;
  }
588681
function createTemplate($class = NULL, callable $latteFactory = NULL)
	{
		$template = $this->getTemplateFactory()->createTemplate($this);

		// Macro {url ...}
		$latte = $template->getLatte();
		$macroSet = new Latte\Macros\MacroSet($latte->getCompiler());
		$macroSet->addMacro('url', function () {}/*, NULL, NULL, $macroSet::ALLOWED_IN_HEAD*/); // ignore

		$params = $this->request->getParameters();
		$template->presenter = $this;
		$template->context = $this->context;

		$file = self::actionToFilename($params['action']);
		if ($file{0} !== '/') {
			$file = $this->getPagesDir() . DIRECTORY_SEPARATOR . $file;
			if ( ! Strings::endsWith($file, '.latte')) {
				$file .= '.latte';
			}
		}

		$template->setFile($file);

		if ($this->getHttpRequest()) {
			$url = $this->getHttpRequest()->getUrl();
			$template->baseUrl = rtrim($url->getBaseUrl(), '/');
			$template->basePath = rtrim($url->getBasePath(), '/');
		}

		return $template;
	}
293697
public function slugAction(Request $request, $url = null, $preview = false)
    {
        /* @var EntityManager $em */
        $em = $this->getDoctrine()->getManager();
        $locale = $request->getLocale();

        /* @var NodeTranslation $nodeTranslation */
        $nodeTranslation = $request->attributes->get('_nodeTranslation');

        // If no node translation -> 404
        if (!$nodeTranslation) {
            throw $this->createNotFoundException('No page found for slug ' . $url);
        }

        $entity = $this->getPageEntity(
            $request,
            $preview,
            $em,
            $nodeTranslation
        );
        $node = $nodeTranslation->getNode();

        $securityEvent = new SlugSecurityEvent();
        $securityEvent
            ->setNode($node)
            ->setEntity($entity)
            ->setRequest($request)
            ->setNodeTranslation($nodeTranslation);

        $nodeMenu = $this->container->get('kunstmaan_node.node_menu');
        $nodeMenu->setLocale($locale);
        $nodeMenu->setCurrentNode($node);
        $nodeMenu->setIncludeOffline($preview);

        $eventDispatcher = $this->get('event_dispatcher');
        $eventDispatcher->dispatch(Events::SLUG_SECURITY, $securityEvent);

        //render page
        $renderContext = new RenderContext(
            array(
                'nodetranslation' => $nodeTranslation,
                'slug' => $url,
                'page' => $entity,
                'resource' => $entity,
                'nodemenu' => $nodeMenu,
            )
        );
        if (method_exists($entity, 'getDefaultView')) {
            /* @noinspection PhpUndefinedMethodInspection */
            $renderContext->setView($entity->getDefaultView());
        }
        $preEvent = new SlugEvent(null, $renderContext);
        $eventDispatcher->dispatch(Events::PRE_SLUG_ACTION, $preEvent);
        $renderContext = $preEvent->getRenderContext();

        /** @noinspection PhpUndefinedMethodInspection */
        $response = $entity->service($this->container, $request, $renderContext);

        $postEvent = new SlugEvent($response, $renderContext);
        $eventDispatcher->dispatch(Events::POST_SLUG_ACTION, $postEvent);

        $response = $postEvent->getResponse();
        $renderContext = $postEvent->getRenderContext();

        if ($response instanceof Response) {
            return $response;
        }

        $view = $renderContext->getView();
        if (empty($view)) {
            throw $this->createNotFoundException(sprintf('Missing view path for page "%s"', get_class($entity)));
        }

        $template = new Template(array());
        $template->setTemplate($view);

        $request->attributes->set('_template', $template);

        return $renderContext->getArrayCopy();
    }
685152
public function addLink($text, array $url = [], $options = [])
    {
        $linkUrl = '#';
        $defaultIsActive = false;
        if ($to = array_get($url, 'to')) {
            $linkUrl = $this->manager->getUrl()->to($to);
        } elseif ($route = array_get($url, 'route')) {
            if (!is_array($route)) {
                $route = [$route];
            }

            $routeName = array_shift($route);
            $routeParams = $route;

            $linkUrl = $this->manager->getUrl()->route($routeName, $routeParams);
            $defaultIsActive = [
                'route'       => $routeName,
                'route_param' => $routeParams,
            ];
        } elseif ($action = array_get($url, 'action')) {
            if (!is_array($action)) {
                $action = [$action];
            }

            $actionName = array_shift($action);

            $linkUrl = $this->manager->getUrl()->action($actionName, $action);
            $defaultIsActive = [
                'action'      => $actionName,
                'route_param' => $action,
            ];
        }
        if ($query = array_get($url, 'query')) {
            $linkUrl .= '?' . http_build_query($query);
            $defaultIsActive['query'] = $query;
        }

        if (!isset($options['url_def'])) {
            $options['url_def'] = $defaultIsActive;
        }

        $this->addItem([
            'text' => $text,
            'url'  => $linkUrl,
        ], $options);

        return $this;
    }
551169
private function AddConfirmUrlField()
    {
        $name = 'ConfirmUrl';
        $this->selectorConfirm = new PageUrlSelector($name, Trans($this->Label($name)), $this->register->GetConfirmUrl());
        $this->selectorConfirm->SetRequired($this->ErrorPrefix($name));
        $this->Elements()->AddElement($name, $this->selectorConfirm);
    }
252390
public function url(string $url, string $title, int $order = null, string $icon = null, array $attributes = []): MenuItem
    {
        ! $this->urlPrefix || $url = $this->formatUrl($url);

        return $this->add(compact('url', 'title', 'order', 'icon', 'attributes'));
    }