Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Requires:

  • phpFox 4.5+

Here is the example structure of Install.php:

Install.php sample
<?php
namespace Apps\PHPfox_Core;

use Core\App;
use Core\App\Install\Setting;

class Install extends App\App
{
    protected function setId()
    {
        $this->id = 'PHPfox_Core';//Set ID for your app. This action is required.
    }
    protected function setSupportVersion()
    {
        $this->start_support_version = '4.4.0';//Start support version
        $this->end_support_version = '4.5.0';//End support version
    }

    protected function setAlias()
    {
		//Set alias for your app
    }

    protected function setName()
    {
        $this->name = 'phpFox Core';//Set Name for your app, this name will display in manage apps (admincp)
    }

    protected function setVersion()
    {
        $this->version = '4.0.1';//Set version for your app
    }

    protected function setSettings()
    {
        //Define settings for your app
    }

    protected function setUserGroupSettings()
    {
		//Define user group settings for your app
    }

    protected function setComponent()
    {
		//Define component for your app
    }

    protected function setComponentBlock()
    {
		//Define component block for your app
    }

    protected function setPhrase()
    {
        //Add more phrase for your app. However, for mow please define in phrase.json
    }

    protected function setOthers()
    {
		//Set other information for your app
        $this->_publisher = 'phpFox'; //Your company name
        $this->_publisher_url = 'http://store.phpfox.com/';//Your company website
    }
}

 

These are all information you can define for your app:

IDDefineNote
1$this->id = "your_app_id"

This is your app ID, it must be the same folder name stored your app.

Space is not allowed. This ID can't change.

2$this->alias = "your_app_alias"

This value is used for: admincp url, block name, component name, ajax name,...

This value must be lower case and no space.

If your app is simple, this value can be empty.

3$this->name = "your app name"The name of your app, it will display in manage app in admincp
4$this->version = "your.app.version"Version of your app. It has to follow version naming convention.
5$this->icon = "your_app_icon"

Define Icon of your app. We support 3 ways to define your app icon:

  • Image link: Put image link of your icon here.
  • Font awesome class: Put font awesome class here: it will display icon from font awsome.
  • Icon image: Don't set or set empty this value, we will get file "icon.png"
6$this->admincp_route = "default admincp route"Default page of your app in admincp
7$this->admincp_menu = []Your app menu in admincp
8$this->admincp_help 
9$this->admincp_action_menu 
10$this->map 
11$this->map_search 
12$this->menu

Add a menu for your app on main menu bar

13$this->settingsYour app's settings
14$this->user_group_settingsYour app's user groups settings
15$this->notification 
16$this->databasedatabase table for your app
17$this->component 
18$this->component_block 
19$this->routes 
20$this->start_support_versionOlder phpFox version your app can support
21$this->end_support_versionLatest phpFox version your app can support
22$this->phraseadvanced phrases
23$this->_publisherYour company name
24$this->_publisher_urlYour company home page
25$this->_admin_cp_menu_ajaxSet true: menu in adincp will load by ajax; false: menu will load by refresh page. Default is true

Define in bold is required

  • No labels