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
Export from view file #26
Comments
Hey Did you pass the data variables as a key-value array as second parameter of the Example: Excel::loadView('viewFile', array('key' => 'value'))->export('xls'); |
No, but i still need to use echo in the view site. Like this: Excel::loadView('viewFile',array('key'=>'value','key'=>'value',...)) Let me know if i'm going in the right way, and how can i add more style Thank you very much for answer. On Wed, Feb 12, 2014 at 2:45 PM, Maatwebsite notifications@github.comwrote:
Henry Villeta G. |
Inside the view file you will have to echo these variables (using the key as varname). If you have used a blade file, you can use the blade syntax ( For border styling see: https://github.com/Maatwebsite/laravel4-PHPExcel#setting-and-styling-borders |
Ok, but i tried to do this way but it does not generate the excel On Wed, Feb 12, 2014 at 2:56 PM, Maatwebsite notifications@github.comwrote:
Henry Villeta G. |
It should if you have used the correct syntax. |
I did like this: @foreach ($medicion as $m) @Endforeach
The file is blade extension On Wed, Feb 12, 2014 at 3:01 PM, Maatwebsite notifications@github.comwrote:
Henry Villeta G. |
That should work, assuming your Excel export code looks like this: Excel::loadView('folder.file', array('medicion' => $medicion))->export('xls'); I tried your view file with this example and the User model. If it still doesn't work, which error has been thrown? |
Sorry, my bad. I was making a mistake, problem fix Than you very much for your help, nice wrapper and very useful. On Wed, Feb 12, 2014 at 3:05 PM, henry eduardo villeta guzman <
Henry Villeta G. |
No problem and thanks! :) |
Hi
I'm using your wrapper, i'm having problems exporting to xls from view file. I pass a data variable
as a parameter and then i make an echo y the view file, but it does nothing, if i don't use any php statement it does the export, i don't find other way to pass the data and render in the view.
If you have some example it would great.
The text was updated successfully, but these errors were encountered: