Current time: 05-23-2012, 10:35 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Dev] The Class
11-27-2008, 02:29 PM
Post: #1
[Dev] The Class
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
Visit this user's website Find all posts by this user
Quote this message in a reply
11-27-2008, 02:31 PM
Post: #2
RE: [Dev] The Class
Whoa, that's some powerful stuff! Big Grin

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
11-27-2008, 03:19 PM
Post: #3
RE: [Dev] The Class
Sure is Wink

Jimmie Lin - Community Manager & THT.Next Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
11-27-2008, 04:20 PM
Post: #4
RE: [Dev] The Class
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)