Answer the question
In order to leave comments, you need to log in
Yii2 class not found?
In general, the question is: what is the easiest way you know to pull out the entire table from the excel file and place it in an array in a Yii2 project.
I used to do a project on OOP MVC without frameworks - it was necessary to pull out data from excel and use it for analysis. There were no problems - I connected one of the ready-made solutions ( https://github.com/PHPOffice/PHPExcel) and everything is OK, without crap and dancing.
And so I sat down on Yii2. 3rd day trying to connect - to no avail. I pumped up a bunch of classes, compiled a bunch of projects - sometimes namespacs get out, sometimes the class does not find it. If anyone knows the correct solution - please share.
For now a question such - why does not find in model Excel?
Thanks
Answer the question
In order to leave comments, you need to log in
Goodnight.
If you have an Excel model in models, then why do you write in namespace moonland/phpexcel
?
Write app\models
I used a similar extension, but it was a PHPOffice / PhpExcel extension
Installed via composer and accessed the extension classes like this:
$objInputType = \PHPExcel_IOFactory::identify($fileInput);
$objReader = \PHPExcel_IOFactory::createReader($objInputType);
namespace for the model you need to write like app\models, and not like you came up with it
And so I sat down on Yii2. 3rd day trying to connect - to no avail. I pumped up a bunch of classes, compiled a bunch of projects - sometimes namespacs get out, sometimes the class does not find it. If anyone knows the right solution, please share.
Yii relies on the class autoloading mechanism to locate and include all required class files. It provides a high-performance class autoloader that is compliant with the PSR-4 standardget acquainted with the class autoloading standard and understand how namespaces work ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question