Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Dev] The Class
#1
Yeah, this is basically a plugin doc.

The Classes
Tons of actions can be done with the THT Default Classes: $main, $db, $email and $style.

A example would be:
PHP Code:
<?php
//////////////////////////
// The Hosting Tool
// By Jonny H
//////////////////////////
/*
 * Global
 */
 
global $style$main$db;
 
/* First Example, show /includes/tpl/test.tpl with vars predefined
  */
  
$array['TESTVAR'] = 'test';
  
$style->replaceVar('tpl/test.tpl',$array);
  
/*
 This shows test.tpl, and in test.tpl you can put %TESTVAR% anywhere to show 'test' (no quotes) in the screen.
 */
 /* Second Example, get the value of configuration 'test_config' and prints it with /includes/tpl/test2.tpl, in the var %CONFIGVALUE%
 */
 
$array['CONFIGVALUE'] = $db->config('test_config');
 
$style->replaceVar('tpl/test2.tpl'$array);
 
/* Final Example, return a html for a tht table, with the content "LOL", title "Test", printed in the var %LOL% in /includes/tpl/test3.tpl */
 
$array['LOL'] = $main->table('Test','LOL');
 
$style->replaceVar('tpl/test3.tpl',$array);
?>

Self Explanatory. More will be written soon.
Jimmie Lin - Community Manager & THT.Next Developer
Reply
#2
Whoa, that's some powerful stuff! Big Grin
Kevin Mark - TheHostingTool Lead Developer
Reply
#3
Sure is Wink
Jimmie Lin - Community Manager & THT.Next Developer
Reply
#4
I think I will write a full documentation when It gets released. It's much easier this time over. There's different sort of apps and stuff you can do. There's:
Types
Importers
Servers
Jonny H - THT Main Developer & Founder


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)