I dynamically create a cms page or I give the content the path of the block.

$data is an array form.

 * @access public
 * @return void
public function createCmsPageForStore($data){

    $urlCleanStore = $this->remove_accents($data['store_name']);

    if(in_array($urlCleanStore, $this->getCmsPageUrlKey())){

         Mage::getModel('cms/page')->load($urlCleanStore)->setContent('{{block type="core/template" template="boutique/boutique.phtml" items='.$data.'}}')->save();


I can not access my data, I don't understand how I can pass an array into a template.

Example: if I pass just one variable, it's working in my template


implode your array

$data = implode(',', $data);

And pass it on item param.

In your phtml, get $this->getData('items') and explode by ,(comma)

  • Hello , this not work, my data is good with implode, but when i getData in phtml, i have just the key of form. i updated my post look – devmagento Jan 24 '18 at 8:33
  • if you convert array to a object and try to pass – Max Souza Jan 24 '18 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.