Skip to content

Commit

Permalink
laravel container bind
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed Sep 15, 2016
1 parent 99c6035 commit 9104409
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
11 changes: 10 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ Crabbly\FPDF\FpdfServiceProvider::class
This will bootstrap the package into Laravel.


## Documentation
## Usage

You can resolve the FPDF class instance out of the container:

```
$pdf = $this->app('FPDF');
```

## FPDF Documentation

For documentation manual and tutorials, please visit [www.fpdf.org](http://www.fpdf.org/)

Expand Down
6 changes: 4 additions & 2 deletions src/FpdfServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Crabbly\FPDF;
namespace Crabbly;

use Illuminate\Support\ServiceProvider;

Expand All @@ -23,6 +23,8 @@ public function boot()
*/
public function register()
{

$this->app->bind('FPDF', function () {
return new FPDF;
});
}
}
8 changes: 4 additions & 4 deletions src/fpdf.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Crabbly\FPDF;
namespace Crabbly;

/*******************************************************************************
* FPDF *
Expand All @@ -10,10 +10,10 @@
* Author: Olivier PLATHEY *
*******************************************************************************/

const FPDF_VERSION = '1.81';

class FPDF
{
const FPDF_VERSION = '1.81';

protected $page; // current page number
protected $n; // current object number
protected $offsets; // array of object offsets
Expand Down Expand Up @@ -1824,7 +1824,7 @@ protected function _putresources()

protected function _putinfo()
{
$this->metadata['Producer'] = 'FPDF '.FPDF_VERSION;
$this->metadata['Producer'] = 'FPDF '.self::FPDF_VERSION;
$this->metadata['CreationDate'] = 'D:'.@date('YmdHis');
foreach($this->metadata as $key=>$value)
$this->_put('/'.$key.' '.$this->_textstring($value));
Expand Down

0 comments on commit 9104409

Please sign in to comment.