hello,thinkphp!打印出来,thinkPHP
来源:互联网 发布:端口共享 编辑:程序博客网 时间:2024/04/24 07:31
第一天PHP,按照ThinkPHP3.1 的教程,想打印出来,确实有点难。不过折腾了几个小时,还是出来了,
其中出现的错误就是 浏览器出错,模板不存在:D:/wamp/www/app/Home/View/Index/index.html 我看一下文件的路径 ,发现并没有 Index 这个文件夹,所以 果断的就在对应的路径下面,新建了一个文件夹,并且把index.html 文件拖进去了,一运行,果然有惊喜。
具体代码块
index.php(文件路径:D:\wamp\www\app)
<?php
define('APP_DEBUG',TRUE);
// 引入ThinkPHP入口文件
require '../thinkphp/ThinkPHP/ThinkPHP.php';
IndexController.class.php (文件路径:D:\wamp\www\app\Home\Controller)
<?php
//修改于2016年9月21号()//liuyongqiang
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
public function index(){
$this->name = 'thinkphp'; // 进行模板变量赋值
$this->display(); // 加载模板的函数
}
}
index.html(文件路径:D:\wamp\www\app\Home\View\Index)
<html>
<head>
<title>hello {$name}</title>
</head>
<body>
hello, {$name}!
</body>
</html>
//通过模板 还是把变量打印出来了。
- hello,thinkphp!打印出来,thinkPHP
- thinkphp 打印输出
- thinkphp
- thinkphp
- ThinkPHP
- Thinkphp
- ThinkPHP
- thinkphp
- ThinkPHP
- THINKPHP
- thinkphp
- thinkphp ....
- thinkphp
- thinkphp
- thinkPhp
- thinkphp
- thinkphp
- thinkphp
- 主线程和子线程中的消息循环
- JAVA进阶5.3——JButton按钮
- 希尔排序
- SDWebImage框架梳理以及下载缓存的梳理和运用
- vs2013+opencv300的vs配置:
- hello,thinkphp!打印出来,thinkPHP
- MPV 快捷键
- Spark性能优化指南:基础篇
- IIC的应用
- pair rdd操作
- springMVC+poi导出excel
- 思科设备漏洞研究与利用
- 详解call(),apply()和bind()
- 6.0如何开启应用权限