Home > Backend Development > PHP Tutorial > A strange phenomenon in thinkphp

A strange phenomenon in thinkphp

WBOY
Release: 2016-08-20 09:04:02
Original
1219 people have browsed it

I encountered a strange phenomenon today when I was working on a project with tp. When I introduced the css file into the template, it actually prompted the message "Unable to load module" that the wooden block does not exist.

The specific code is as follows:

<code class="HTML">    <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="__STATIC__/css/font-awesome.min.css" rel="stylesheet" />

    <link href="__STATIC__/css/tree/treedefault.css" rel="stylesheet" />
    <link href="__STATIC__/css/tree/treetable.css" rel="stylesheet" /></code>
Copy after login
Copy after login

Here comes the strange place:
Above picture: A strange phenomenon in thinkphp

Error reason:
A strange phenomenon in thinkphp

But the css file exists:
A strange phenomenon in thinkphp

For __STATIC__ path:
A strange phenomenon in thinkphp

I just don’t understand why the above ones can be introduced successfully, but these two cannot be introduced? (○´・д・)ノ

Add one more code in the runtime. There are no two pieces of code in the runtime
A strange phenomenon in thinkphp

@yangxiangming, the path to directly output it is like this

A strange phenomenon in thinkphp

End this post, the reason has been found. Yes, I don’t know why those two css files suddenly disappeared. I pulled it again and it's fine now. I was careless and didn't notice this problem (but the screenshot I took contains 2 files /(ㄒoㄒ)/~~) When was it deleted? Here’s the final rendering. Thank you to all the great sf guys

A strange phenomenon in thinkphp

Reply content:

I encountered a strange phenomenon today when I was working on a project with tp. When I introduced the css file into the template, it actually prompted the message "Unable to load module" that the wooden block does not exist.

The specific code is as follows:

<code class="HTML">    <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="__STATIC__/css/font-awesome.min.css" rel="stylesheet" />

    <link href="__STATIC__/css/tree/treedefault.css" rel="stylesheet" />
    <link href="__STATIC__/css/tree/treetable.css" rel="stylesheet" /></code>
Copy after login
Copy after login

Here comes the strange place:
Picture above: A strange phenomenon in thinkphp

Error reason:
A strange phenomenon in thinkphp

But the css file exists:
A strange phenomenon in thinkphp

For __STATIC__ path:
A strange phenomenon in thinkphp

I just don’t understand why the above ones can be introduced successfully, but these two cannot be introduced? (○´・д・)ノ

Add one more code in the runtime. There are no two pieces of code in the runtime
A strange phenomenon in thinkphp

@yangxiangming, the path to directly output it is like this

A strange phenomenon in thinkphp

End this post, the reason has been found. Yes, I don’t know why those two css files suddenly disappeared. I pulled it again and it's fine now. I was careless and didn't notice this problem (but the screenshot I took contains 2 files /(ㄒoㄒ)/~~) When was it deleted? Here’s the final rendering. Thank you to all the great sf guys

A strange phenomenon in thinkphp

Thank you for the invitation. I looked at your code and I really can’t see anything wrong! Have a look at the output debugging

<code>//直接输出看看。看看是什么地址,然后直接通过浏览加载看看能访问吧
__STATIC__/css/tree/treedefault.css
__STATIC__/css/tree/treetable.css</code>
Copy after login

Look at the files generated in runtime and see that part of the code.

Your two CSS requests are regarded as accessing the tree method in the css controller in the Static module.
If you are using an apache server, you need to determine whether the file exists in .htaccess, and then forward it to index.php.

Because your file path was written incorrectly, the request reported 404, and your nginx forwards all requests to index.php by default.

There will be a link that does not exist and will be taken over by php. TP will query the corresponding controller according to the requested path, and the controller does not exist.

This is not tp’s problem.

Related labels:
source:php.cn
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