Skip to content
Products
Apps
Docs
Log in
Log in
Sign up
Sign up
Products
Apps
Docs
Docs
Docs
CODE
On this page

How to Add an App

Build a UNA 15 app as a PHP module: copy Quote of the Day, set install/config.php, ship install SQL and language keys, install it from Studio or the command line, and carry later changes to installed sites with update packages or migrations.
Android
iOS
Web
Core
~15.0
Source
Copy Page
Note
Tip
'type' => BX_DOL_MODULE_TYPE_MODULE,
'name' => 'bx_quoteofday',
'title' => 'Quote of the Day',
'note' => 'Quote of the day, daily quotes',
'version' => '15.0.1.DEV',
'home_dir' => 'boonex/quoteofday/',
'home_uri' => 'quoteofday',
'db_prefix' => 'bx_quoteofday_',
'class_prefix' => 'BxQuoteOfDay',
'language_category' => 'Quote Of Day',
public function serviceGetSafeServices()
{
    return array (
        'GetQuote' => '',
    );
}
INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
(3, @sName, '_bx_quoteofday', '_bx_quoteofday', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg');

SET @iPageId = LAST_INSERT_ID();

INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `featured`)
VALUES(@iPageId, @sName, 'content', '{url_studio}module.php?name=bx_quoteofday', '', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg', '_bx_quoteofday', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}', 0);
php scripts/manage.php -u .. -c install_modules -o yourvendor/yourapp
php scripts/manage.php -u .. -c disable_modules -o yourvendor/yourapp
php scripts/manage.php -u .. -c enable_modules -o yourvendor/yourapp
php scripts/manage.php -u .. -c uninstall_modules -o yourvendor/yourapp
bx_alert('bx_posts', 'add', $iPostId, $iProfileId, [
	'content' => $sContent,
	'title' => $sTitle,
	'module' => $this->_oConfig->getName(),
]);
INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES
(@sName, 'BxQuoteOfDayAlertsResponse', 'modules/boonex/quoteofday/classes/BxQuoteOfDayAlertsResponse.php', '');
SET @iHandler := LAST_INSERT_ID();

INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
('system', 'save_setting', @iHandler);
'relations' => array(
	'bx_timeline',
	'bx_notifications'
),
-- UNA-Migration-Min-System-Version: 15.0.0-RC3

UPDATE `sys_menu_items` SET `active_api`=1 WHERE `set_name`='sys_site' AND `module`='bx_polls' AND `name`='polls-home';
12d
On this page
I want to...Before you startFolder layoutNaming in install/config.phpClassesInstall SQLInstall vs enable vs ActiveInstall and test your appFormsPagesNavigationPolyglotAlertsHooks, services, and relationsPermissionsWorked example checklist (Quote of the Day)After Install: Studio buildersShip changes to installed sitesUpdate packagesMigrationsContributing a module to UNATipsTroubleshootingFor developersGitHub SourcesRelated
Introduction
Getting Started
Configuration
Apps
CODE
Developer Architecture
Code Convention
Code Quality
Directory Structure
How to Add an App
Storage System
Common Mistakes
Payment Provider Integration
Module API
iOS Client
NEO Developer
Android Client
Web Client
Contributing
REST API
Analytics Developer
Auth
Connect
'type' => BX_DOL_MODULE_TYPE_MODULE,
'name' => 'bx_quoteofday',
'title' => 'Quote of the Day',
'note' => 'Quote of the day, daily quotes',
'version' => '15.0.1.DEV',
'home_dir' => 'boonex/quoteofday/',
'home_uri' => 'quoteofday',
'db_prefix' => 'bx_quoteofday_',
'class_prefix' => 'BxQuoteOfDay',
'language_category' => 'Quote Of Day',
INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
(3, @sName, '_bx_quoteofday', '_bx_quoteofday', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg');

SET @iPageId = LAST_INSERT_ID();

INSERT INTO `sys_std_widgets` (`page_id`, `module`, `type`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`, `featured`)
VALUES(@iPageId, @sName, 'content', '{url_studio}module.php?name=bx_quoteofday', '', 'bx_quoteofday@modules/boonex/quoteofday/|std-icon.svg', '_bx_quoteofday', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}', 0);
php scripts/manage.php -u .. -c install_modules -o yourvendor/yourapp
php scripts/manage.php -u .. -c disable_modules -o yourvendor/yourapp
php scripts/manage.php -u .. -c enable_modules -o yourvendor/yourapp
php scripts/manage.php -u .. -c uninstall_modules -o yourvendor/yourapp
INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES
(@sName, 'BxQuoteOfDayAlertsResponse', 'modules/boonex/quoteofday/classes/BxQuoteOfDayAlertsResponse.php', '');
SET @iHandler := LAST_INSERT_ID();

INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
('system', 'save_setting', @iHandler);