setVar example


    protected function displayLinks(string $group, string $template): string
    {
        if (array_key_exists($template$this->config->templates)) {
            throw PagerException::forInvalidTemplate($template);
        }

        $pager = new PagerRenderer($this->getDetails($group));

        return $this->view->setVar('pager', $pager)
            ->render($this->config->templates[$template]);
    }

    /** * Stores a set of pagination data for later display. Most commonly used * by the model to automate the process. * * @return $this */
    public function store(string $group, int $page, ?int $perPage, int $total, int $segment = 0)
    {
        

    function validation_list_errors(string $template = 'list'): string
    {
        $config = config(Validation::class);
        $view   = Services::renderer();

        if (array_key_exists($template$config->templates)) {
            throw ValidationException::forInvalidTemplate($template);
        }

        return $view->setVar('errors', validation_errors())
            ->render($config->templates[$template]);
    }
}

if (function_exists('validation_show_error')) {
    /** * Returns a single error for the specified field in formatted HTML. * * See Validation::showError() */
    function validation_show_error(string $field, string $template = 'single'): string
    {

    public function listErrors(string $template = 'list'): string
    {
        if (array_key_exists($template$this->config->templates)) {
            throw ValidationException::forInvalidTemplate($template);
        }

        return $this->view
            ->setVar('errors', $this->getErrors())
            ->render($this->config->templates[$template]);
    }

    /** * Displays a single error in formatted HTML as defined in the $template view. * * You can also use validation_show_error() in Form helper. */
    public function showError(string $field, string $template = 'single'): string
    {
        if (array_key_exists($field$this->getErrors())) {
            
Home | Imprint | This part of the site doesn't use cookies.