Adding Block's to Custom Module.
I have created a module and added a block to one of the field like below .
$fields = parent::form_fields($values, $related);
$fields['block'] = array('type' => 'block', 'folder' => 'sections');
And also made that field as serialize to save array as a string in DB as we do it in Pages Variable.
Issue is whenever , on saving the form from Admin UI its updated in DB but on clicking edit,
Block fields are not populated
Comments
$my_block_layout->set_model('my_model');
now my block layout look's like in C:\xampp\htdocs\fuel_cms\fuel\application\config\MY_fuel_layouts.php
$posts_img = new Fuel_block_layout('posts_img');
$posts_img->set_label('Posts Images');
$posts_img->add_field('title', array());
$posts_img->add_field('content', array('type' =>'text'));
$posts_img->add_field('image', array('type' =>'asset'));
$posts_img->set_model('Journals_model');
// NOTE THIS IS ADDED TO THE 'blocks' key and not the 'layouts' key !!!! $config['blocks']['posts_img'] = $posts_img;