Package Data | |
---|---|
Maintainer Username: | monashee |
Maintainer Contact: | derek@marcinyshyn.com (monashee) |
Package Create Date: | 2014-10-02 |
Package Last Update: | 2014-10-02 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:09:47 |
Package Statistics | |
---|---|
Total Downloads: | 18,180 |
Monthly Downloads: | 149 |
Daily Downloads: | 3 |
Total Stars: | 3 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 1 |
Thin wrapper for http://simplehtmldom.sourceforge.net/ and provides the two public static functions
php file_get_html()
and php str_get_html()
Requires
Install via Composer by adding the following line to the require block of your composer.json file
"monashee/php-simple-html-dom-parser": "dev-master"
Then run php composer update
Add this line to the providers array in your php app/config/app.php
file:
'Monashee\PhpSimpleHtmlDomParser\PhpSimpleHtmlDomParserServiceProvider',
You could create an alias, but I prefer the DI method.
<?php
use Monashee\PhpSimpleHtmlDomParser\PhpSimpleHtmlDomParser;
class Test {
/**
* @var PhpSimpleHtmlDomParser
*/
protected $parser;
/**
* @param PhpSimpleHtmlDomParser $parser
*/
public function __construct(PhpSimpleHtmlDomParser $parser)
{
$this->parser = $parser;
}
public function getHtml()
{
$html = $this->parser->file_get_html('http://monasheemountainmultimedia.com');
dd($html);
}
}