add missing namespaces/fix wrong class-names
This commit is contained in:
parent
3b16829484
commit
174129af94
13 changed files with 20 additions and 4 deletions
|
@ -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__);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue