Skip to content

Commit

Permalink
refactor parser
Browse files Browse the repository at this point in the history
  • Loading branch information
reziamini committed Feb 13, 2021
1 parent 2ac1bb7 commit eb85d68
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Commands/Actions/StubParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ public function parseInputsInBlade()
$str .= '<div class="form-group">'.$this->makeTab(4);
$title = ucfirst($key);
$this->texts[$title] = $title;
$str .= '<label for="input'.$key.'" class="col-sm-2 control-label"> {{ __("'.$title.'") }}</label>'.$this->makeTab(4);
$str .= "<label for='input$key' class='col-sm-2 control-label'> {{ __('$title') }}</label>".$this->makeTab(4);
$str = $this->inputsHTML($type, $key, $str).$this->makeTab(4);
$str .= '@error("'.$key.'") <div class="invalid-feedback">{{ $message }}</div> @enderror'.$this->makeTab(3);
$str .= "@error('$key') <div class='invalid-feedback'>{{ ".'$message'." }}</div> @enderror".$this->makeTab(3);
$str .= '</div>'.$this->makeTab(3);
}

Expand All @@ -241,13 +241,13 @@ public function inputsHTML($type, $key, string $str)
{
$mode = config('easy_panel.lazy_mode') ? 'wire:model.lazy' : 'wire:model';
$array = [
'text' => '<input type="text" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
'email' => '<input type="email" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
'number' => '<input type="number" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
'file' => '<input type="file" wire:model="' . $key . '" class="form-control-file @error(\''.$key.'\')is-invalid @enderror" id="input' . $key . '">',
'textarea' => '<textarea '.$mode.'="' . $key . '" class="form-control @error(\''.$key.'\')is-invalid @enderror"></textarea>',
'password' => '<input type="password" '. $mode .'="' . $key . '" class="form-control @error(\''.$key.'\') is-invalid @enderror" id="input' . $key . '">',
'ckeditor' => '<div wire:ignore><textarea class="form-control ckeditor" id="editor'.$key.'" wire:model="'. $key .'"></textarea></div>'."<script>
'text' => "<input type='text' $mode='$key' class=\"form-control @error('$key') is-invalid @enderror\" id='input$key'>",
'email' => "<input type='email' $mode='$key' class=\"form-control @error('$key') is-invalid @enderror\" id='input$key'>",
'number' => "<input type='number' $mode='$key' class=\"form-control @error('$key') is-invalid @enderror\" id='input$key'>",
'file' => "<input type='file' wire:model='$key' class=\"form-control-file @error('$key') is-invalid @enderror\" id='input$key'>",
'textarea' => "<textarea $mode='$key' class=\"form-control @error('$key') is-invalid @enderror\"></textarea>",
'password' => "<input type='password' $mode='$key' class=\"form-control @error('$key') is-invalid @enderror\" id='input$key'>",
'ckeditor' => "<div wire:ignore><textarea class='form-control ckeditor' id='editor$key' wire:model='$key'></textarea></div><script>
ClassicEditor.create(document.querySelector('#editor$key'), {
@if(config('easy_panel.rtl_mode'))
language: 'fa'
Expand Down

0 comments on commit eb85d68

Please sign in to comment.