ioioioioioioi
V2EX  ›  问与答

这种写法有什么不好? $MailChimp = new \DrewM\MailChimp\MailChimp('blalbaj');

  •  
  •   ioioioioioioi · Jan 5, 2017 · 1833 views
    This topic created in 3420 days ago, the information mentioned may be changed or developed.

    主流写法都是:

    use \DrewM\MailChimp\MailChimp;
    
    $MailChimp = new MailChimp('fafff');
    
    5 replies    2017-01-05 20:28:40 +08:00
    qwer1234asdf
        1
    qwer1234asdf  
       Jan 5, 2017
    一直不了解 php 为毛要整个\,而不是 /
    xiaozi
        2
    xiaozi  
       Jan 5, 2017
    clean code
    shoaly
        3
    shoaly  
       Jan 5, 2017
    如果 MailChimp 只用了一次 那么 写到 inline 里面去 我觉得也是很好的...
    这个问题其实完全可以类比成:
    有一个 Div 全局只出现了一次:
    1 定义一个 class, 然后将 style 写到 class 里面去
    2 直接在标签里面写 style=''..."
    ioioioioioioi
        4
    ioioioioioioi  
    OP
       Jan 5, 2017
    @shoaly 有道理。
    cxbig
        5
    cxbig  
       Jan 5, 2017 via iPhone
    只用一次的 inline 全路径是可以接受的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   996 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 19:27 · PVG 03:27 · LAX 12:27 · JFK 15:27
    ♥ Do have faith in what you're doing.