Skip to content
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

Widget View File not found #43

Closed
spawn81 opened this issue May 11, 2019 · 15 comments
Closed

Widget View File not found #43

spawn81 opened this issue May 11, 2019 · 15 comments

Comments

@spawn81
Copy link

spawn81 commented May 11, 2019

Hi,
I have the following error:
"View file "Widgets::webSPV.Widgets.CategoriaAllieviWidgetView" not found by 'webSPV\Widgets\CategoriaAllieviWidget '

I'm using laravel 5.8 and I followed the install instruction.
They I typed: php artisan make:widget CategoriaAllieviWidget
and I have in my app/Widgets folder CategoriaAllieviWidget.php and CategoriaAllieviWidgetView.blade.php

I called @widget('CategoriaAllieviWidget', ['a' => 'someVal', 'b' => 'foo']) in a view and that's where the error rises.
do you have any clues?
thanks and good job for the great package

@imanghafoori1
Copy link
Owner

imanghafoori1 commented May 11, 2019

Are all the other widgets ok in your project except this one ?!
Or you have this kind of error for any widget you create ?

I can not reproduce it.

@spawn81
Copy link
Author

spawn81 commented May 12, 2019

Hi, thank you for your reply.
It happens for all the widgets, but luckly I've just solved the issue moving the generated views in the view folder and explicitly binding them using $template, eg. public $template = 'widgets.AlunniChartWidgetView';
(I had also use $contextAs to get rid of the laravel section start error)

@spawn81 spawn81 closed this as completed May 12, 2019
@imanghafoori1
Copy link
Owner

It is kinda strange.
Please note the exact version of widgetize package and OS you are using.

composer show
will help you see the installed versions

@imanghafoori1 imanghafoori1 reopened this May 12, 2019
@spawn81
Copy link
Author

spawn81 commented May 12, 2019

widgetize: v1.9.2
windows: 10 home 64bit v1803

@imanghafoori1
Copy link
Owner

what if you completely remove public $template = 'widgets.AlunniChartWidgetView'; from your widget ?

and not setting it public $template = ''; if you have had done it.

@spawn81
Copy link
Author

spawn81 commented May 12, 2019

Well I followed the instructions (without setting the $template, $contextAs) and
I have the laravel error: can't find the view
The same error rises with $template not set and $template=''

@imanghafoori1
Copy link
Owner

and you are using laravel 5.8 right ?

i have to investigate the possible root cause of that.

@spawn81
Copy link
Author

spawn81 commented May 12, 2019

yes, laravel 5.8.16.
I think "an easy fix" could be:
once u run the make:widget , in your generated files u should create a folder in views (eg a widget folder) in which you save the view as u do, and in the widgetname.php u write the $template= "widgets/widgetview"

let me know as soon as u find a solution and thanx again for this useful package

@imanghafoori1
Copy link
Owner

but I ran the exact same command on my windows 10 machine and laravel 5.8.
and everything was ok.

I do not know how it is not working for you !

@spawn81
Copy link
Author

spawn81 commented May 12, 2019

I really don't know, i'm sry i can't help., but at least there is a fix.

@imanghafoori1
Copy link
Owner

@spawn81 Ahaaa I now get it

You may have renamed the app folder to webSPV.

So you do not have any app folder. right ?

@spawn81
Copy link
Author

spawn81 commented May 18, 2019 via email

@imanghafoori1
Copy link
Owner

Could you please try the latest v1.9.5 ?
and report me if you have any issues.

@imanghafoori1
Copy link
Owner

if you have done something like this in your composer file :

       "psr-4": {
           "webSPV\\": "app/"
       },

you are right, and this was a bug.
which is fixed.

thanks for reporting .

@spawn81
Copy link
Author

spawn81 commented May 25, 2019

Hi, sry for late reply.
I can confirm, with the last update everything works like a charme
Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants