Page handler

I'm currently using Elgg 2.3.14 (having issues upgrading to the latest, but that's another discussion topic) and I'm trying to register page handlers for my plugin.  I currently have two pages that I'd like to handle that are located in the following directory under my document root:

/var/www/html/mod/fc-plugin/views/default/resources/login.php

/var/www/html/mod/fc-plugin/views/default/resources/auth_callback.php

My start.php located at /var/www/html/mod/fc-plugin/start.php is as follows:

<?php

elgg_register_event_handler('init', 'system', 'fc_plugin_init');

    function fc_plugin_init() {

    elgg_register_page_handler('fc-plugin', 'fc_page_handler');

    //elgg_register_page_handler('callback', 'auth_callback_handler');

    elgg_extend_view('css/elgg', 'auth0_login/css');

    elgg_extend_view('css/elgg', 'auth_callback/css');

    elgg_extend_view('css/elgg', 'fc-plugin/css');

}

function fc_page_handler(array $segments) {

    echo '<script>console.log( "Debug.. made it here!" );</script>';

    $subpage = elgg_extract(0, $segments);

    if ($subpage === 'login') {

        // use login view

        echo elgg_view_resource('login');

    }

    if ($subpage === 'auth_callback') {

    // use auth0 callback view

    echo '<script>console.log( "Debug.. made it to callback!" );</scri pt>';

    echo elgg_view_resource('auth_callback');

    }

}

The login page opens correctly when called from it's initiator but the auth_callback page isn't rendering when it is called.  My auth_callback.php page has a couple of console statements that don't print to the screen but the console statement in the code above do show on the console.  I'm not quite sure why my callback page isn't rendering on the screen.  Any help would be appreciated.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking