Download the PHP package kodebyraaet/prince without Composer
On this page you can find all versions of the php package kodebyraaet/prince. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kodebyraaet/prince
More information about kodebyraaet/prince
Files in kodebyraaet/prince
Package prince
Short Description Simple prince wrapper for Prince library
License
Informations about the package prince
Laravel PrinceXML Wrapper
Laravel PrinceXML Wrapper is a Laravel 4.2 package that wraps around the http://www.princexml.com/ PDF generator.
Installation
There's a requirement to have the "prince" executable installed.
Run the following command to add Kodebyraaet/Prince to download and install.
Add the following .env variable to your .env.*.php.
Add the following to your app.php file in the service provider and alias sections respectively. The alias/facade is optional. `
Usage
The Kodebyraaet\Prince\Prince class is bound in the Laravel IoC as a Kodebyraaet\Prince\PrinceInterface, so everywhere the IoC automatically resolves dependencies (ie. in controllers) this is the preferred way to use Prince. Optionally you can also use $app->make(...) or App::make(...); You can also use \Prince or Kodebyraaet\Prince\Facades\Prince directly anywhere.
Methods
All methods are chainable so you can dynamically add more and more markup as you go to a Prince document. For example:
The html method takes html as a string and appends it to the internally stored markup.
The view method takes a Laravel view that has not yet been rendered and renders is and appends it to the internally stored markup.
The download method returns a Response object that can be returned to the client for view in browser/download. For example, in a Controller you can return this for a direct view of a generated PDF.
The store method required a path and returns the same path if successful.