本文整理汇总了PHP中DataEdit::source方法的典型用法代码示例。如果您正苦于以下问题:PHP DataEdit::source方法的具体用法?PHP DataEdit::source怎么用?PHP DataEdit::source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataEdit
的用法示例。
在下文中一共展示了DataEdit::source方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($entity)
{
$showPassword = true;
$pass = Request::input('password');
if (trim($pass)) {
$new_input = array('password' => Hash::make($pass));
Request::merge($new_input);
} else {
Request::merge(['password' => null]);
if (in_array(Request::method(), ['PATCH', 'POST', 'PUT'])) {
$showPassword = false;
}
}
parent::edit($entity);
$this->edit = \DataEdit::source(new Admin());
$this->edit->label('Edit Admin');
$this->edit->link("rapyd-demo/filter", "Articles", "TR")->back();
$this->edit->add('email', 'Email', 'text')->rule('required|min:5');
$this->edit->add('first_name', 'firstname', 'text');
$this->edit->add('last_name', 'lastname', 'text');
// hate to do this but the rapyd framework sucks something awful
if ($showPassword) {
$this->edit->add('password', 'password', 'password');
}
$this->edit->add('permissions', 'permissions', 'text')->rule('required');
return $this->returnEditView();
}
示例2: edit
public function edit()
{
if (Auth::user()->isAdmin() || Auth::user()->isSuperAdmin()) {
$form = \DataEdit::source(new Account());
$form->link("accounts", "Voltar", "TR")->back();
$form->set('company_id', Auth::user()->company_id);
$form->text('name', 'Nome')->rule('required|min:5');
$form->text('cpf_cnpj', 'CPF / CNPJ')->rule('required|min:14')->unique(null, null, 'company_id,' . Auth::user()->company_id);
$form->text('phone1', 'Telefone');
$form->text('phone2', 'Telefone');
$form->textarea('description', 'Observações');
if ($form->status == 'create') {
$form->label('Novo Cliente');
} else {
$form->label("Cliente");
}
$form->saved(function () use($form) {
return redirect('accounts')->with('message', 'Registro salvo com sucesso!');
});
if ($form->status == "show") {
$form->link("#", "Registro de Alterações", "TR", ['onClick' => "MyWindow=window.open('audit/" . $form->model->id . "','MyWindow','width=800,height=400'); return false;"]);
}
$form->build();
return $form->view('accounts::create', compact('form'));
} else {
return redirect()->back()->with('error', 'Você não tem permissão para acessar esse módulo!');
}
}
示例3: Crud
/**
* Show the form for creating a new user
*
* @return Response
*/
public function Crud()
{
//simple crud for Article entity
$form = DataEdit::source(new User());
$form->link("admin/usuario/", "Voltar para listagem", "TR")->back();
$form->text('nome', 'Nome', 'text')->rule('required');
$form->text('email', 'E-mail', 'text')->rule('required');
$form->text('cpf', 'CPF', 'text');
$form->text('telefone_residencial', 'Telefone Fixo', 'text');
$form->text('telefone_celular', 'Telefone Celular', 'text');
$form->text('telefone_comercial', 'Telefone Comercial', 'text');
$form->text('pais', 'País', 'text');
$form->text('estado', 'Estado', 'text');
$form->text('cidade', 'Cidade', 'text');
$form->radiogroup('publicado', 'Habilitado')->option(0, 'Não')->option(1, 'Sim');
$form->radiogroup('confirmed', 'Confirmado')->option(0, 'Não')->option(1, 'Sim');
$form->radiogroup('is_admin', 'Administrador')->option(0, 'Não')->option(1, 'Sim');
//$form->add('author.name','Author','autocomplete')->search(array('firstname','lastname'));
//$form->autocomplete('author.name','Author')->search(array('firstname','lastname'));
//->attributes(array('multiple'))
$form->saved(function () use($form) {
$form->message("ok record saved");
});
$form->build();
return $form->view('admin.user.crud', compact('form'));
}
示例4: edit
public function edit($entity)
{
parent::edit($entity);
// Simple code of filter and grid part.
// List of all fields here: http://laravelpanel.com/docs/master/crud-fields
// Pre-load the months to the select box
$months = [null];
for ($i = 1; $i < 13; $i++) {
array_push($months, $i);
}
// Pre-load the years to the select box
$years = [null];
for ($i = 2000; $i < 2101; $i++) {
array_push($years, $i);
}
$this->edit = \DataEdit::source(new \App\Symbols());
$this->edit->label('Edit Symbols');
$this->edit->add('exchange', 'Exchange', 'text');
$this->edit->add('symbol', 'Symbol *', 'text')->rule('required');
$this->edit->add('name', 'Name *', 'text')->rule('required');
$this->edit->add('expire_month', 'Expire Month', 'select')->options($months);
$this->edit->add('expire_year', 'Expire Year', 'select')->options($years);
$this->edit->add('type', 'Type, i.e. future *', 'text')->rule('required');
$this->edit->add('cat', 'Category *', 'text')->rule('required');
return $this->returnEditView();
}
示例5: Crud
/**
* Show the form for creating a new hotel
*
* @return Response
*/
public function Crud()
{
//simple crud for Article entity
$form = DataEdit::source(new Hotel());
$form->link("admin/hotel/", "Voltar para listagem", "TR")->back();
$form->text('nome_br', 'Nome PT', 'text')->rule('required');
$form->text('nome_en', 'Nome EN', 'text')->rule('required');
$form->select('estrelas', 'Tipo de Hotel (Estrelas)')->options(array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5));
$form->textarea('descricao_br', 'Descricao PT');
$form->textarea('descricao_en', 'Descricao EN');
$form->select('pais_id', 'Pais')->options(Pais::lists("name", "id"));
$form->radiogroup('publicado', 'Publicado')->option(0, 'Não')->option(1, 'Sim');
$form->add('imagem', 'Imagem Principal', 'image')->move('uploads/hoteis/')->fit(900, 500)->preview(260, 180);
//$form->image('imagens','Outra Imagem')->move('uploads/hoteis/')->fit(900, 500)->preview(260,180);
$form->text('valor_diaria', 'Valor da diária', 'text');
$form->text('deposito', 'Valor do depósito de segurança', 'text');
$form->submit('Salvar');
//$form->add('author.name','Author','autocomplete')->search(array('firstname','lastname'));
//$form->autocomplete('author.name','Author')->search(array('firstname','lastname'));
//->attributes(array('multiple'))
$form->build();
$form->passed(function () {
dd(Input::all());
});
return $form->view('admin.hotel.crud', compact('form'));
}
示例6: edit
public function edit()
{
if (Auth::user()->isAdmin() || Auth::user()->isSuperAdmin()) {
$form = \DataEdit::source(new Vehicle());
$form->link("vehicles", "Veículos", "TR")->back();
if ($form->status == 'create') {
$form->label('Novo Veículo');
} else {
$form->label("Veículo");
}
$options = Account::where('company_id', Auth::user()->company_id)->orderBy('name')->lists("name", "id")->all();
$form->add('Account.name', 'Cliente', 'autocomplete')->options($options)->rule('required');
$form->text('plate', 'Placa')->rule('required|min:8')->unique()->attributes(array("data-mask" => "AAA-0000"));
$form->text('brand', 'Marca');
$form->text('model', 'Modelo');
$form->text('year', 'Ano')->attributes(array("data-mask" => "0000"));
$form->text('color', 'Cor');
$form->checkbox('active', 'Ativo');
$form->saved(function () use($form) {
return redirect('vehicles')->with('message', 'Registro salvo com sucesso!');
});
if ($form->status == "show") {
$form->link("#", "Registro de Alterações", "TR", ['onClick' => "MyWindow=window.open('audit/" . $form->model->id . "','MyWindow','width=800,height=400'); return false;"]);
}
$form->build();
return $form->view('vehicles::create', compact('form'));
} else {
return redirect()->back()->with('error', 'Você não tem permissão para acessar esse módulo!');
}
}
示例7: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Users());
$this->edit->label('Editar redatores');
$this->edit->add('name', 'Nome', 'text');
return $this->returnEditView();
}
示例8: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Grupos());
$this->edit->label('Grupos');
$this->edit->add('nome', 'Nome', 'text');
return $this->returnEditView();
}
示例9: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\VidCategoria());
$this->edit->label('Edit Category');
$this->edit->add('name', 'Nome', 'text');
return $this->returnEditView();
}
示例10: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Area());
$this->edit->label('Area');
$this->edit->add('nombre', 'Nombre', 'text')->rule('required');
return $this->returnEditView();
}
示例11: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Voluntario());
$this->edit->label('Voluntário');
$this->edit->add('name', 'Name', 'text');
$this->edit->add('code', 'Code', 'text')->rule('required');
return $this->returnEditView();
}
示例12: edit
public function edit()
{
$edit = \DataEdit::source(new Product());
$edit->add('name', trans('main.name'), 'text')->rule('required|min:2|max:255');
$edit->add('description', trans('main.description'), 'textarea')->rule('required|max:255');
$edit->add('price', trans('main.price'), 'text')->rule('integer');
$edit->add('image', trans('main.image'), 'image')->move('images/products/')->preview(300, 300)->resize(300, 300);
return $edit->view('dashboard.edit', compact('edit'));
}
示例13: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\User());
$this->edit->label('Edit Category');
$this->edit->add('name', 'Name', 'text');
$this->edit->add('email', 'email', 'text')->rule('required');
$this->edit->add('phone', 'phone', 'text')->rule('required');
return $this->returnEditView();
}
示例14: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\OpinionFinderSentiments());
$this->edit->label('Edit OpinionFinder');
$this->edit->add('date', 'Date', 'text')->rule('required');
$this->edit->add('symbol_id', 'Symbol ID', 'text')->rule('required');
$this->edit->add('polarity', 'Polarity', 'text')->rule('required');
return $this->returnEditView();
}
示例15: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Slider());
$this->edit->label('Edit Slider');
$this->edit->add('active', 'Active', 'checkbox');
$this->edit->add('weight', 'Weight', 'text');
$this->edit->add('img_url', 'Image', 'file')->move('uploads/images/slider/');
return $this->returnEditView();
}