search
Homephp教程php手册thinkPHP,引入文件有关问题

thinkPHP,引入文件问题。 本帖最后由 jonson_li 于 2015-09-08 18:22:55 编辑 图1在action里面引入这几个文件,图2是文件的目录结构,之前用原生的调用执行都没有问题 ,引入到tp方法都找不到了。后面用import也不可以,求帮忙 ------解决思路--------------

thinkPHP,引入文件问题。

本帖最后由 jonson_li 于 2015-09-08 18:22:55 编辑





图1在action里面引入这几个文件,图2是文件的目录结构,之前用原生的调用执行都没有问题
,引入到tp方法都找不到了。后面用import也不可以,求帮忙
------解决思路----------------------
第15行,'dirname(__FILE__)/protocl'
你觉得__FILE__在字符串里能被解析吗?拆分成dirname(__FILE__) . '/protocl'
------解决思路----------------------
你 import 的参数是错误的,文件的放置也不符合 import 的约定
你完全可以继续使用 require,虽然不符合 TP 的规范

由于你没有提及实例化对象时出现错误,因此可假定实例化是成功的
于是可推定实例化语句包含在被嵌入的文件中

发生 Call to a member function .... 错误的原因是:实例化的对象是全局的,在 tp 的方法中不能直接使用(这是基本的变量作用域问题)
------解决思路-----------------【本文来自鸿网互联 (http://www.68idc.cn)】-----
错误信息说你用一个空对象调用了stringToProxy,说明你没有实例化某个对象,看看错误在哪个文件的哪一行出了错。
Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor