Conflicts: doc/DerivedTheme1.md doc/Developers.md doc/Features.md doc/Plugins.md doc/Privacy.md doc/README.md doc/Remove-Account.md doc/Translations.md doc/about.bb doc/account_basics.bb doc/accounts_profiles_channels_basics.bb doc/addons.bb doc/addons_gnusocial.bb doc/bbcode.html doc/campaign.bb doc/classRedmatrix_1_1Import_1_1Import-members.html doc/classRedmatrix_1_1Import_1_1Import.html doc/cloud.bb doc/connecting_to_channels.bb doc/connecting_to_channels.md doc/credits.bb doc/de/channels.bb doc/de/features.bb doc/de/main.bb doc/de/registration.bb doc/developers.bb doc/encryption.bb doc/external-resource-links.bb doc/extra_features.bb doc/faq_admins.bb doc/faq_developers.bb doc/faq_members.bb doc/features.bb doc/hidden_configs.bb doc/history.md doc/html/index.php doc/main.bb doc/permissions.bb doc/plugins.bb doc/problems-following-an-update.bb doc/profiles.bb doc/red2pi.bb doc/registration.bb doc/roadmap.bb doc/sv/main.bb doc/what_is_zot.bb doc/zot.md
34 lines
1.1 KiB
Clojure
34 lines
1.1 KiB
Clojure
[size=large][b]Frequently Asked Questions For Developers[/b][/size]
|
|
|
|
[toc]
|
|
|
|
|
|
[h3]What does $a mean?[/h3]
|
|
$a is a class defined in boot.php and passed all around $Projectname as a global reference variable. It defines everything necessary for the $Projectname application: Server variables, URL arguments, page structures, layouts, content, installed plugins, output device info, theme info, identity of the observer and (potential) page owner ...
|
|
|
|
We don't ever create more than one instance and always modify the elements of the single instance. The mechanics of this are somewhat tricky. If you have a function that is passed $a and needs to modify $a you need to declare it as a reference with '&' e.g.
|
|
|
|
[code]function foo(&$a) { $a->something = 'x'; // whatever };
|
|
|
|
*or* access it within your function as a global variable via get_app()
|
|
|
|
function foo() {
|
|
$a = get_app();
|
|
$a->something = 'x';
|
|
}
|
|
|
|
|
|
function foo($a) { $a->something = 'x'; };
|
|
|
|
will *not* change the global app state.
|
|
|
|
function foo() {
|
|
get_app()->something = 'x';
|
|
}
|
|
[/code]
|
|
|
|
|
|
|
|
#include doc/macros/main_footer.bb;
|
|
|