Part
V2EX  ›  问与答

laravel 里面的 User model 是个”特别“的东西?无法添加方法与属性

  •  
  •   Part · Apr 2, 2014 · 4161 views
    This topic created in 4448 days ago, the information mentioned may be changed or developed.
    class User extends Eloquent implements UserInterface, RemindableInterface

    里面添加 public static 方法和属性,都无法调用

    把 User 改成别的名字都可以
    9 replies    2014-06-12 21:25:30 +08:00
    tunetoystory
        1
    tunetoystory  
       Apr 2, 2014
    都可以的呀


    tunetoystory
        2
    tunetoystory  
       Apr 2, 2014   ❤️ 1
    这里的 BaseModel 也是 extends Eloquent 的
    Part
        3
    Part  
    OP
       Apr 2, 2014
    @Rabbit52 莫非我哪里打开的方式不对? 继续debug... ...
    Part
        4
    Part  
    OP
       Apr 2, 2014
    got it,Ctrl + v 惹的祸。 Thanks any way! @Rabbit52
    tunetoystory
        5
    tunetoystory  
       Apr 2, 2014
    @Part 我也刚用 Laravel,感觉坑多啊,文档太简陋了,很多东西都要各种搜
    ooh
        6
    ooh  
       Apr 2, 2014
    欢迎来到laravel的世界!
    mahone3297
        7
    mahone3297  
       Apr 2, 2014
    @Rabbit52 坑很多?我也打算用laravel试试。。。看http://laravel.com/docs/quick,然后
    laravel new blog
    这样,这个command执行了好长时间,终于好了。。
    然后 php artisan serve 这样,就报错了。。。
    现在准备打算尝试 composer的安装方式
    composer create-project laravel/laravel your-project-name --prefer-dist
    tunetoystory
        8
    tunetoystory  
       Apr 2, 2014
    @mahone3297 就是指文档不全啦,比起 symfony 真的要少好多好多~
    tunetoystory
        9
    tunetoystory  
       Jun 12, 2014
    Laravel 性能不行啊,开了 opcache 都没到 50ms 以内,比 symfony 性能都差,有个 C 框架 Phalcon 性能很吊,楼主可以试下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   928 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 22:45 · PVG 06:45 · LAX 15:45 · JFK 18:45
    ♥ Do have faith in what you're doing.