Cod*_*alk 1 php customization parsing codeigniter
我的问题是,我正在寻找使用Php Simple Html Dom Parser的方法,但是该文件似乎只是一个集合,functions而不是class SomeClass{}声明,因此很难像我声明后那样将其作为自定义内容 嵌入library到codeigniter中。 。$ this-> load-> library('someclass');
我已将此代码放在用于简单HTML Dom解析器的pastebin中:http : //pastebin.com/0rR6Kiex
我想知道如何通过定义的类轻松地使所有这些功能可用:
class MyClass{
## contents of pastebin here
}
Run Code Online (Sandbox Code Playgroud)
所以我可以加载codeigniter,例如:
$this->load->library('myclass');
$thus->myclass->fetchlinks();
Run Code Online (Sandbox Code Playgroud)
目前,我正在尝试手动要求一个php文件,这有点违反了使用codeigniter的观点:
function fetchlinks(){
## include the Simpledom framework #########################################################
include "localhost/mysite/assets/php/Simpledom.php" or die('Error occured on page'); #
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4110 次 |
| 最近记录: |