-
-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.1] Варианты записи полей #391
Comments
Можно же добавить третий тип, и будет вместо двух - три типа. |
Поддерживаю @PSalador, вопрос только в потенциальной нагрузке дальнейшей поддержки.
аналогично с массивом:
|
Плагиатор!!))) |
@Aios Cам меня критиковал и предлагал это раз таки 20 😂 |
@tabuna "Не не хочу не буду бла бла бла" и все такое. а сейчас че?) |
@Aios На самом деле, просто хочется подсказок, потому что начал забывать параметры |
Итог: Например: Можно так же рассмотреть вариант, создания не Input::name('title');
Select::name('title');
TextArea::name('title'); |
Раз уж мы идёт по пути формирования классов над массивами, думаю имеет смысл тогда и изменить формирование записи таблицы, например: Сейчас: return [
'appointment_time' => [
'name' => 'Time',
'width' => '200px',
'action' => function ($appointment) {
return $appointment->appointment_time->toDateString();
},
],
'appointment_type' => [
'name' => 'Type',
'width' => '200px',
'action' => function ($appointment) {
$types = config('appointment.types');
$message = isset($types[$appointment->appointment_type]['text']) ? $types[$appointment->appointment_type]['text'] : '';
return $message;
},
],
'doctor_notes' => 'Notes',
]; Предложение: return [
TD::name('appointment_time')
->title('Time')
->width('200px')
->render(function ($appointment){
return $appointment->appointment_time->toDateString();
}),
TD::name('appointment_type')
->title('Type')
->width('200px')
->render(function ($appointment){
$types = config('appointment.types');
$message = isset($types[$appointment->appointment_type]['text']) ? $types[$appointment->appointment_type]['text'] : '';
return $message;
}),
TD::name('doctor_notes')
->title('Notes')
->width('200px'),
]; Выглядит конечно стрёмно.... Пожалуйста любые улучшения по этому поводу |
Единственное, что приходит на ум, убрать return [
TD::name('appointment_time','Time')
->width('200px')
->render(function ($appointment){
return $appointment->appointment_time->toDateString();
}),
TD::name('appointment_type','Type')
->width('200px')
->render(function ($appointment){
$types = config('appointment.types');
$message = isset($types[$appointment->appointment_type]['text']) ? $types[$appointment->appointment_type]['text'] : '';
return $message;
}),
TD::name('doctor_notes','Notes')
->width('200px'),
]; |
Да норм смотрится. |
Да норм смотрится 💯 |
- Record fields as objects #391 ### Deprecated - Record string/array for fields. Use `Field::make`
Новый вид всех полей: Всякие Field::tag('input')
->type('text')
->name('place')
->max(255)
->required()
->title('Name Articles')
->help('Article title'),
Field::tag('wysiwyg')
->name('body')
->required()
->title('Name Articles')
->help('Article title'),
Field::tag('markdown')
->name('body2')
->required()
->title('Name Articles')
->help('Article title'),
Field::tag('picture')
->name('picture')
->width(500)
->height(300),
Field::tag('datetime')
->type('text')
->name('open')
->title('Opening date')
->help('The opening event will take place'),
Field::tag('checkbox')
->name('free')
->default(1)
->title('Free')
->placeholder('Event for free')
->help('Event for free'),
Field::tag('code')
->name('block')
->title('Code Block')
->help('Simple web editor'),
Field::tag('input')
->type('text')
->name('title')
->max(255)
->required()
->title('Article Title')
->help('SEO title'),
Field::tag('textarea')
->name('description')
->max(255)
->row(5)
->required()
->title('Short description'),
Field::tag('tags')
->name('keywords')
->title('Keywords')
->help('SEO keywords'),
Field::tag('robot')
->name('robot')
->title('Indexing')
->help('Allow search bots to index page'),
Field::tag('list')
->name('list')
->title('Dynamic list')
->help('Dynamic list'),
Field::tag('input')
->type('text')
->name('phone')
->mask('(999) 999-9999')
->title('Phone')
->help('Number Phone'),
Field::tag('place')
->name('place')
->title('Place')
->help('place for google maps'), |
Хочу так: /**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function display()
{
return InputField::name('search')
->type("text")
->max(255)
->required()
->value($this->request->get('search', ''));
} И чтобы автокомплит работал: /**
* Class InputField
*
* @method static InputField name(string $name)
* @method static InputField type(string $type)
* @method static InputField max(integer $value)
* @method static InputField required()
* @method static InputField value(string $value)
*/
class InputField extends Field |
- "DIV" Layouts - "Select" field - "Show" key for admin menu ### Changed - Record fields as objects #391 - Demo "behaviors" are no longer published - Access validation does not create multiple database queries ### Deprecated - Record string/array for fields. Use `Field::make` ### Removed - google analytics - robot field
- "DIV" Layouts - Select field - "Show" key for admin menu ### Changed - Record fields as objects orchidsoftware#391 ### Deprecated - Record string/array for fields. Use `Field::make` ### Removed - google analytics - robot field
- "DIV" Layouts - "Select" field - "Show" key for admin menu ### Changed - Record fields as objects orchidsoftware#391 - Demo "behaviors" are no longer published - Access validation does not create multiple database queries ### Deprecated - Record string/array for fields. Use `Field::make` ### Removed - google analytics - robot field
@Rendol Ты вроде какой то плагин делал для шторма? Сможешь генерировать подсказки из комментария выше?? |
- Grouping items using Field::group - TD::link and TD::linkPost - Sorting capability for TD [437](#437) - Property display for page - Added ability to change the logo [354](#354) - New command `orchid:install` ### Deprecated - TD::name and TD::title use TD::set ### Changed - Test migration pgsql to sqlite ### Fixed - Require to required - Hide the menu without children - Deletes a file only if there are no more links [570](#570) - Users and roles use screens [579](#579) ### Removed - Font Awesome - Bootstrap 3 appendix - "Delete" button by default in the image field - String record of parameters for building a form [391](#391)
Сейчас существует два вида записи полей, которые имеют свои плюсы и минусы:
В строчном виде
Плюсы:
Минусы:
В массиве
Плюсы:
Минусы:
Предложение:
Разрешить передавать классы
Плюсы:
Минусы:
Что предпочтительнее:
The text was updated successfully, but these errors were encountered: