dongxindu8753
2018-05-17 10:01
浏览 43
已采纳

Laravel 4.2:在会话中保留多维数组数据

In my laravel 4.2 application, i want to store the cart item details in session.

cartId =>[
            0 => [
                productId => x,
                quantity  => y
            ],
            1 => [
                productId => u,
                quantity  => v
            ],
            2 => [
                productId => l,
                quantity  => m
            ]

         ]

I didn't found a way except this

Session::push('user.teams', 'developers');

for storing as array in session. but the same is not applicable here

图片转代码服务由CSDN问答提供 功能建议

在我的laravel 4.2应用程序中,我想将购物车项目详细信息存储在会话中。</ p> \ n

  cartId =&gt; [
 0 =&gt;  [
 productId =&gt;  x,
 quantity =&gt;  y 
],
 1 =&gt;  [
 productId =&gt; 你,
数量=&gt;  v 
],
 2 =&gt;  [
 productId =&gt;  l,
 quantity =&gt;  m 
] 
 
] 
 </ code> </ pre> 
 
 

除了</ p>

  Session之外,我没有找到办法 :: push('user.teams','developers'); 
 </ code> </ pre> 
 
 

用于在会话中存储为数组。 但是这里不适用</ p > </ div>

2条回答 默认 最新

相关推荐 更多相似问题