ioioioioioioi
V2EX  ›  问与答

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

  •  
  •   ioioioioioioi · Jan 5, 2017 · 2122 views
    This topic created in 3590 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
    qwer1234asdf
    Jan 5, 2017
    1
    一直不了解 php 为毛要整个\,而不是 /
    xiaozi
    xiaozi
    Jan 5, 2017
    2
    clean code
    shoaly
    shoaly
    Jan 5, 2017
    3
    如果 MailChimp 只用了一次 那么 写到 inline 里面去 我觉得也是很好的...
    这个问题其实完全可以类比成:
    有一个 Div 全局只出现了一次:
    1 定义一个 class, 然后将 style 写到 class 里面去
    2 直接在标签里面写 style=''..."
    ioioioioioioi
    ioioioioioioi
    OP
    Jan 5, 2017
    4
    @shoaly 有道理。
    cxbig
    cxbig
    Jan 5, 2017 via iPhone
    5
    只用一次的 inline 全路径是可以接受的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4934 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:43 · PVG 16:43 · LAX 00:43 · JFK 03:43
    ♥ Do have faith in what you're doing.