Show the field editor form that will appear in an iframe on
the frontend

@param  string                   $key A full Element key
@return Illuminate\Http\Response
549533
public function field($key)
    {
        return View::make('decoy::layouts.blank')
            ->nest('content', 'decoy::elements.field', [
                'element' => app('decoy.elements')
                    ->localize(Decoy::locale())
                    ->hydrate(true)
                    ->get($key),
            ]);
    }
1154305
protected function addGroup(string $key) : HtmlContainer
    {
        $group = (new HtmlContainer('<optgroup>'))
            ->addAttribute('label', $key);

        $this->allOptions['group-' . $key] = $group;

        return $group;
    }
490659
public function index($key = null)
    {
        if (!$key) {
            $key = 'App';
        }
        $this->Menu->active($this->prefixes[$key]);

        if (!$this->__prefixExists($key)) {
            throw new NotFoundException("The prefix-setting " . $key . " could not be found");
        }

        $prefix = Hash::get($this->prefixes, ucfirst($key));

        $settings = $this->Configurations->find('all')->where([
            'name LIKE' => $key . '%',
            'editable' => 1,
        ])->order(['weight', 'id']);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $settings = $this->Configurations->patchEntities($settings, $this->request->data);
            foreach ($settings as $setting) {
                $this->Flash->success('The settings has been saved.');
                if (!$this->Configurations->save($setting)) {
                    $this->Flash->error('The settings could not be saved. Please, try again.');
                }
            }
            Setting::clear(true);
            Setting::autoLoad();
            return $this->redirect([]);
        }

        $this->set(compact('prefix', 'settings'));
    }
610557
function &get($key) {
		if ($key=='_id')
			return $this->id;
		if (array_key_exists($key,$this->document))
			return $this->document[$key];
		user_error(sprintf(self::E_Field,$key),E_USER_ERROR);
	}
273221
public function getOrganisationField( $key )
	{
		if( !array_key_exists( $key, $this->types['org'] ) )
			throw new InvalidArgumentException( 'Organisation Key "'.$key.'" is invalid.' );
		return $this->types['org'][$key];
	}
1207761
static function internalKey( $key )
    {
        $ini = eZINI::instance();
        $debug = $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled';
        if ( $debug )
            $key = $key . '-debug';
        else
            $key = $key . '-clean';
        return $key;
    }
1160171
public function renderInput($view)
    {
        // First check if there isn't a model view.

        $viewName = 'ignicms::admin.formElements.'.$view;

        if ($this->model instanceof AdminModel && $identifier = $this->model->getIdentifier()) {
            // First check if there is a rewrite on specific field type
            $field = str_slug($this->field);
            if (\View::exists('resources.'.$identifier.'.formElements.'.$field)) {
                $viewName = 'resources.'.$identifier.'.formElements.'.$field;
            } elseif (\View::exists('resources.'.$identifier.'.formElements.'.$view)) {
                $viewName = 'resources.'.$identifier.'.formElements.'.$view;
            }
        }

        return view($viewName, [
            'record' => $this->model,
            'fieldName' => $this->field,
            'elementName' => $this->elementName,
            'options' => $this->options,
            'sourceModel' => $this->sourceModel,
        ]);
    }
360384
public function renderInput($element)
	{
		if ($element instanceof Fieldset ||
		    $element instanceof Option ||
			$element instanceof Optgroup ||
			$element instanceof Radio )
		{
			return $element->render($this);
		}

		$element->setAttribute(
			'class',
			trim($element->getAttribute('class') . ' form-control')
		);

		$name = $element->getName();
		$element->setAttribute('id', 'form_'.$name);

		$elementHtml = $element->render($this);

		$renderGroup = $element->getMeta('group', true);

		$content = '';

		if ($renderGroup)
		{
			$content = '<div class="form-group">';
		}

		if (trim($element->getLabel()) != '')
		{
			$content .= '<label for="'.$element->getAttribute('id').'">'.$element->getLabel().'</label>';
		}

		$content .= $elementHtml;

		if ($renderGroup)
		{
			$content .= '</div>';
		}

		return $content;
	}
225439
public function getEdit($id = '')
    {

        $form = FormBuilder::create(get_class($this->form));


        $form_content = view('form-builder::form.components.formgenerator.full', [
            'form' => $form
        ]);
        $content      = view('expendable::admin.form.state.form', [

        ]);

        $this->layoutManager->add([
            'form'    => $form_content,
            'content' => $content,
        ]);

        return $this->layoutManager->render();
    }
515805
public function getXmlResponse($key)
    {
        $xml =<<<EOF
<!--?xml version="1.0" encoding="ISO-8859-1"?-->
<getautomb_key>
    <ep_status>ok0</ep_status>
    <ep_message>generated document</ep_message>
    <ep_cin>%s</ep_cin>
    <ep_user>%s</ep_user>
    <ep_doc>%s</ep_doc>
    <ep_key>%s</ep_key>
</getautomb_key>
EOF;

        return trim(sprintf($xml, $this->cin, $this->user, $this->doc, $key));
    }
987637
public static function renderField($el, $key = null)
    {
        if (!$key) {
            $key = $el->inputName();
        }

        $id = str_replace('|', '-', $key);

        switch ($el->type) {
            case 'text':
                return Former::text($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'textarea':
                return Former::textarea($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'wysiwyg':
                return Former::wysiwyg($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'image':
                return Former::image($key, $el->label)
                    ->forElement($el)
                    ->id($id);

            case 'file':
                return Former::upload($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'boolean':
                return Former::checkbox($key, false)
                    ->checkboxes([
                        "<b>{$el->label}</b>" => [
                            'name' => $key,
                            'value' => 1,
                        ],
                    ])
                    ->blockHelp($el->help)
                    ->id($id)
                    ->push();

            case 'select':
                return Former::select($key, $el->label)
                    ->options($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'radios':
                return Former::radiolist($key, $el->label)
                    ->from($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'checkboxes':
                return Former::checklist($key, $el->label)
                    ->from($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'video-encoder':
                return Former::videoEncoder($key, $el->label)
                    ->blockHelp($el->help)
                    ->model($el)
                    ->preset($el->preset)
                    ->id($id);

            case 'model':
                return Former::belongsTo($key, $el->label)
                    ->parent($el->class)
                    ->blockHelp($el->help)
                    ->id($id);
        }
    }
280564
public function attribute(string $key)
    {
        if ($key !== 'value') {
            return parent::attribute($key);
        }

        return array_map(
            function (ElementInterface $element) {
                return $element->value();
            },
            $this->elements()
        );
    }
1108436
public function getAsHtml($key = null) {
		if ($key === null) {
			$data = $this->data;
		} else {
			if (is_object($this->data) && isset($this->data->{$key})) {
				$data = $this->data->{$key};
			} elseif (is_array($this->data) && isset($this->data[$key])) {
				$data = $this->data[$key];
			} else {
				$data = null;
			}
		}

		$html =<<<HTML
			<div class="debugger">
				<div class="debug">
					{$this->getHtml($data, $this->title)}
				</div>
			</div>
HTML;
		return $html;
	}
838527
function getStringField($key)
	{
		return isset($this->stringFields[$key])
			? $this->stringFields[$key]->getPlainString()
			: "";
	}
346939
public function renderBreadcrumbs($key)
    {
        if (config('sleeping_owl.breadcrumbs')) {
            $this->breadcrumbs()->setView(
                $this->getViewPath('_partials.breadcrumbs')
            );

            return $this->breadcrumbs()->renderIfExists($key);
        }
    }
763242
public function form_html($key, array $attrAdd = null)
    {
        $item = $this->getItem($key);
        $attr = $this->merge_attr($item[ 'attr' ], $attrAdd);
        if (isset($attr[ '_content' ])) {
            $content = $attr[ '_content' ];
            unset($attr[ '_content' ]);
        } else {
            $content = '';
        }

        return str_replace(
                [ ':css', ':attr', ':_content' ],
            [ $this->getAttributesCSS($attr),
                $this->getAttributesInput($attr), $content ],
            $item[ 'html' ]
            ) . "\r\n";
    }
331236
public function editAction( $id = null ) {
		$request = $this->getRequest();

		$pageId      = $request->get( 'pageId' );
		$formFieldId = $request->get( 'formFieldId' );
		$uniqId      = $request->get( 'uniqId' );
		$code        = $request->get( 'code', 'networking_init_cms.admin.page' );


		$layoutBlock = $this->admin->getObject( $id );

		/** @var $form \Symfony\Component\Form\Form */
		$form = $this->admin->getForm();
		$form->setData( $layoutBlock );

		$form->handleRequest( $request );
		$response = null;

		if ( $form->isSubmitted() ) {
			if ( $form->isValid() ) {
				$this->admin->update( $layoutBlock );
				$html   = $this->getLayoutBlockFormWidget( $pageId, $formFieldId, $uniqId, $code );
				$status = 200;

				return new Response( $html, $status );
			} else {
				$this->error = true;

				$response = new Response();
				$response->setStatusCode( 500 );
			}

		}

		$view = $form->createView();

		// set the theme for the current Admin Form
		$this->get( 'twig' )->getRuntime( FormRenderer::class )->setTheme( $view, $this->admin->getFormTheme() );

		return $this->renderWithExtraParams(
			'@NetworkingInitCms/PageAdmin/layout_block_edit.html.twig',
			[
				'action' => 'create',
				'form'   => $view,
				'object' => $layoutBlock,
			],
			$response
		);
	}