2017 © Pedro Peláez
 

library tt

My first Simple Php Framework

image

infifly/tt

My first Simple Php Framework

  • Thursday, October 19, 2017
  • by mailx8
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

简单php框架, (*1)

简单,0学习成本., (*2)

composer.json 如下, (*3)

{
    "name": "test",
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "infifly/tt":"*"
    },
    "autoload": {
        "psr-4": {"app\\":"tt"}
    },
    "config": {
        "secure-http": false
    },, (*4)

    "repositories": [
        {"type": "composer", "url": "http://packagist.phpcomposer.com"},
        {"packagist": false}
    ]
}
, (*5)


目录结构, (*6)

/configs/
/runtime/
/tt/
    |---controllers
    |-- LayoutController.php
/views/
    |--layout
    |--index.php
/models/
/web/
    |--assets
    |--images
    |--css
.htaccess
index.php
/vendor/
composer.json, (*7)

配置文件
/configs/pub.php
<?php
return [
   "appname"=>"tt",
   "env"=>"test" //prod, test,
];
?>, (*8)

/configs/web.php, (*9)

<?php
$cfg=include("pub.php");
$cfg['defaultlayout']="app\controllers\Layout.index";
$cfg['404page']="app\controllers\Layout.show404";
return $cfg;
?>
, (*10)

输出调试信息到页面 : \TT::setDebugMessage("xxxxx");, (*11)

代码示例:
控制器:
<?php
namespace app\controllers;
use TT\core\Controller;
class TestController extends Controller{, (*12)

    public function __construct()
    {
        parent::__construct();
    }  , (*13)

    public function indexAction(){
        \TT::setDebugMessage("test");
        return $this->render("index",['name'=>'infi']);
    }
}
?>
模板:
1:/views/layout/index.php:, (*14)

<html>
<head>
<body>
    <?=$this->getContent()?>
</body>
</html>, (*15)

2:/views/test/index.php
<?=$name?>, (*16)

, (*17)

The Versions

19/10 2017

dev-master

9999999-dev

My first Simple Php Framework

  Sources   Download

The Requires

 

by infifly

19/10 2017

v0.12

0.12.0.0

My first Simple Php Framework

  Sources   Download

The Requires

 

by infifly

19/10 2017

v0.11

0.11.0.0

My first Simple Php Framework

  Sources   Download

The Requires

 

by infifly

19/10 2017

0.1

0.1.0.0

My first Simple Php Framework

  Sources   Download

The Requires

 

by infifly