Understanding the life cycle of a component

MAURICIO CUNHA Posted in Component Development 7 years ago

I need to understand how I show pages in a custom component.

function ossn_cv_init() {

    ossn_register_com_panel('cv', 'settings');    
    ossn_register_page('cv', 'ossn_cv_pagehandler');

    if (ossn_isLoggedin()) {
        ossn_register_action('cv', __OSSN_CV__. 'actions/cv.php');
        ossn_register_sections_menu('newsfeed', array(
            'name' => 'cv',
            'text' => ossn_print('com:ossn:cv'),
            'url' => ossn_site_url('cv'),
            'parent' => 'links',
        )); 
    }   
}

I guess the parameter its correct and i call the file cv/pages/cv.php

function ossn_cv_pagehandler(){
   if (!ossn_isLoggedin()) {
            ossn_error_page();
   }
   $title = ossn_print('com:ossn:cv');
   $contents['content'] = ossn_plugin_view('cv/pages/cv');
   $content = ossn_set_page_layout('contents', $contents);
   echo ossn_view_page($title, $content);   
}
ossn_register_callback('ossn', 'init', 'ossn_cv_init');

This work but the page don't looks like any form (I put a form and some fields), probably I need to change and see some references I did this on /cv/pages/cv.php:

<div class="ossn-site-pages">
    <div class="ossn-site-pages-inner">
        <div class="ossn-site-pages-body">
           <?php echo ossn_view_form('cv/edit', array(
                    'action' => ossn_site_url() . 'action/cv-edit',
                    'component' => 'OSSNCV',
                    'params' => $params,
                    'class' => 'ossn-admin-form' 
                    ), false); 
        ?>
        </div>
    </div>
</div>

But its not work, always open a blank page , where is the problem ?

Replies
Indonesian Arsalan Shah Replied 7 years ago

What is the full path of your component directory? it seems there are few errors in the code you posted above.