custom layouts for models in advanced modules

Could you please help guide me on how i can add custom layouts to a select field in a model in an advanced module from the _layouts folder in my advanced module.


  • edited 6:31PM
    It sounds like you are talking about using the "block" layout field

    In your model, setup a field to house the layout's data and add the name of that field to the models' serialized_fields property array:
    public $serialized_fields = array('my_layout_data');
    This field will hold JSON encoded data for the layout.

    Then in your model's form_fields() method, specify that field type as a "block". This will display a list of any block layouts you've setup:

    To have the block data save to your model instead of the default fuel_pages table, specify the model property on the layout specification in MY_fuel_layouts to be the name of your model:
    // Fuel layout block $my_block_layout = new Fuel_block_layout('my_block_layout'); // must have a fuel/application/views/_block/my_block_layout.php file $my_block_layout->set_model('my_model');
Sign In or Register to comment.