This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:development:hello_world_page [2010/06/29 16:44] jonyo always file-based design these days |
tutorials:development:hello_world_page [2014/09/25 16:55] (current) |
||
---|---|---|---|
Line 15: | Line 15: | ||
//file / | //file / | ||
- | class addon_hello_world_info { | + | class addon_hello_world_info |
- | var $name = ' | + | { |
- | var $version = ' | + | public |
- | var $title = 'Hello World'; | + | public |
- | var $author = "Hello World, Inc."; | + | public |
- | var $description = ' | + | public |
- | var $auth_tag = ' | + | public |
- | var $pages = array ( | + | public |
+ | public | ||
' | ' | ||
); | ); | ||
Line 31: | Line 32: | ||
//file: / | //file: / | ||
- | class addon_hello_world_pages { | + | class addon_hello_world_pages |
- | function hello_world_page(){ | + | { |
+ | public | ||
+ | { | ||
//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/ | - Now, go into addon management at [[admin_menu/ | ||
- There should now be a link for **Edit Page** for the Hello World addon. | - There should now be a link for **Edit Page** for the Hello World addon. | ||
- | - 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. | + | - 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. |
- While still on the page, look for the **Link to Page**. | - While still on the page, look for the **Link to Page**. | ||
Line 57: | Line 60: | ||
// | // | ||
- | class addon_hello_world_pages { | + | class addon_hello_world_pages |
- | function hello_world_page(){ | + | { |
+ | public | ||
+ | { | ||
//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 83: | Line 88: | ||
Even though this is listed as an " | Even though this is listed as an " | ||
- | |||
- | <tip c n> | ||
For help creating Smarty templates, see the official [[http:// | For help creating Smarty templates, see the official [[http:// | ||
Line 102: | 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 |
+ | { | ||
//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 |