ZnetDK 4 Mobile

 Install the App?

App Folders

Folders of the Starter App

Root folder of the Starter App

The Starter App source code is located into the INSTALL_DIR/applications/default folder

Folder tree of the Starter App

The typical folder tree of the Starter App is shown below:

  •  INSTALL_DIR/applications/
    •  default/
      •  app/Here are installed the private PHP scripts.
        •  controller/
          •  myappctrl.php
        •  lang/
          •  locale.php
        •  model/
          •  mydao.php
        •  validator/
          •  myvalidator.php
        •  view/
          •  myappview.php
        •  .htaccessProhibits access to the contents of the folder.
        •  config.php
        •  menu.php
        •  myclass.php
      •  documents/
        •  .htaccessProhibits access to the contents of the folder.
        •  mydocument.pdf
        •  mypicture.jpg
      •  public/Here are installed the public resources.
        •  css/
          •  mystyles.css
        •  images/
          •  mylogo.jpg
        •  js/
          •  mylibrary.js

Starter Application PHP Class Namespace

The PHP classes of the Starter App must be declared with a namespace prefixed by app.

Here are some examples of namespace according to the folder where the PHP script is located:

myappctrl.php script (controller)

<?php
namespace app\controller;
class 
MyAppCtrl extends \AppController {

    static protected function 
action_get() {
        
/* Code of the controller's action */
    
}

}

mydao.php script (model)

<?php
namespace app\model;
class 
MyDao extends \DAO {

    protected function 
initDaoProperties() {
        
/* Code of the DAO */
    
}

}

myvalidator.php script (validator)

<?php
namespace app\validator;
class 
MyValidator extends \Validator
{
    protected function 
initVariables() {
        return array(
'my_first_value''my_second_value');
    }

    protected function 
check_my_first_value($value) {        
        
/* Code for validating data */
    
}
    protected function 
check_my_second_value($value) {
        
/* Code for validating data */
    
}
    
}

myclass.php script

<?php
namespace app;
class 
MyClass
{
    
/* Code of the class */
}