This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
core/Zotlabs/Module
2018-12-09 16:37:15 -08:00
..
Admin
Settings
Achievements.php
Acl.php
Admin.php
Api.php
Appman.php
Apporder.php
Apps.php
Article_edit.php
Articles.php
Attach.php
Authorize.php
Authtest.php
Block.php
Blocks.php
Bookmarks.php
Branchtopic.php
Cal.php
Card_edit.php
Cards.php
Cdav.php
Changeaddr.php
Channel.php
Chanview.php
Chat.php
Chatsvc.php
Cloud_tiles.php
Cloud.php
Common.php
Connect.php
Connections.php
Connedit.php
Contactgroup.php
Cover_photo.php
Dav.php
Defperms.php
Directory.php
Dirsearch.php
Display.php reset page title if article has no title. 2018-12-05 16:24:30 -08:00
Dreport.php dreport updates 2018-11-12 16:08:22 -08:00
Editblock.php
Editlayout.php
Editpost.php
Editwebpage.php
Email_resend.php
Email_validation.php
Embedphotos.php
Events.php
Fbrowser.php
Feed.php
Fhublocs.php
File_upload.php
Filer.php
Filerm.php
Filestorage.php
Follow.php
Getfile.php
Go.php
Group.php
Hashtags.php
Hcard.php
Help.php
Home.php
Hostxrd.php
Hq.php
Impel.php add item.uuid to relevant places 2018-11-15 16:34:09 -08:00
Import_items.php
Import.php prevent incompatible export files (osada/zap) from being imported. This is to keep your DB from getting trashed. We probably need a similar thing for item import since the object formats aren't compatible 2018-11-27 11:53:02 -08:00
Invite.php
Item.php fix generated plink 2018-12-03 14:21:33 -08:00
Lang.php
Layouts.php
Like.php partial solution for obj|tgt multiple (zot and zot6) encodings; the zot6 version will be stored under $item['obj']['asld'] 2018-12-03 20:09:57 -08:00
Linkinfo.php
Lockview.php
Locs.php
Login.php
Logout.php
Lostpass.php
Magic.php
Mail.php
Manage.php
Menu.php
Message.php
Mitem.php
Moderate.php
Mood.php add item.uuid to relevant places 2018-11-15 16:34:09 -08:00
Network.php
New_channel.php total_identities restriction off by one 2018-12-09 11:20:57 -08:00
Notes.php
Notifications.php
Notify.php
Oauth2.php
Oauth2testvehicle.php
Oauth.php
Oauthinfo.php
Ochannel.php
Oembed.php
Oep.php
Oexchange.php
Ofeed.php
Online.php
Owa.php
Page.php
Pconfig.php Do not store serialized pconfig value received via to Module/Pconfig.php 2018-11-25 10:22:09 +01:00
Pdledit.php
Permcat.php
Permcats.php
Photo.php Better cache settings logic 2018-11-29 21:27:06 +01:00
Photos.php recalculate photo filesize when rotating an image 2018-11-17 09:51:28 +01:00
Ping.php allow notification filtering by name or addr 2018-11-30 19:03:14 -08:00
Poco.php
Poke.php
Post.php
Prate.php
Pretheme.php
Probe.php
Profile_photo.php
Profile.php
Profiles.php
Profperm.php
Pubsites.php
Pubstream.php
Randprof.php
Rate.php
Ratings.php
Ratingsearch.php
Rbmark.php
React.php mid -> uuid conversions for basic reactions 2018-11-15 16:02:29 -08:00
README.md
Regdir.php
Register.php
Regmod.php
Regver.php
Removeaccount.php
Removeme.php
Rmagic.php rmagic discovery for z6 networks 2018-12-09 16:37:15 -08:00
Rpost.php
Search_ac.php
Search.php Fix double escaping after xss fix 2018-11-13 23:06:00 -05:00
Service_limits.php
Settings.php
Setup.php
Share.php
Sharedwithme.php
Siteinfo.php
Sitelist.php
Smilies.php
Snap.php
Sources.php
Sslify.php
Starred.php
Subthread.php add item.uuid to relevant places 2018-11-15 16:34:09 -08:00
Suggest.php
Tagger.php
Tagrm.php
Tasks.php
Theme_info.php
Thing.php
Toggle_mobile.php
Toggle_safesearch.php
Token.php
Tokens.php
Uexport.php
Update.php
Userinfo.php
View.php
Viewconnections.php
Viewsrc.php
Wall_attach.php
Wall_upload.php
Webfinger.php
Webpages.php
Well_known.php
Wfinger.php partial solution for obj|tgt multiple (zot and zot6) encodings; the zot6 version will be stored under $item['obj']['asld'] 2018-12-03 20:09:57 -08:00
Wiki.php
Xchan.php
Xpoco.php
Xrd.php
Xref.php
Zfinger.php
Zot_probe.php
Zot.php push recent changes 2018-11-19 15:04:08 -08:00
Zotfeed.php
Zping.php

Zotlabs/Module

This directory contains controller modules for handling web requests. The lowercase class name indicates the head of the URL path which this module handles. There are other methods of attaching (routing) URL paths to controllers, but this is the primary method used in this project.

Module controllers MUST reside in this directory and namespace to be autoloaded (unless other specific routing methods are employed). They typically use and extend the class definition in Zotlabs/Web/Controller as a template.

Template:

<?php

namespace Zotlabs\Web;


class Controller {

	function init() {}
	function post() {}
	function get() {}

}

Typical Module declaration for the '/foo' URL route:

<?php
namespace Zotlabs\Module;

class Foo extends \Zotlabs\Web\Controller {

	function init() {
		// init() handler goes here
	}

	function post() {
		// post handler goes here
	}

	function get() {
		return 'Hello world.' . EOL;
	}

}

This model provides callbacks for public functions named init(), post(), and get(). init() is always called. post() is called if $_POST variables are present, and get() is called if none of the prior functions terminated the handler. The get() method typically retuns a string which represents the contents of the content region of the resulting page. Modules which emit json, xml or other machine-readable formats typically emit their contents inside the init() function and call 'killme()' to terminate the Module.

Modules are passed the URL path as argc,argv arguments. For a path such as

https://mysite.something/foo/bar/baz

The app will typically invoke the Module class 'Foo' and pass it

$x = argc(); // $x = 3

$x = argv(0); // $x = 'foo'
$x = argv(1); // $x = 'bar'
$x = argv(2); // $x = 'baz'

These are handled in a similar fashion to their counterparts in the Unix shell or C/C++ languages. Do not confuse the argc(),argv() functions with the global variables $argc,$argv which are passed to command line programs. These are handled separately by command line and Zotlabs/Daemon class functions.