]> git.mxchange.org Git - friendica.git/blobdiff - doc/autoloader.md
Display featured posts for contacts
[friendica.git] / doc / autoloader.md
index e9ceb1aaf50a1682a86ff3cf2a8a12f1ff85c23b..e1588688f187443066396031e2be023205957efe 100644 (file)
@@ -47,8 +47,10 @@ The code will be something like:
 // mod/network.php
 <?php
 
+use Friendica\App;
+
 function network_content(App $a) {
-       $itemsmanager = new Friendica\ItemsManager();
+       $itemsmanager = new \Friendica\ItemsManager();
        $items = $itemsmanager->getAll();
 
        // pass $items to template
@@ -104,7 +106,7 @@ class Dfrn {
 
 mail_post($a){
        ...
-       Friendica\DFRN::mail($item, $owner);
+       Friendica\Protocol\DFRN::mail($item, $owner);
        ...
 }
 ```
@@ -117,6 +119,8 @@ If your code is in same namespace as the class you need, you don't need to prepe
 
 namespace Friendica;
 
+use Friendica\Protocol\DFRN;
+
 // this is the same content of current include/delivery.php,
 // but has been declared to be in "Friendica" namespace