LaravelRUS /
SleepingOwlAdmin
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace SleepingOwl\Admin\Navigation; |
||||
| 4 | |||||
| 5 | class Badge extends \KodiComponents\Navigation\Badge |
||||
| 6 | { |
||||
| 7 | public $view = null; |
||||
| 8 | |||||
| 9 | /** |
||||
| 10 | * @return array |
||||
| 11 | */ |
||||
| 12 | public function toArray() |
||||
| 13 | { |
||||
| 14 | $value = $this->getValue(); |
||||
| 15 | |||||
| 16 | if (! $this->hasClassProperty('label-', 'bg-')) { |
||||
| 17 | $this->setHtmlAttribute('class', 'label-primary'); |
||||
| 18 | } |
||||
| 19 | |||||
| 20 | return [ |
||||
| 21 | 'value' => $value, |
||||
| 22 | 'attributes' => $this->htmlAttributesToString(), |
||||
| 23 | ]; |
||||
| 24 | } |
||||
| 25 | |||||
| 26 | /** |
||||
| 27 | * @return null|string |
||||
| 28 | */ |
||||
| 29 | public function getView() |
||||
| 30 | { |
||||
| 31 | if ($this->view) { |
||||
| 32 | return $this->view; |
||||
| 33 | } |
||||
| 34 | |||||
| 35 | return '_partials.navigation.badge'; |
||||
| 36 | } |
||||
| 37 | |||||
| 38 | /** |
||||
| 39 | * @param $view |
||||
| 40 | */ |
||||
| 41 | public function setView($view) |
||||
| 42 | { |
||||
| 43 | $this->view = $view; |
||||
| 44 | } |
||||
| 45 | |||||
| 46 | /** |
||||
| 47 | * @param null $view |
||||
|
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||||
| 48 | * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory |
||||
| 49 | */ |
||||
| 50 | public function render($view = null) |
||||
| 51 | { |
||||
| 52 | return app('sleeping_owl.template')->view($this->getView(), $this->toArray()); |
||||
|
0 ignored issues
–
show
The method
view() does not exist on Illuminate\Contracts\Foundation\Application.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 53 | } |
||||
| 54 | } |
||||
| 55 |