add missing namespaces/fix wrong class-names

This commit is contained in:
Philipp Holzer 2020-01-19 16:29:55 +01:00
commit 174129af94
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
13 changed files with 20 additions and 4 deletions

View file

@ -181,6 +181,8 @@ Put your tpl files in the *templates/* subfolder of your addon.
In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
```php
use Friendica\Core\Renderer;
# load template file. first argument is the template name,
# second is the addon path relative to friendica top folder
$tpl = Renderer::getMarkupTemplate('mytemplate.tpl', __DIR__);

View 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
@ -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