Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ngfw/Recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ngfw committed Aug 29, 2016
2 parents c2dd3dc + 1ca094e commit c022672
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Table of Contents
* [Auto Embed](#auto-embed)
* [Make Clickable Links](#make-clickable-links)
* [:wrench: Debug](#debug)
* [Get Referer Page](#referer)
* [Get Referer](#get-referer)
* [Compress Page](#compress-page)

---
###Quick Start
Expand Down Expand Up @@ -513,10 +514,40 @@ $string = "Test me";
```


###Referer
###Get Referer
Get the referer page (last page visited)
```php
$referrer = \ngfw\Recipe::getReferer();
echo $referer ;
// outputs an url (http://mywebsite.com/page1)
```

###Compress Page
The `compressPage()` method will register new function on PHP shutdown, remove white space from output and try to gZip it.
```php
<?php
require "vendor/autoload.php";
\ngfw\Recipe::compressPage();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

<title>HTML Page Title</title>

<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>
<body>
Hello Friend,
</body>
</html>
```

will output:
```html
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>HTML Page Title</title><meta name="description" content=""><meta name="viewport" content="width=device-width, initial-scale=1.0"></head><body> Hello Friend,</body></html>
```

0 comments on commit c022672

Please sign in to comment.