returns data to render template

@param array $options
@throws WidgetException
@return array
183693
public function getData($options)
    {
        if (!empty($options) &&
            array_key_exists('contact', $options) &&
            !empty($options['contact'])
        ) {
            $id = $options['contact'];
            $contact = $this->em->getRepository(
                $this->contactEntityName
            )->find($id);

            if (!$contact) {
                throw new WidgetEntityNotFoundException(
                    'Entity ' . $this->contactEntityName . ' with id ' . $id . ' not found!',
                    $this->widgetName,
                    $id
                );
            }
            return $this->parseMainContact($contact);
        } else {
            throw new WidgetParameterException(
                'Required parameter account not found or empty!',
                $this->widgetName,
                'account'
            );
        }
    }
665666
protected function renderElement(string $name, array $options = []) : string
    {
        return $this->config->getView()
            ->element($name, $options);
    }
468077
public function getCheckboxes(array $options=[]) {
		if(isset($options['choices']))
			$choices = $options['choices'];
		else
			$choices = $this->getChoices();

		$checkboxes = [];
		foreach($choices as $k=>$v) {
			$checkbox_options = $options;
			$checkbox_options['value'] = $k;
			$checkbox_options['widget_name'] = $v;
			$checkboxes[$k] = $this->getCheckbox($v, $checkbox_options);
		}
		return $checkboxes;
	}
301538
public function getData(array $options)
    {
        $provider = $this->getProvider();

        $ownerDetails = $provider->getResourceOwner($this->accessToken);

        return new Result([
            'externalId' => $ownerDetails->getId(),
            'name'       => trim($ownerDetails->getFirstname() . ' ' . $ownerDetails->getLastname()),
            'profileUrl' => $ownerDetails->getUrl(),
            'photoUrl'   => $ownerDetails->getImageurl()
        ]);
    }
1225860
public function render($options = array()) {
		
		$result = $this->instance->render($options["pattern"], $options["data"]);
		// This error handler catches files that didn't render using any of the loaders.
		// The most common scenario is when a file's contents get passed to and through `Twig_Loader_String` and
		// outputs the raw Twig file contents like `@atoms/buttons/button.twig`.
		// @todo Remove this once `Twig_Loader_String` is removed.
		if (strpos($result, "@") === 0) {
			echo "Twig file not found: " . $result . "\n";
			exit(1);
		} else {
			return $result;
		}
		
	}
983923
public function getData($options)
    {
        if (!empty($options) &&
            array_key_exists('status', $options) &&
            !empty($options['status'])
        ) {
            $data = [];
            $data['status'] = $options['status'];

            if(array_key_exists('date', $options) &&
                !empty($options['date'])){
                $data['date'] = $options['date'];
            }

            return $data;
        } else {
            throw new WidgetParameterException(
                'Required parameter status not found or empty!',
                $this->widgetName,
                'status'
            );
        }
    }
1329070
public function render($options = array())
    {
        $string = $options['string'];
        $data = $options['data'];

        return $this->renderTpl($string, $data);
    }
460519
protected function renderEntityWidget($entities, array $options = [])
    {
        if (!array_key_exists('field', $options)) {
            // throw new \InvalidArgumentException('Missing "field" option for entity widget.');
            $options['field'] = null;
        }
        if (!array_key_exists('route', $options)) {
            $options['route'] = null;
        }
        if (!array_key_exists('route_params', $options)) {
            $options['route_params'] = [];
        }
        if (!array_key_exists('route_params_map', $options)) {
            $options['route_params_map'] = ['id' => 'id'];
        }

        if (null !== $entities && !($entities instanceof Collection)) {
            $entities = new ArrayCollection([$entities]);
        }

        $vars = [
            'route' => $options['route'],
            'field' => $options['field'],
            'route_params'     => $options['route_params'],
            'route_params_map' => $options['route_params_map'],
            'entities' => $entities
        ];

        return $this->renderBlock('show_widget_entity', $vars);
    }
1018386
public function render(array $options = []): string
    {
        $html = $this->format['menuStart'];
        $html .= !empty($options['title']) ? $options['title'] : '';

        /**
         * @var MenuItemInterface $menuItem
         */
        foreach ($this->menu->getMenuItems() as $menuItem) {
            if ($menuItem->isEnabled()) {
                $html .= $this->renderMenuItem($menuItem);
            }
        }
        $html .= $this->format['menuEnd'];

        return $html;
    }
135501
public function renderTwigBlock($resource, $blockName, array $options = [])
    {
        if (null !== $this->environment) {
            /* @var \Twig_Template $template */
            $template = $this->environment->loadTemplate($resource);

            return $template->renderBlock($blockName, $options);
        }

        return '';
    }
661284
public function renderInput(array $options = [])
    {
        $attrs = $this->prepareAttributes();

        if ($this->form && $this->form->getRenderer()) {
            return $this->form->getRenderer()->renderInput($this, $attrs, $options);
        }

        return $this->buildInput($attrs);
    }
539070
public function render($options = array())
    {
        $alert = $this->alertManager->getAlert();
        $options['alerts'] = $alert ? $alert->all() : array();

        return $this->alertHelper->render($options, $this->getTemplate($options));
    }
536764
public function getData(Options $options = null)
    {
        if ($options === null) {
            // Take store global/default options
            $options = $this->store->getOptions();
            // By default formatters are disabled in JSON format
            $options->getHydrationOptions()->disableFormatters();
        }

        // Get unformatted data when using json
        $options->getHydrationOptions()->disableFormatters();

        $data = $this->store->getData($options);
        $now = new DateTime();

        $d = [
            'success' => true,
            'timestamp' => $now->format(DateTime::W3C),
            'total' => $data->getTotalRows(),
            'request_id' => $this->request_id,
            'start' => $data->getSource()->getOptions()->getOffset(),
            'limit' => $data->getSource()->getOptions()->getLimit(),
            'data' => $data->toArray()
        ];

        if ($this->options['debug']) {
            $source = $data->getSource();
            if ($source instanceof QueryableSourceInterface) {
                $d['query'] = $source->getQueryString();
            }
        }

        return json_encode($d);
    }
601441
public function renderWidget( $config = [] ) {

		$this->links = array_flip( $this->links );

		$widgetHtml = $this->render( $this->template, [ 'widget' => $this ] );

		if( $this->wrap ) {

			return Html::tag( 'div', $widgetHtml, $this->options );
		}

		return $widgetHtml;
	}
2236
public static function get($options = array())
    {
        if (!isset(self::$_instances[md5(serialize($options))])) {
            return new HTML($options);
        }

        return self::$_instances[md5(serialize($options))];
    }
1279292
public function getTwig(array $options = array())
    {
        if (is_null($this->twig)) {
            $page = Page::html();
            foreach (array('content', 'plugins', 'themes') as $dir) {
                if (!is_dir($this->blog->folder.$dir)) {
                    mkdir($this->blog->folder.$dir, 0755, true);
                }
            }
            $loader = new \Twig_Loader_Filesystem($page->dir['page'], $page->dir['page']);
            $loader->addPath($this->blog->folder.'plugins/', 'plugin');
            $this->twig = new \Twig_Environment($loader, array_merge(array(
                'cache' => $this->blog->folder.'cache/twig/',
                'auto_reload' => true,
                'autoescape' => false,
            ), $options));
            $this->twig->addExtension(new MarkdownExtension(new Markdown($this)));
            $this->twig->addFilter(new \Twig_SimpleFilter('asset', array($this, 'asset')));
            $this->twig->addFunction(new \Twig_SimpleFunction('dir', array($this, 'dir')));
            $this->twig->addFunction(new \Twig_SimpleFunction('this', array($this, 'this')));
            $this->twig->addFunction(new \Twig_SimpleFunction('dump', array($this, 'dump'), array('is_safe' => 'html')));
            $this->twig->registerUndefinedFunctionCallback(function ($name) {
                switch ($name) {
                    // Array Functions
                    case 'array_change_key_case': // Changes the case of all keys in an array
                    case 'array_chunk': // Split an array into chunks
                    case 'array_column': // Return the values from a single column in the input array
                    case 'array_combine': // Creates an array by using one array for keys and another for its values
                    case 'array_count_values': // Counts all the values of an array
                    case 'array_diff_assoc': // Computes the difference of arrays with additional index check
                    case 'array_diff_key': // Computes the difference of arrays using keys for comparison
                    case 'array_diff': // Computes the difference of arrays
                    case 'array_fill_keys': // Fill an array with values, specifying keys
                    case 'array_fill': // Fill an array with values
                    case 'array_filter': // Filters elements of an array using a callback function
                    case 'array_flip': // Exchanges all keys with their associated values in an array
                    case 'array_intersect_assoc': // Computes the intersection of arrays with additional index check
                    case 'array_intersect_key': // Computes the intersection of arrays using keys for comparison
                    case 'array_intersect': // Computes the intersection of arrays
                    case 'array_key_exists': // Checks if the given key or index exists in the array
                    case 'array_keys': // Return all the keys or a subset of the keys of an array
                    case 'array_map': // Applies the callback to the elements of the given arrays
                    case 'array_merge_recursive': // Merge two or more arrays recursively
                    case 'array_merge': // Merge one or more arrays
                    case 'array_pad': // Pad array to the specified length with a value
                    case 'array_product': // Calculate the product of values in an array
                    case 'array_rand': // Pick one or more random entries out of an array
                    case 'array_replace_recursive': // Replaces elements from passed arrays into the first array recursively
                    case 'array_replace': // Replaces elements from passed arrays into the first array
                    case 'array_reverse': // Return an array with elements in reverse order
                    case 'array_search': // Searches the array for a given value and returns the first corresponding key if successful
                    case 'array_slice': // Extract a slice of the array
                    case 'array_sum': // Calculate the sum of values in an array
                    case 'array_unique': // Removes duplicate values from an array
                    case 'array_values': // Return all the values of an array
                    case 'count': // Count all elements in an array, or something in an object
                    case 'in_array': // Checks if a value exists in an array

                    // Date/Time Functions
                    case 'date_parse': // Returns associative array with detailed info about given date
                    case 'date_sun_info': // Returns an array with information about sunset/sunrise and twilight begin/end
                    case 'getdate': // Get date/time information
                    case 'gettimeofday': // Get current time
                    case 'gmdate': // Format a GMT/UTC date/time
                    case 'gmmktime': // Get Unix timestamp for a GMT date
                    case 'microtime': // Return current Unix timestamp with microseconds
                    case 'mktime': // Get Unix timestamp for a date
                    case 'strtotime': // Parse about any English textual datetime description into a Unix timestamp
                    case 'time': // Return current Unix timestamp

                    // JSON Functions
                    case 'json_decode': // Decodes a JSON string
                    case 'json_encode': // Returns the JSON representation of a value

                    // Mail Functions
                    case 'mail': // Send mail

                    // Math Functions
                    case 'abs': // Absolute value
                    case 'acos': // Arc cosine
                    case 'acosh': // Inverse hyperbolic cosine
                    case 'asin': // Arc sine
                    case 'asinh': // Inverse hyperbolic sine
                    case 'atan2': // Arc tangent of two variables
                    case 'atan': // Arc tangent
                    case 'atanh': // Inverse hyperbolic tangent
                    case 'base_convert': // Convert a number between arbitrary bases
                    case 'bindec': // Binary to decimal
                    case 'ceil': // Round fractions up
                    case 'cos': // Cosine
                    case 'cosh': // Hyperbolic cosine
                    case 'decbin': // Decimal to binary
                    case 'dechex': // Decimal to hexadecimal
                    case 'decoct': // Decimal to octal
                    case 'deg2rad': // Converts the number in degrees to the radian equivalent
                    case 'exp': // Calculates the exponent of e
                    case 'expm1': // Returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero
                    case 'floor': // Round fractions down
                    case 'fmod': // Returns the floating point remainder (modulo) of the division of the arguments
                    case 'getrandmax': // Show largest possible random value
                    case 'hexdec': // Hexadecimal to decimal
                    case 'hypot': // Calculate the length of the hypotenuse of a right-angle triangle
                    case 'is_finite': // Finds whether a value is a legal finite number
                    case 'is_infinite': // Finds whether a value is infinite
                    case 'is_nan': // Finds whether a value is not a number
                    case 'lcg_value': // Combined linear congruential generator
                    case 'log10': // Base-10 logarithm
                    case 'log1p': // Returns log(1 + number), computed in a way that is accurate even when the value of number is close to zero
                    case 'log': // Natural logarithm
                    case 'mt_getrandmax': // Show largest possible random value
                    case 'mt_rand': // Generate a better random value
                    case 'mt_srand': // Seed the better random number generator
                    case 'octdec': // Octal to decimal
                    case 'pi': // Get value of pi
                    case 'pow': // Exponential expression
                    case 'rad2deg': // Converts the radian number to the equivalent number in degrees
                    case 'rand': // Generate a random integer
                    case 'round': // Rounds a float
                    case 'sin': // Sine
                    case 'sinh': // Hyperbolic sine
                    case 'sqrt': // Square root
                    case 'srand': // Seed the random number generator
                    case 'tan': // Tangent
                    case 'tanh': // Hyperbolic tangent

                    // Misc Functions
                    case 'pack': //  Pack data into binary string
                    case 'unpack': // Unpack data from binary string

                    // Multibyte String Functions
                    case 'mb_convert_case': // Perform case folding on a string
                    case 'mb_convert_encoding': // Convert character encoding
                    case 'mb_strimwidth': // Get truncated string with specified width
                    case 'mb_stripos': // Finds position of first occurrence of a string within another, case insensitive
                    case 'mb_stristr': // Finds first occurrence of a string within another, case insensitive
                    case 'mb_strlen': // Get string length
                    case 'mb_strpos': // Find position of first occurrence of string in a string
                    case 'mb_strrchr': // Finds the last occurrence of a character in a string within another
                    case 'mb_strrichr': // Finds the last occurrence of a character in a string within another, case insensitive
                    case 'mb_strripos': // Finds position of last occurrence of a string within another, case insensitive
                    case 'mb_strrpos': // Find position of last occurrence of a string in a string
                    case 'mb_strstr': // Finds first occurrence of a string within another
                    case 'mb_strtolower': // Make a string lowercase
                    case 'mb_strtoupper': // Make a string uppercase
                    case 'mb_strwidth': // Return width of string
                    case 'mb_substr_count': // Count the number of substring occurrences
                    case 'mb_substr': // Get part of string

                    // String Functions
                    case 'addcslashes': // Quote string with slashes in a C style
                    case 'addslashes': // Quote string with slashes
                    case 'bin2hex': // Convert binary data into hexadecimal representation
                    case 'chr': // Return a specific character - complements ord()
                    case 'chunk_split': // Split a string into smaller chunks
                    case 'explode': // Split a string by string
                    case 'hex2bin': // Decodes a hexadecimally encoded binary string
                    case 'htmlspecialchars': // Convert special characters to HTML entities
                    case 'implode': // Join array elements with a string
                    case 'lcfirst': // Make a string's first character lowercase
                    case 'ltrim': // Strip whitespace (or other characters) from the beginning of a string
                    case 'nl2br': // Inserts HTML line breaks before all newlines in a string
                    case 'number_format': // Format a number with grouped thousands
                    case 'ord': // Return ASCII value of character - complements chr()
                    case 'rtrim': // Strip whitespace (or other characters) from the end of a string
                    case 'str_ireplace': // Case-insensitive version of str_replace()
                    case 'str_pad': // Pad a string to a certain length with another string
                    case 'str_repeat': // Repeat a string
                    case 'str_replace': // Replace all occurrences of the search string with the replacement string
                    case 'str_rot13': // Perform the rot13 transform on a string
                    case 'str_shuffle': // Randomly shuffles a string
                    case 'str_split': // Convert a string to an array
                    case 'str_word_count': // Return information about words used in a string
                    case 'strip_tags': // Strip HTML and PHP tags from a string
                    case 'stripos': // Find the position of the first occurrence of a case-insensitive substring in a string
                    case 'stristr': // Case-insensitive strstr()
                    case 'strlen': // Get string length
                    case 'strpos': // Find the position of the first occurrence of a substring in a string
                    case 'strrchr': // Find the last occurrence of a character in a string
                    case 'strrev': // Reverse a string
                    case 'strripos': // Find the position of the last occurrence of a case-insensitive substring in a string
                    case 'strrpos': // Find the position of the last occurrence of a substring in a string
                    case 'strstr': // Find the first occurrence of a string
                    case 'strtok': // Tokenize string
                    case 'strtolower': // Make a string lowercase
                    case 'strtoupper': // Make a string uppercase
                    case 'strtr': // Translate characters or replace substrings
                    case 'substr_count': // Count the number of substring occurrences
                    case 'substr': // Return part of a string
                    case 'trim': // Strip whitespace (or other characters) from the beginning and end of a string
                    case 'ucfirst': // Make a string's first character uppercase
                    case 'ucwords': // Uppercase the first character of each word in a string
                    case 'wordwrap': // Wraps a string to a given number of characters

                    // Variable handling Functions
                    case 'gettype': // Get the type of a variable
                    case 'is_array': // Finds whether a variable is an array
                    case 'is_bool': // Finds out whether a variable is a boolean
                    case 'is_float': // Finds whether the type of a variable is float
                    case 'is_int': // Find whether the type of a variable is integer
                    case 'is_null': // Finds whether a variable is NULL
                    case 'is_numeric': // Finds whether a variable is a number or a numeric string
                    case 'is_string': // Find whether the type of a variable is string
                    case 'serialize': // Generates a storable representation of a value
                    case 'unserialize': // Creates a PHP value from a stored representation
                        return new \Twig_SimpleFunction($name, $name);
                        break;

                    // Return by reference, so we return directly
                    case 'array_pop': // Pop the element off the end of array
                    case 'array_shift': // Shift an element off the beginning of array
                    case 'array_splice': // Remove a portion of the array and replace it with something else
                    case 'arsort': // Sort an array in reverse order and maintain index association
                    case 'asort': // Sort an array and maintain index association
                    case 'krsort': // Sort an array by key in reverse order
                    case 'ksort': // Sort an array by key
                    case 'natcasesort': // Sort an array using a case insensitive "natural order" algorithm
                    case 'natsort': // Sort an array using a "natural order" algorithm
                    case 'rsort': // Sort an array in reverse order
                    case 'shuffle': // Shuffle an array
                    case 'sort': // Sort an array
                    case 'settype': // Set the type of a variable
                        return new \Twig_SimpleFunction($name, function () use ($name) {
                            $args = func_get_args();
                            $reference = array_shift($args);
                            switch (count($args)) {
                                case 0: $name($reference); break;
                                case 1: $name($reference, array_shift($args)); break;
                                case 2: $name($reference, array_shift($args), array_shift($args)); break;
                                default: $name($reference, array_shift($args), array_shift($args), array_shift($args)); break;
                            }

                            return $reference;
                        });
                        break;

                    // PCRE Functions
                    case 'preg_filter': // Perform a regular expression search and replace - 4
                    case 'preg_grep': // Return array entries that match the pattern
                    case 'preg_match_all': // Perform a global regular expression match
                    case 'preg_match': // Perform a regular expression match
                    case 'preg_quote': // Quote regular expression characters
                    case 'preg_replace': // Perform a regular expression search and replace - 4
                    case 'preg_split': // Split string by a regular expression - 3
                        return new \Twig_SimpleFunction($name, function () use ($name) {
                            $args = func_get_args();
                            $pattern = array_shift($args);
                            if ($name != 'preg_quote') {
                                $this->removeEval($pattern);
                            }
                            if (strpos($name, 'match')) {
                                $name($pattern, array_shift($args), $matches);

                                return $matches;
                            } else {
                                array_unshift($args, $pattern);

                                return call_user_func_array($name, $args);
                            }
                        });
                        break;
                }

                return false;
            });
        }

        return $this->twig;
    }
417716
protected function getView($options = [ ])
    {
        $view = 'recaptcha::' . $this->service->getTemplate();

        $configTemplate = $this->config['template'];

        if (array_key_exists('template', $options)) {
            $view = $options['template'];
        } elseif ("" !== trim($configTemplate)) {
            $view = $configTemplate;
        }

        return $view;
    }