ntk - the Nolimitzzz Toolkit Documentation

Code Example

In a first example, let's assume we want to create an implementation called "ntk_one":

a) So the first thing to do is to create a subfolder under the custom folder with the name of "ntk_one".

b) Then we set it up in the ntk_config.php file in the custom folder. We define the implementation called "ntk_one". So the ntk_config.php file would look like so:

define('NTK_IMPLEMENTATION', 'ntk_one');


c) Then we define recurring content block in the file generic.php:

/*
 * Generic content functions generic.php
 */
function ntk_one_end_head( $i_htmlstr, $params ) { 
    $i_htmlstr .= "<style>body{ font-family:Arial,sans-serif; font-size:4em; text-align:center }</style>"; 
    return $i_htmlstr;         
}

function ntk_one_end_footer( $i_htmlstr, $params ) { 
    $i_htmlstr .= "Powered by ntk - the nolimitzzz toolkit"; 
    return $i_htmlstr;         
}

/*
 * Assign specific content functions to content hooks
 */
$doc->add_content( 'end_head',       'ntk_one_end_head' );
$doc->add_content( 'end_footer',     'ntk_one_end_footer' );

/*
 * End of Generic content functions
 */


d) After that, we define the default content block in the index.php:

/*
 * Default Landing Page index.php
 */

/*
 * Include generic content functions ( head, header, footer,... )
 */
require_once __DIR__ . '/generic.php';

/*
 * Specific content functions
 */    
function ntk_one_start_content( $i_htmlstr, $params ) {         
    ; // Your default contents for the content block could go here...       
}    

/*
 * Assign specific content functions to content hooks
 */
$doc->add_content( 'start_content',  'ntk_one_start_content' );

/*
 * End of Default Landing Page
 */


e) Now you can copy the index.php file for all pages you like to add, just renaming it each time to "ntk_" followed by the page title, and changing the start_content hook or potentially adding more hooks.

f) Upload all these files to your server and your done !