TP5.0Composer安装phpQuery

1)安装composer

参照该文档安装composer https://pkg.phpcomposer.com/


2)安装完后进入tp框架的根目录下,在根目录下的composer.json文件中的require中加入QueyListy和扩展如下

"jaeger/querylist": "^3.2",
"jaeger/querylist-ext-request":"^1.0",
"jaeger/querylist-ext-multi":"^1.0",
"jaeger/querylist-ext-login":"^1.0"

{
    "name": "topthink/think",
    "description": "the new thinkphp framework",
    "type": "project",
    "keywords": [
        "framework",
        "thinkphp",
        "ORM"
    ],
    "homepage": "http://thinkphp.cn/",
    "license": "Apache-2.0",
    "authors": [
        {
            "name": "liu21st",
            "email": "[email protected]"
        }
    ],
    "require": {
        "php": ">=5.4.0",
        "topthink/framework": "^5.0",
        "jaeger/querylist": "^3.2",
        "jaeger/querylist-ext-request":"^1.0",
        "jaeger/querylist-ext-multi":"^1.0",
        "jaeger/querylist-ext-login":"^1.0"
    },
    "extra": {
        "think-path": "thinkphp"
    },
    "config": {
        "preferred-install": "dist"
    }
}


3)这里演示的是windows下安装,命令窗口进入到tp项目的根目录下执行以下命令

安装 composer require jaeger/querylist

更新 composer update jaeger/querylist

4)引入并测试

 ['img','src']])->data;
        //打印结果
        print_r($data);
    }
}



你可能感兴趣的:(PHP笔记)