Add ProjectApiFormatter
This commit is contained in:
22
Formatter/ProjectApiFormatter.php
Normal file
22
Formatter/ProjectApiFormatter.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Plugin\Calendar\Formatter;
|
||||
|
||||
/**
|
||||
* Class ProjectApiFormatter
|
||||
*
|
||||
* @package Kanboard\Plugin\Calendar\Formatter
|
||||
*/
|
||||
class ProjectApiFormatter extends \Kanboard\Formatter\ProjectApiFormatter
|
||||
{
|
||||
public function format()
|
||||
{
|
||||
$project = parent::format();
|
||||
|
||||
if (! empty($project)) {
|
||||
$project['url']['calendar'] = $this->helper->url->to('CalendarController', 'project', array('project_id' => $project['id'], 'plugin' => 'Calendar'), '', true);
|
||||
}
|
||||
|
||||
return $project;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user