Renders a display value to print to the export.

@param Model $model
@param mixed $source     source column, method name or value
@return string
179756
public function render(Model $model, $source)
    {
        $value = $this->resolveModelSource($model, $source);

        if (null === $value) {
            return null;
        }

        if ($value) {
            return cms_trans('common.boolean.true');
        }

        return cms_trans('common.boolean.false');
    }
153390
public final function render(OutputBuffer $out, ViewModelInterface $model, array $params = [])
	{
		$this->context->bind($model);
		$this->context->set('@view', $this);
		
		foreach($params as $k => $v)
		{
			$this->context->set($k, $v);
		}
		
		try
		{
			if($this->getParent() === NULL)
			{
				$this->renderMain($out);
			}
			else
			{
				$this->parent->renderMain($out);
			}

			return $out;
		}
		finally
		{
			$this->parent = false;
			$this->context->unbind();
		}
	}
543846
protected function getFormattedValue(Model $model, string $key, $value)
    {
        // Apply defined get mutator
        if ($model->hasGetMutator($key)) {
            return $model->mutateAttribute($key, $value);
        }

        // Cast to native PHP type
        if ($model->hasCast($key)) {
            return $model->castAttribute($key, $value);
        }

        // Honour DateTime attribute
        if ($value !== null && in_array($key, $model->getDates(), true)) {
            return $model->asDateTime($value);
        }

        return $value;
    }
551460
public function render(ViewModelInterface $model)
    {
        foreach ($model as $child) {
            $groupId = $child->getGroupId();
            if (empty($groupId)) {
                continue;
            }
            $result    = $this->render($child);
            $oldResult = $model->getVariable($groupId, '');
            $model->setVariable($groupId, $oldResult . $result);
        }

        $events = $this->getEvents();
        $event  = new ViewEvent($model);
        $events->trigger($event);

        return $event->getResult();
    }
568113
public function renderNodeControll($model)
    {
        if ($this->_getMode() == SelectTree::MOD_MULTI) {
            $controllElement = Html::checkbox('tree_id', false, [
                'value' => $model->id,
                'class' => 'sx-checkbox',
                'style' => 'float: left; margin-left: 5px; margin-right: 5px;',
                'onclick' => new JsExpression(<<<JS
    sx.Tree.select("{$model->id}");
JS
                )
            ]);


        } else {
            if ($this->_getMode() == SelectTree::MOD_SINGLE) {

                $controllElement = Html::radio('tree_id', false, [
                    'value' => $model->id,
                    'class' => 'sx-readio',
                    'style' => 'float: left; margin-left: 5px; margin-right: 5px;',
                    'onclick' => new JsExpression(<<<JS
    sx.Tree.selectSingle("{$model->id}");
JS
                    )
                ]);

            } else {
                if ($this->_getMode() == SelectTree::MOD_COMBO) {

                    $controllElement = Html::radio('tree_id', false, [
                        'value' => $model->id,
                        'class' => 'sx-readio',
                        'style' => 'float: left; margin-left: 5px; margin-right: 5px;',
                        'onclick' => new JsExpression(<<<JS
                    sx.Tree.selectSingle("{$model->id}");
JS
                        )
                    ]);

                    $controllElement .= Html::checkbox('tree_id', false, [
                        'value' => $model->id,
                        'class' => 'sx-checkbox',
                        'style' => 'float: left; margin-left: 5px; margin-right: 5px;',
                        'onclick' => new JsExpression(<<<JS
    sx.Tree.select("{$model->id}");
JS
                        )
                    ]);

                } else {
                    $controllElement = '';
                }
            }
        }

        return $controllElement;
    }
641882
public function render($name, $source = null, $variable = null, $newLine = true)
    {
        $formatter = $this->getFormatter();
        $source = $source ?: 'src';
        $variable = $variable ?: 'script';

        return $formatter->renderClosure($formatter->renderLines([
            $formatter->renderAssignment(
                'var '.$variable,
                $formatter->renderCall(
                    $formatter->renderProperty('document', 'createElement'),
                    [$formatter->renderEscape('script')]
                ),
                true
            ),
            $formatter->renderAssignment(
                $formatter->renderProperty($variable, 'type'),
                $formatter->renderEscape('text/javascript'),
                true
            ),
            $formatter->renderAssignment(
                $formatter->renderProperty($variable, 'async'),
                $formatter->renderEscape(true),
                true
            ),
            $formatter->renderAssignment(
                $formatter->renderProperty($variable, 'src'),
                $source,
                true
            ),
            $formatter->renderCall(
                $formatter->renderProperty(
                    $formatter->renderCall(
                        $formatter->renderProperty('document', 'getElementsByTagName'),
                        [$formatter->renderEscape('head')]
                    ).'[0]',
                    'appendChild'
                ),
                [$variable],
                true
            ),
        ], true, false), [$source], $name, true, $newLine);
    }
169994
public function render(ModelConfigurationInterface $model, $content, $title = null)
    {
        if ($content instanceof RedirectResponse) {
            return $content;
        }

        if ($content instanceof Renderable) {
            $content = $content->render();
        }

        if (is_null($title)) {
            $title = $model->getTitle();
        }

        return $this->admin->template()->view('_layout.inner')
            ->with('title', $title)
            ->with('content', $content)
            ->with('breadcrumbKey', $this->parentBreadcrumb);
    }
1159081
public function process(Model $model)
    {
        $data = 'NULL';
        return $this->pool->render->renderSingleChild(
            $model->setData($data)->setNormal($data)->setType(static::TYPE_NULL)
        );
    }
244141
public static function modelName($project, $location, $model)
    {
        return self::getModelNameTemplate()->render([
            'project' => $project,
            'location' => $location,
            'model' => $model,
        ]);
    }
582193
public function process(Model $model)
    {
        return $this->pool->render->renderSingleChild(
            $model->setNormal($model->getData())->setType(static::TYPE_INTEGER)
        );
    }
639890
public function render()
	{
		if ($this->getDisplayField() === null) {
			throw new \InvalidArgumentException(sprintf('Please provide a display field for the `%s` relation via the display(); method.', $this->getName()));
		}

		switch ($this->getContext()) {
			case BaseField::CONTEXT_LIST:
				$value = $this->getValue();
				return $value->{$this->getDisplayField()};
				break;

			case BaseField::CONTEXT_FILTER:
                $baseModel  = $this->getAdmin()->getModel();
                $baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

                $relatedModel = $baseModel->{$this->getName()}()->getRelated();

                $items = [];
                foreach ($relatedModel::all() as $item) {
                    $items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
                }

                $column = Str::singular($relatedModel->getTable()) . '_id';
                if (Input::has($column)) {
                    $this->setValue(Input::get($column));
                }

				return View::make('krafthaus/bauhaus::models.fields._belongs_to')
					->with('field', $this)
					->with('items', $items);
				break;

			case BaseField::CONTEXT_FORM:
				$baseModel  = $this->getAdmin()->getModel();
				$baseModel  = new $baseModel;
				$primaryKey = $baseModel->getKeyName();

				$relatedModel = $baseModel->{$this->getName()}()->getRelated();

				$items = [];
				foreach ($relatedModel::all() as $item) {
					$items[$item->{$primaryKey}] = $item->{$this->getDisplayField()};
				}

				if ($this->getValue() !== null) {
					$this->setValue($this->getValue()->{$primaryKey});
				}

				return View::make('krafthaus/bauhaus::models.fields._belongs_to')
					->with('field', $this)
					->with('items', $items);

				break;
		}

		return $this->getValue();
	}
1323081
public function outputIconTitle($model, $title = null) {
        if ($model instanceof Model) {
            $model = $model->admin;
        }

        if (!$title && isset($model['title'])) {
            $title = $model['title'];
        }

        if ($model['iconClass']) {
            $title = $this->Html->tag('span', '&nbsp;', array(
                'class' => 'model-icon fa ' . str_replace('icon-', 'fa-', $model['iconClass']) // FontAwesome 4.0 fix
            )) . ' ' . $title;
        }

        return $title;
    }
477892
public function retrieve(Model $model, $source)
    {
        if ($this->isTranslated()) {
            return $model->translations->mapWithKeys(function (Model $model) {
                /** @var Taggable $model */
                return [ $model->{config('translatable.locale_key', 'locale')} => $model->tagNames() ];
            });
        }

        return $model->tagNames();
    }
269819
public function setModel($model, $display_field = null)
    {
        if ($model instanceof Model) {
            return AbstractObject::setModel($model);
        }

        $this->model_name = is_string($model) ? $model : get_class($model);
        $this->model_name = (string) $this->app->normalizeClassName($this->model_name, 'Model');

        if ($display_field) {
            $this->display_field = (string) $display_field;
        }

        if ($display_field !== false) {
            $this->owner->addExpression($this->getDereferenced())
                ->set(array($this, 'calculateSubQuery'))
                ->caption((string) $this->caption());
        }

        $this->system(true);
        $this->editable(true);
        $this->visible(false);

        return $this;
    }
837302
public function display(string $fieldname, $value, string $model = null)
    {
        if (!is_object($value)) {
            $value = new Time($value);
        }
        $value->setTimezone('Europe/Berlin');

        return $value->nice();
    }
1292279
public function render(Model $model, $source)
    {
        $source = $this->resolveModelSource($model, $source);

        $date = $this->interpretAsDate($source);

        if ( ! $date) {
            return '';
        }

        return e($date->format($this->getFormat()));
    }
707916
public function generate($model)
    {
        $create_at = date("YmdHis");
        $filename = sprintf("Version%s%s", $create_at, ucfirst(Str::camel($model)));

        $generator = new Generator(
            $this->setting->getMigrationDirectory(),
            $filename
        );

        $options = $this->arg->options();

        if ($options->has('--create') && $options->has('--table')) {
            $this->throwFailsCommand('bad command', 'add help');
        }

        $type = "model/standard";

        if ($options->has('--table')) {
            if ($options->get('--table') === true) {
                $this->throwFailsCommand('bad command option [--table=table]', 'add help');
            }

            $table = $options->get('--table');

            $type = 'model/table';
        } elseif ($options->has('--create')) {
            if ($options->get('--create') === true) {
                $this->throwFailsCommand('bad command option [--create=table]', 'add help');
            }

            $table = $options->get('--create');

            $type = 'model/create';
        }

        $generator->write($type, [
            'table' => $table ?? 'table_name',
            'className' => $filename
        ]);
        
        // Print console information
        echo Color::green('The migration file has been successfully created')."\n";
    }