Skip to content

Instantly share code, notes, and snippets.

@endihunter
Created February 1, 2017 07:42
Show Gist options
  • Save endihunter/84c1686b1ff6e0531b9fc3a49d455da9 to your computer and use it in GitHub Desktop.
Save endihunter/84c1686b1ff6e0531b9fc3a49d455da9 to your computer and use it in GitHub Desktop.
<?php
...
public function form()
{
return $this
->scaffoldForm()
->update('fieldname', function ($e) {
return $e->setInput((new \Terranet\Administrator\Form\Type\Key('fieldname')));
});
}
<?php
...
public function form()
{
return $this
->scaffoldForm()
->update('fieldname', function ($e) {
return $e->getInput()->setAttributes(['readonly' => true]);
});
}
<?php
use Terranet\Administrator\Form\Type\Hidden;
...
public function form()
{
return $this
->scaffoldForm()
->update('fieldname', function ($e) {
return $e->setInput((new \Terranet\Administrator\Form\Type\Hidden('fieldname'))->setValue(112));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment