duhastmich

Silex: PHP micro-framework

  •  
  •   duhastmich · May 7, 2011 · 7348 views
    This topic created in 5671 days ago, the information mentioned may be changed or developed.
    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 replies  •  2015-06-28 23:08:03 +08:00
    ilexswam
    ilexswam
    May 7, 2011
    1
    看起来似乎不错。

    感觉语法挺像 node.js 的。
    duhastmich
    duhastmich
    OP
    May 7, 2011
    2
    @ilexswam 纯纯的php5.3啊,node不是js嘛
    sogood
    sogood
    May 7, 2011
    3
    命名空间哇,跟 lithium 一样吗。http://rad-dev.org/lithium/
    aligo
    aligo
    May 7, 2011
    4
    这个是sinatra风格的吧
    aligo
    aligo
    May 7, 2011
    5
    phar就是php的jar嘛,用得不多就是了
    duhastmich
    duhastmich
    OP
    May 7, 2011
    6
    @sogood php框架就是多
    duhastmich
    duhastmich
    OP
    May 7, 2011
    7
    @aligo sinatra, bingo! phar=>jar 我也这么想呢,phar算是伪编译?
    aligo
    aligo
    May 7, 2011
    8
    @duhastmich 没编译啊,就是tar包改个扩展名。。。
    aligo
    aligo
    May 7, 2011
    9
    订正:似乎有基于zip格式的phar,以及tar的格式的phar,以及phar格式的phar
    duhastmich
    duhastmich
    OP
    May 7, 2011
    10
    @aligo 是啊,我当时用7z l silex.phar 试过,不是标准压缩包
    chuck911
    chuck911
    May 8, 2011
    12
    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
    duhastmich
    OP
    May 9, 2011
    13
    @chuck911 @qichangxing 抛砖引玉了,哈哈
    yakczh
    yakczh
    Jun 28, 2015
    14
    跟laravel 一样,都是Symfony的类库套个壳子 换个名字就是一个框架新鲜出炉了, php根本不需要框架
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4328 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 09:08 · PVG 17:08 · LAX 01:08 · JFK 04:08
    ♥ Do have faith in what you're doing.