V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
duhastmich
V2EX  ›  分享发现

Silex: PHP micro-framework

  •  
  •   duhastmich · 2011-05-07 18:29:38 +08:00 · 6061 次点击
    这是一个创建于 4710 天前的主题,其中的信息可能已经有所发展或是发生改变。
    http://silex-project.org/

    <?php
    require_once __DIR__.'/silex.phar';

    $app = new Silex\Application();

    $app->get('/hello/{name}', function($name) {
    return "Hello $name";
    });

    $app->run();

    头回听说 php archive 这东西,难道运行的时候先解压。。
    14 条回复    2015-06-28 23:08:03 +08:00
    ilexswam
        1
    ilexswam  
       2011-05-07 19:40:22 +08:00
    看起来似乎不错。

    感觉语法挺像 node.js 的。
    duhastmich
        2
    duhastmich  
    OP
       2011-05-07 20:03:01 +08:00
    @ilexswam 纯纯的php5.3啊,node不是js嘛
    sogood
        3
    sogood  
       2011-05-07 20:18:07 +08:00
    命名空间哇,跟 lithium 一样吗。http://rad-dev.org/lithium/
    aligo
        4
    aligo  
       2011-05-07 20:35:42 +08:00
    这个是sinatra风格的吧
    aligo
        5
    aligo  
       2011-05-07 20:38:02 +08:00
    phar就是php的jar嘛,用得不多就是了
    duhastmich
        6
    duhastmich  
    OP
       2011-05-07 21:10:10 +08:00
    @sogood php框架就是多
    duhastmich
        7
    duhastmich  
    OP
       2011-05-07 21:12:23 +08:00
    @aligo sinatra, bingo! phar=>jar 我也这么想呢,phar算是伪编译?
    aligo
        8
    aligo  
       2011-05-07 21:21:50 +08:00
    @duhastmich 没编译啊,就是tar包改个扩展名。。。
    aligo
        9
    aligo  
       2011-05-07 21:27:10 +08:00
    订正:似乎有基于zip格式的phar,以及tar的格式的phar,以及phar格式的phar
    duhastmich
        10
    duhastmich  
    OP
       2011-05-07 21:41:06 +08:00
    @aligo 是啊,我当时用7z l silex.phar 试过,不是标准压缩包
    qichangxing
        11
    qichangxing  
       2011-05-08 09:11:58 +08:00
    chuck911
        12
    chuck911  
       2011-05-08 10:37:58 +08:00
    nodejs web framework http://expressjs.com/

    var app = express.createServer();

    app.get('/', function(req, res){
    res.send('Hello World');
    });

    app.listen(3000);

    sammyJS.org javascript frontend framework

    var app = $.sammy(function() {

    this.get('#/', function() {
    $('#main').text('test');
    });

    });
    app.run()
    duhastmich
        13
    duhastmich  
    OP
       2011-05-09 21:21:15 +08:00
    @chuck911 @qichangxing 抛砖引玉了,哈哈
    yakczh
        14
    yakczh  
       2015-06-28 23:08:03 +08:00
    跟laravel 一样,都是Symfony的类库套个壳子 换个名字就是一个框架新鲜出炉了, php根本不需要框架
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2869 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 13:10 · PVG 21:10 · LAX 06:10 · JFK 09:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.