V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Ouyangan
V2EX  ›  问与答

如何在页面 action 字符串中做判断,解析出数据

  •  
  •   Ouyangan · Jul 24, 2015 · 2082 views
    This topic created in 3939 days ago, the information mentioned may be changed or developed.

    这个问题真不好怎么描述 , 我的目的在于更新修改共用一个界面 , 提交的时候判断url中的id状态,
    我在网上找到这样一个例子
    action="acount/%{id==null?addUser:updateUser}" , 但是这个id不需要${user.id}这样取值吗?我怎么试验都没能成功,描述的有些慌乱哈哈,请大家给一点建议参考.

    3 replies    2015-07-25 10:13:03 +08:00
    nealnote
        1
    nealnote  
       Jul 24, 2015
    %{id==null?addUser:updateUser}

    id = null; // addUser
    id = 1; // updateUser
    id = 2; // updateUser
    id = 'whatever'; // updateUser


    url中id的状态是什么,甜的还是咸的,好吃么?
    cxshun
        2
    cxshun  
       Jul 24, 2015
    id状态?是指用户有没有登录之类的吗?
    如果是用户有没有登录之类的,那么就有一个公共的头部div啥的,反正登录的情况下就显示那块,没登录就另外一块div呗。
    如果不是我理解的那样,那就再描述一下
    Ouyangan
        3
    Ouyangan  
    OP
       Jul 25, 2015
    @cxshun @nealnote ...哈哈 , 就是指id是否为null
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3164 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 66ms · UTC 14:36 · PVG 22:36 · LAX 07:36 · JFK 10:36
    ♥ Do have faith in what you're doing.