Se pasa info al mpdf

This commit is contained in:
Alejandro Tasistro 2021-11-27 11:23:12 -03:00
parent 68f8939215
commit e0c33f23e2
2 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,8 @@ class LibrilladoraController extends Controller
{ {
// //
public function process(Request $request) { public function process(Request $request) {
$nombre = $request->input("Archivo");
$lib = new Librilladora(); $lib = new Librilladora();
$lib->prueba(); $lib->prueba($nombre);
} }
} }

View File

@ -8,11 +8,11 @@ use Illuminate\Database\Eloquent\Model;
class Librilladora extends Model { class Librilladora extends Model {
use HasFactory; use HasFactory;
public function prueba() { public function prueba(string $nombre) {
$mpdf = new \Mpdf\Mpdf(); $mpdf = new \Mpdf\Mpdf();
// Write some HTML code: // Write some HTML code:
$mpdf->WriteHTML('Hello World'); $mpdf->WriteHTML($nombre);
// Output a PDF file directly to the browser // Output a PDF file directly to the browser
$mpdf->Output(); $mpdf->Output();