User Tools

Site Tools


tutorials:development:hello_world_page

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:development:hello_world_page [2010/06/29 16:49]
jonyo no more file-based design. well, it's all file based design now.
tutorials:development:hello_world_page [2014/09/25 16:55] (current)
Line 15: Line 15:
 //file /addons/hello_world/info.php //file /addons/hello_world/info.php
  
-class addon_hello_world_info { +class addon_hello_world_info 
- var $name = 'hello_world'; +
- var $version = '1.0.0'; + public $name = 'hello_world'; 
- var $title = 'Hello World'; + public $version = '1.0.0'; 
- var $author = "Hello World, Inc."; + public $title = 'Hello World'; 
- var $description = 'Displays "Hello World" page.'; + public $author = "Hello World, Inc."; 
- var $auth_tag = 'my_addons'; + public $description = 'Displays "Hello World" page.'; 
- var $pages = array (+ public $auth_tag = 'my_addons'; 
 + public $pages = array (
  'hello_world_page'  'hello_world_page'
  );  );
Line 31: Line 32:
 //file: /addons/hello_world/pages.php //file: /addons/hello_world/pages.php
  
-class addon_hello_world_pages { +class addon_hello_world_pages 
- function hello_world_page(){+
 + public function hello_world_page () 
 + {
  //Note: The method name matches the page name used in the $pages var in info.php  //Note: The method name matches the page name used in the $pages var in info.php
  return "Hello World!";  return "Hello World!";
Line 39: Line 42:
   - Now, go into addon management at [[admin_menu/addons/manage_addons/start|Addons > Manage Addons]], and you should see the addon named **Hello World**. Install and enable that addon. <   - Now, go into addon management at [[admin_menu/addons/manage_addons/start|Addons > Manage Addons]], and you should see the addon named **Hello World**. Install and enable that addon. <
   - There should now be a link for **Edit Page** for the Hello World addon.  Click on this link. <   - There should now be a link for **Edit Page** for the Hello World addon.  Click on this link. <
-  - On this page, select what template you want to use for your page, one template for every language you have defined, and save the changes.  Remember, using this tutorial the addon will be replacing the **(!MAINBODY!)** in the template. <+  - On this page, select what template you want to use for your page, one template for every language you have defined, and save the changes.  Remember, using this tutorial the addon will be replacing the **{body_html}** in the template. <
   - While still on the page, look for the **Link to Page**.  Click on the link to the right, and if everything was done correctly, you will see the page displayed, with the text "Hello World!" displayed on the main part of it. <   - While still on the page, look for the **Link to Page**.  Click on the link to the right, and if everything was done correctly, you will see the page displayed, with the text "Hello World!" displayed on the main part of it. <
  
Line 57: Line 60:
 //Alternate, to display the entire page //Alternate, to display the entire page
  
-class addon_hello_world_pages { +class addon_hello_world_pages 
- function hello_world_page(){+
 + public function hello_world_page () 
 + {
  //Note: The method name matches the page name used in the $pages var in info.php  //Note: The method name matches the page name used in the $pages var in info.php
 ?> ?>
Line 100: Line 105:
  
 //extend our info class, so we can use $this-> to access vars in it //extend our info class, so we can use $this-> to access vars in it
-class addon_hello_world_pages extends addon_hello_world_info {+class addon_hello_world_pages extends addon_hello_world_info 
 +{
  
- function hello_world_page(){+ public function hello_world_page () 
 + {
  //Note: The method name matches the page name used in the $pages var in info.php  //Note: The method name matches the page name used in the $pages var in info.php
  //First, get instance of the view class  //First, get instance of the view class
tutorials/development/hello_world_page.1277830185.txt.gz · Last modified: 2014/09/25 16:55 (external edit)