Format field as link.

@param string $field
183547
public function format_link($field)
    {
        $page = $this->columns[$field]['page'] ?: './'.$field;
        $attr = $this->columns[$field]['id_field'] ?: 'id';
        $this->current_row['_link'] =
            $this->app->url($page, array($attr => $this->columns[$field]['id_value']
                ? ($this->model[$this->columns[$field]['id_value']]
                    ?: $this->current_row[$this->columns[$field]['id_value'].'_original'])
                : $this->current_id, ));

        if (!$this->current_row[$field]) {
            $this->current_row[$field] = $this->columns[$field]['descr'];
        }

        return $this->format_template($field);
    }
992014
public function setField($field = null)
    {
        $this->field = null;

        if (!$field = $this->internalResolveField($field)) {
            $this->field = $this->fieldId = null;
        } else {
            $this->fieldId = $field->id;
            $this->field = $field;
        }

        return $this;
    }
417698
protected function parseFieldForSelect($field)
    {
        if ($function = $field->getDbFunction(DbFunctionUses::SELECT)) {
            return $this->parent->getConnection()->raw($function . ' AS ' . $field->getName(true, true));
        }

        $out = $field->name;
        if (!empty($field->alias)) {
            $out .= ' AS ' . $field->alias;
        }

        return $out;
    }
1081118
public function format_checkbox($field)
    {
        $this->current_row_html[$field] =
            '<input type="checkbox" '.
                'id="cb_'.$this->current_id.'" '.
                'name="cb_'.$this->current_id.'" '.
                'value="'.$this->current_id.'" '.
                ($this->current_row['selected'] == 'Y'
                    ? 'checked '
                    : ''
                ).
            '/>';
        $this->setTDParam($field, 'width', '10');
        $this->setTDParam($field, 'align', 'center');
    }
1193793
private function addColumn($field)
    {
        $syntax = sprintf("\$table->%s('%s')", $field['type'], $field['name']);

        // If there are arguments for the schema type, like decimal('amount', 5, 2)
        // then we have to remember to work those in.
        if ($field['arguments']) {
            $syntax = substr($syntax, 0, -1) . ', ';

            $syntax .= implode(', ', $field['arguments']) . ')';
        }

        foreach ($field['options'] as $method => $value) {
            $syntax .= sprintf("->%s(%s)", $method, $value === true ? '' : $value);
        }

        return $syntax .= ';';
    }
596877
public function format_template($field)
    {
        if (!($t = $this->columns[$field]['template'])) {
            throw new BaseException('use setTemplate() for field '.$field);
        }

        $this->current_row_html[$field] = $t
            ->trySet('id', $this->current_id)
            ->set($this->current_row)
            ->trySet('_value_', $this->current_row[$field])
            ->render();
    }
1285560
public function format_date($field)
    {
        if (!$this->current_row[$field]) {
            $this->current_row[$field] = '-';
        } else {
            if (is_object($this->current_row[$field])) {
                $this->current_row[$field] = $this->current_row[$field]->format(
                    $this->app->getConfig('locale/date', 'd/m/Y')
                );

            } else {
                $this->current_row[$field] = date(
                    $this->app->getConfig('locale/date', 'd/m/Y'),
                    strtotime($this->current_row[$field])
                );
            }
        }
    }
665896
protected function updateFormField($field)
    {
        parent::updateFormField($field);

        if ($this->MinValue) {
            $field->setAttribute('data-rule-min', $this->MinValue);
        }

        if ($this->MaxValue) {
            $field->setAttribute('data-rule-max', $this->MaxValue);
        }
    }
536148
public function mapFrom($field)
    {
        return isset($this->mapping[$field]) ? $this->mapping[$field] : $field;
    }
605387
public function url($field)
    {
        return (filter_var(trim($this->get($field)), FILTER_VALIDATE_URL) !== false) ?: $this->error($field,
            __FUNCTION__);
    }
272749
public function addField(&$field)
    {
        if (!isset($this->_fields[$field->name()])) {
            $this->_fields[$field->name()] =& $field;
        }
    }
293773
public function addFetchFields($field) {
    if (!is_array($field)) {
      if (!in_array($field, $this->fetches)) {
        $this->fetches[] = $field;
      }
    } else {
      $this->fetches = $field;
    }
  }
416857
public function offset_get_link($field)
    {
        $header_links = $this->links;

        if ($field === '$links') {
            $links = array();
            foreach ($header_links['*'] ?: $header_links as $key => $link) {
                if ($link['url']) {
                    $links[$key] = $this->link_url($key);
                }
            }
            return $links;
        }
        if (!array_key_exists($field, $this->link_data)) {
            if (parent::offsetExists($field)) {
                $value = parent::offsetGet($field);
                // Hack around link formulas
                // TODO: find a better way to differentiate from expanded links
                if ($header_links[$field]['url'] === '{'.$field.'}') {
                    unset($this[$field]);
                    return $this->offset_get_link($field);
                }
                if (is_array($value)) {
                    $this->link_data[$field] = Resource::instance(array(
                        '$url' => $this->link_url($field),
                        '$data' => $value,
                        '$links' => isset($header_links[$field]['links'])
                            ? $header_links[$field]['links'] : null
                    ));
                } else {
                    $this->link_data[$field] = $value;
                }
                return $this->link_data[$field];
            } else {
                // Avoid storing too much memory from links
                $mem_start = memory_get_usage();
                $link_url = $this->link_url($field);
                $link_data = array();
                if (isset(self::$client->default_limit)) {
                    $link_data['limit'] = self::$client->default_limit;
                }
                $result = $this->client()->get($link_url, $link_data);
                $mem_total = memory_get_usage() - $mem_start;
                // Max one megabyte
                if ($mem_total < 1048576) {
                    $this->link_data[$field] = $result;
                }
                return $result;
            }
        } else {
            return $this->link_data[$field];
        }

        return null;
    }
540035
private function getLinkset2Field($field)
	{					
        if (!isset($this->fields[$field['name']])) {
			$this->fields[$field['name']] =  new Iterator\Linkset2( $this, $field );
		}
        
		return $this->fields[$field['name']];   
    }
714998
public static function quoteField($field) {
        $trimmedField = trim($field);
        if ($trimmedField == '*') {
            return $trimmedField;
        }

        if (strpos($trimmedField, ' ') !== false) {
            return $trimmedField;
        }

        return strpos($trimmedField, '.') !== false ?
                $trimmedField : "`{$trimmedField}`";
    }
1111079
public function getValFormatted($field)
    {
        $val = $field->valRaw();
        $val = \preg_replace('/[^\d.-]/', '', $val);
        $val = \strlen($val)
            ? \sprintf('%.2f', $val)
            : null;
        return $val === null
            ? null
            : '$'.\number_format($val, 2);
    }
236653
public function field($field) : FormFieldBindingDefiner
    {
        if ($field instanceof FieldBuilderBase) {
            $field = $field->build();
        }

        InvalidArgumentException::verifyInstanceOf(__METHOD__, 'field', $field, IField::class);

        return new FormFieldBindingDefiner($this->class, $field);
    }