tp5框架基础配置和加载

本文介绍了ThinkPHP5框架的基础配置,包括如何安装框架,理解默认入口文件public/index.php的作用。同时,讲解了如何设置并加载前后台模板文件,特别是在app下的index/controller/Index.php文件中定义的index方法。后台界面可以通过http://www.tp.com/public/index.php/admin/index访问,静态资源如js、css、img等应存放在public/static目录下,并根据后台admin和前台index创建相应子目录引用资源。
摘要由CSDN通过智能技术生成

1.官网 http://www.thinkphp.cn/down.html

安装后

默认入口public/index.php

2.前后台设置加载模板文件 app下的index/controller/Index.php文件里的index方法输出

<?php
namespace app\index\controller;

class Index
{
    public function index()
    {
        return '<style type="text/css">*{ padding: 0; margin: 0; } .think_default_text{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p> ThinkPHP V5<br/><span style="font-size:30px">十年磨一剑 - 为API开发设计的高性能框架</span>&
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值