Skip to content

Commit

Permalink
Add framework attribute to the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
patressz committed Oct 23, 2023
1 parent ed44d9c commit 7f4b696
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Components/Form/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Patressz\LaravelBladeComponents\Components\Form;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

Expand All @@ -11,16 +10,16 @@ class Input extends Component
/**
* Create a new component instance.
*/
public function __construct()
public function __construct(public string $framework = null)
{
//
$this->framework = $framework ?? config('blade-components.css_framework', 'bootstrap');
}

/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
public function render(): View
{
return view('blade-components::components.form.input');
return view("blade-components::components.{$this->framework}.form.input");
}
}

0 comments on commit 7f4b696

Please sign in to comment.