Home > PHP Framework > ThinkPHP > body text

How to use QueryList4 in ThinkPHP5

藏色散人
Release: 2021-02-28 16:25:32
forward
2477 people have browsed it

The following tutorial column will introduce how to use QueryList4 in ThinkPHP5. I hope it will be helpful to friends in need! ThinkPHP5 using QueryList4 tutorial

Almost every day, people ask me how to use QueryList4 in TP5, so I wrote this tutorial. To be honest, I don't really want to write this tutorial because it really doesn't have any technical content.

Installation steps

Download TP5

    Go to ThinkPHP official website to download the latest ThinkPHP5 framework code: http://www.thinkphp.cn
Install QueryList

    Execute the composer command in the ThinkPHP5 code root directory to install QueryList:
  • composer require jaeger/querylist
    Copy after login
Use QueryList

    The following Demonstrates the use of QueryList in the
  • Index
  • controller:
<?php
namespace app\index\controller;

use QL\QueryList;

class Index
{
    public function index()
    {
       //采集某页面所有的图片
       $data = QueryList::get(&#39;http://cms.querylist.cc/bizhi/453.html&#39;)->find('img')->attrs('src');
       //打印结果
       print_r($data->all());
    }
}
Copy after login

That’s it. Note

PHP >= 7.0

    QueryList4 cannot be installed and used in environments below PHP7!
  • QueryList4 cannot be installed and used in environments below PHP7!
  • QueryList4 cannot be installed and used in environments below PHP7!

If you still don’t know how to install it, you can go to the QueryList exchange group (123266961) to download the complete ThinkPHP5 integrated QueryList4 compressed package.

The above is the detailed content of How to use QueryList4 in ThinkPHP5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template