-
Notifications
You must be signed in to change notification settings - Fork 3
Create A Blank Application
Knowing how to create a blank application for Xoops Engine is sometimes usefully.
XoopsEngine/usr/apps/demo
-
blocks
contains the class files of blocks -
class
contains library -
configs
contains configuration files -
controllers
contains controller class files -
languages
contains languages pack -
models
contains model class files -
resources
contains static files, such as images and javascript files. this folder will be copied tohtdocs
when the appliction being installed -
sql
contains mysql files -
templates
contains template files, html.
To be a application, some files is necessary.
The file called application information file is put at directory configs
and named as info.php
. The basic content as follow, you don't need know the meaning, other wiki page will descripte it.
return array(
// App name
'name' => _DEMO_MI_NAME,
// Description, for admin
'description' => _DEMO_MI_DESC,
// Version number
'version' => '1.0.0',
// Author: full name <email> <website>
'author' => 'Your Name <[email protected]>',
// Contact email
'email' => '[email protected]',
// Credits for contributors
'credits' => 'XOOPS Development Team; Zend Framework',
// Distribution license
'license' => 'GPL v2',
// Logo image, for admin
'logo' => 'resources/images/logo.png',
// Readme file, for admin
'readme' => 'docs/readme.txt',
);
The info.php contains the data about application configuration. The above is not the entire data but to let this demo application run.
The Xoops Engine applications are based on MVC. So, one application must contains on default controller named _{application name}IndexController . The follow is the default controller for the application demo.
class Demo_IndexController extends Xoops_Zend_Controller_Action
{
public function indexAction()
{
$this->template->assign('sayhi', 'Hi, Xoops!');
}
}
Corresponding to the default controller, the template file is index_index.html and put at /usr/apps/demo/tamplates/.
<h1><{$sayhi}></h1>
Now, you can start the work of creating.