Magento将网格表单添加到cms页面

时间:2016-02-22 12:49:38

标签: magento grid repeater

我想创建一个模块,用于在cms页面上添加动态网格,如下所示:

enter image description here

我能够创建自定义字段,如文本或文件,但我不知道如何添加(删除)多个元素,我没有找到任何示例/教程,你能给我一些提示或一些链接?

编辑: 学习magento代码到Varien / data / form / gallery我找到了一种方法,我使用gallery.php元素作为起点然后我创建我的元素,问题是如何保存数据,现在我将数据保存到列中作为数组或json

    $aa = "[";        
    foreach ($_FILES as $file) 
    {
        $aa = $aa . $file["name"]["-1"] . ",";
    }
    $aa = $aa . "]";
    $aa = str_replace(",]","]",$aa);
    $model->setBackground($aa);

我能够获得这个值,但我认为不是最好的方法,最好是创建一个自定义的magento模型吗?

0 个答案:

没有答案