monashee/php-simple-html-dom-parser
Composer 安装命令:
composer require monashee/php-simple-html-dom-parser
包简介
Laravel wrapper for the PHP Simple HTML DOM Parser package.
README 文档
README
Thin wrapper for http://simplehtmldom.sourceforge.net/ and provides the two public static functions
php file_get_html() and php str_get_html()
Installation
Requires
- PHP 5.4+
- Laravel 4.2+
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',
Sample Usage
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); } }
统计信息
- 总下载量: 19.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-02