Returns the first node of the list as HTML.

@param mixed $default When provided and the current node is empty, this value is returned and no exception is thrown

@return string The node html

@throws \InvalidArgumentException When current node is empty
502330
public function html(/* $default = null */)
    {
        if (!$this->nodes) {
            if (0 < \func_num_args()) {
                return \func_get_arg(0);
            }

            throw new \InvalidArgumentException('The current node list is empty.');
        }

        if (null !== $this->html5Parser) {
            $html = '';
            foreach ($this->getNode(0)->childNodes as $child) {
                $html .= $this->html5Parser->saveHTML($child);
            }

            return $html;
        }

        $html = '';
        foreach ($this->getNode(0)->childNodes as $child) {
            $html .= $child->ownerDocument->saveHTML($child);
        }

        return $html;
    }
705842
public function getListLimit($default = 0)
    {

        $limit = $this->getState("limit", intval($default));

        //print_R( $this->config->get("content.lists.length"));

        $limit = empty($limit) ? $this->config->get("content.lists.length", 20) : $limit;

        return $limit;
    }
856092
public function html()
    {
        if (!$this->hasContent() && !$this->isEditable()) {
            return '';
        }

        $content = $this->hasContent() ? $this->show() : $this->showDefault();

        // If the return data is a View then assign any parameters to it.
        if ($content instanceof View && !empty($this->viewParams)) {
            $content->with($this->viewParams);
        }

        return (string) $content;
    }
1092498
protected function createDefaultDDL($default)
    {
        $dataType = $this->getDataType();

        if (is_array($default)) {
            foreach ($default as $k => $option) {
                $default[$k] = $this->getDataType()->quote($option);
            }
            $default = '(' . implode(',', $default) . ')';
        } elseif ($dataType instanceof TimeTypeInterface
            && $this->getDefault() == self::DEFAULT_CURRENT_TIMESTAMP
        ) {
            $precision = $dataType->hasPrecision() ? '(' . $dataType->getPrecision() . ')' : null;
            $default = self::DEFAULT_CURRENT_TIMESTAMP . $precision;
        } else {
            $default = $this->getDefault() === null ? 'NULL' : $this->getDataType()->quote($default);
        }

        return $default;
    }
1143959
public function getSafeArray(string $key, array & $data, string $default = null)
    {
        $value = $this->getFromArray($key, $data, $default);

        return \htmlspecialchars($value);
    }
1058813
public function first($default = NULL)
    {
        $first = $this->shift();
        if (! $first) {
            $first = $default;
        } else {
            $this->unshift($first);
        }
        return $first;
    }
18865
public function getRequestPage($default = 1)
    {
        if (empty($this->requestPage)) {
            $this->requestPage = abs($this->getRequestArg(
                $this->pageArgName,
                $default
            ));
        }

        return $this->requestPage;
    }
94315
public function get($path, $default=null)
  {
    $result = $default;

    if ( !strpos($path, '.') ){
      return (isset($this->data->$path) && $this->data->$path !== null && $this->data->$path !== '') ? $this->data->$path : $default;
    }

    $nodes = explode('.', $path);

    $node  = $this->data;
    $found = false;
    
    // Traverse the registry to find the correct node for the result
    foreach ($nodes as $n){
      if ( isset($node->$n) ){
        $node = $node->$n;
        $found = true;
      }
      else {
        $found = false;
        break;
      }
    }
    
    if ( $found && $node !== null && $node !== '' ){
      $result = $node;
    }
    
    return $result;
  }
168327
public function getInnerHtml()
    {
        $html = '';
        if ($content_node = $this->getFirstElmNode()) {
            $document = $content_node->ownerDocument;

            foreach ($content_node->childNodes as $node) {
                if ($this->xml_mode) {
                    $html .= $document->saveXML($node);
                } else {
                    $html .= $document->saveHTML($node);
                }
            }

            $html = $this->handleHtmlResult($html);
        }

        return $html;
    }
1231194
protected function createProviderNode($default = null)
    {
        $builder = new TreeBuilder();
        $node = $builder->root('provider', 'scalar');

        if ($default) {
            $node->defaultValue($default);
        }

        $node
            ->cannotBeEmpty()
            ->info('Name of model provider')
            ->end()
        ;

        return $node;
    }
418119
public function get($path, $default = null)
	{
		// Return default value if path is empty
		if (empty($path))
		{
			return $default;
		}

		if (strpos($path, $this->separator))
		{
			return parent::get($path, $default);
		}

		$nodes = get_object_vars($this->data);
		$found = false;

		// Traverse the registry to find the correct node for the result.
		foreach ($nodes as $n => $node)
		{
			if (is_array($node) && isset($node[$path]))
			{
				$value = $node[$path];
				$found = true;
				continue;
			}

			if (!isset($node->$path))
			{
				continue;
			}

			$value = $node->$path;
			$found = true;
		}

		if (!$found || $value === null || $value === '')
		{
			//return $default;
			return parent::get($path, $default);
		}

		return $value;
	}
1207082
public function first($default = []) {
        if (!$this->performed) {
            $this->select();
        }
        if (isset ($this->resultSets [0])) {
            return $this->resultSets[0];
        }

        return $default;
    }
375963
public function firstImageUrl($text, $default = null)
    {
        $url = $default;

        if (!empty($text)) {
            preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $text, $matches);
        }

        if (!empty($matches) && isset($matches[1])) {
            $url = $matches[1];
        }

        return $url;
    }
1258465
public function defaultRender($entity)
    {
        $html = '';

        /** @var  UmbrellaRoute $route */
        foreach ($this->routeCollection as $id => $route) {
            $url = $route->generateEntityUrl($this->router, $entity);

            switch($id) {
                case 'show':
                    $html .= '<a data-xhr-href="' . $url . '" title="See"><i class="fa fa-eye"></i></a>';
                    break;

                case 'edit':
                    $html .= '<a data-xhr-href="' . $url . '" title="Edit"><i class="fa fa-pencil"></i></a>';
                    break;

                case 'delete':
                    $html .= '<a data-xhr-href="' . $url . '" title="Delete" data-confirm="Confirmer la suppression ?"><i class="fa fa-times text-red"></i></a>';
                    break;

                default:
                    $html .= '<a data-xhr-href="' . $url . '">' . $url . '</a>';
            }
            $html .= '&nbsp;&nbsp;';
        }
        return $html;
    }
1162814
protected function attr($name, $default = null)
    {
        if (!array_key_exists($name, $this->paths)) {
            throw new \InvalidArgumentException(sprintf('unknown attribute requested "%s"', $name));
        }

        return \igorw\get_in($this->raw, $this->paths[$name], $default);
    }
1362668
public function load($default = null)
    {
        if (file_exists($this->xmlfile)) {

            if (!$this->cache->isNew($this->xmlfile)) {
                return $this->cache->get();
            }

            $data = $this->parse();
            $this->cache->write($data);

            return $data;
        }

        return $default;
    }
839857
final protected function getTag($id, $default = null)
    {
        if ($id instanceof TagInterface) {
            return $id;
        }

        if (is_numeric($id)) {
            return $this->tagManager->find($id);
        }

        if ($default instanceof TagInterface) {
            return $default;
        }

        return null;
    }