Topic: [Theme] placing action hook

Hi guys,
First of thanks to the main developer for making this wonderful, minimal, not sot feature bloat CMS. I really like it; very much smile

I'm developing a custom theme, I understand that Monstra has nice action-hooks system (observable pattern). My question is, where should I place all my custom hook functions. should I put it inside the template file (this could be messy) or separate file. And is there any hierarchical maps of how the theme load. something like:

../themes/index.php 
 -> header
 -> content
 -> footer

Thanks in advance.

Re: [Theme] placing action hook

Monstra Theme Loading

1) index.php

// Run
Action::run('frontend_pre_render');      
// Load site template
require(MINIFY . DS . 'theme.' . Site::theme() . '.' . Site::template() . '.template.php');       
// Run
Action::run('frontend_post_render');

2) Load site template. e.g. index.template.php

<?php Chunk::get('header'); ?>   
    <?php Chunk::get('navigation'); ?>
    <div id="main">    
        <div id="content">                                              
            <div>
                <?php Action::run('theme_pre_content'); ?>
            </div>
            <div>
                <?php echo Site::content(); ?>
            </div>
            <div>
                <?php Action::run('theme_post_content'); ?>
            </div>
        </div>
    </div>
<?php Chunk::get('footer'); ?>

> My question is, where should I place all my custom hook functions.
You mean like functions.php in WP ? I think you can try chunks(functions.chunk.php) for this. Create functions.chunk.php and load this on the begining.

<?php Chunk::get('functions'); ?>
<?php Chunk::get('header'); ?>
Monstra Loves You! Give some love back!

Re: [Theme] placing action hook

Thank you for your kind help