no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionLast revision | |||
— | hello_world_application [2012-12-12 11:17] – [Hello World! Application] potion | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======= Hello World! Application ======= | ||
+ | This is a developer documentation for a simple application without any database access. Feng Office uses the [[MVC|MVC design pattern]], but for this example we need only the view and the controller part. | ||
+ | //Note: this page relates to the older, Feng Office V1.x framework. | ||
+ | |||
+ | ===== New controller ===== | ||
+ | Create a new file called // | ||
+ | |||
+ | <code php> | ||
+ | class HelloworldController extends ApplicationController { | ||
+ | function __construct() { | ||
+ | parent:: | ||
+ | prepare_company_website_controller($this, | ||
+ | } | ||
+ | function index() { | ||
+ | $my_var = ' | ||
+ | tpl_assign(' | ||
+ | |||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== New view ===== | ||
+ | Create a file which is called equal to the action name, here // | ||
+ | |||
+ | <code html> | ||
+ | Hello <?php echo $world ?> ! | ||
+ | </ | ||
+ | |||
+ | ===== Integrate in Feng Office ===== | ||
+ | Show the new application near the others as a tab: | ||
+ | Add it to the constructor of the // | ||
+ | |||
+ | <code php> | ||
+ | var tab_panel = new Ext.TabPanel({ | ||
+ | id: ' | ||
+ | region:' | ||
+ | activeTab: | ||
+ | enableTabScroll: | ||
+ | items: [ | ||
+ | ... | ||
+ | new og.ContentPanel({ | ||
+ | title: lang(' | ||
+ | id: ' | ||
+ | iconCls: | ||
+ | refreshOnWorkspaceChange: | ||
+ | defaultContent: | ||
+ | type: " | ||
+ | data: og.getUrl(' | ||
+ | } | ||
+ | }), | ||
+ | </ | ||
+ | |||
+ | ===== Set a tab-label and an icon for the application ===== | ||
+ | For the English translation add a new item called // | ||
+ | |||
+ | <code javascript> | ||
+ | ... | ||
+ | ' | ||
+ | /* Hello World */ | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | The icon must set by the used theme, so for the default theme you save your icon by default in the public/ | ||
+ | Now connect the CSS class // | ||
+ | |||
+ | <code css> | ||
+ | .ico-helloworld { | ||
+ | background-image: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Now reload your Feng Office and you will see your Hello World! application at the top. | ||
+ | |||
+ | For Hello World discussion see http:// | ||
+ | |||
+ | ======Other examples ====== | ||
+ | |||
+ | [[http:// |