returns json

This commit is contained in:
buttle 2021-10-24 23:55:07 +02:00
parent 2c14639d0d
commit dffeb3ff33
2 changed files with 14 additions and 4 deletions

View File

@ -28,10 +28,13 @@ return [
'template_path_stack' => [ 'template_path_stack' => [
dirname(__DIR__) . '/view', dirname(__DIR__) . '/view',
], ],
'strategies' => [
'ViewJsonStrategy',
],
'template_map' => [ 'template_map' => [
// used to remove available blocks when editing a page // used to remove available blocks when editing a page
'omeka/site-admin/page/edit' => __DIR__ . '/../../../themes/archive/view/omeka/site-admin/page/edit.phtml', 'omeka/site-admin/page/edit' => __DIR__ . '/../../../themes/archive/view/omeka/site-admin/page/edit.phtml',
'archive-site-meta/archive-site-meta/index' => __DIR__ . '/../view/collections/index.phtml', //'archive-site-meta/archive-site-meta/index' => __DIR__ . '/../view/collections/index.phtml',
//'layout/layout' => __DIR__ . '/../../../themes/archive/view/layout/layout.phtml', //'layout/layout' => __DIR__ . '/../../../themes/archive/view/layout/layout.phtml',
//'omeka/index/index' => __DIR__ . '/../../../themes/archive/view/omeka/site/index/index.phtml', //'omeka/index/index' => __DIR__ . '/../../../themes/archive/view/omeka/site/index/index.phtml',
//'omeka/search/results' => __DIR__ . '/../../../themes/archive/view/omeka/search/results.phtml', //'omeka/search/results' => __DIR__ . '/../../../themes/archive/view/omeka/search/results.phtml',

View File

@ -2,7 +2,8 @@
namespace ArchiveSiteMeta\Controller; namespace ArchiveSiteMeta\Controller;
use Laminas\Mvc\Controller\AbstractActionController; use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel; #use Laminas\View\Model\ViewModel;
use Laminas\View\Model\JsonModel;
class ArchiveSiteMetaController extends AbstractActionController class ArchiveSiteMetaController extends AbstractActionController
{ {
@ -14,8 +15,14 @@ class ArchiveSiteMetaController extends AbstractActionController
public function indexAction() public function indexAction()
{ {
$view = new ViewModel; return new JsonModel([
return $view; 'status' => 'SUCCESS',
'message'=>'Here is your data',
'data' => [
'full_name' => 'John Doe',
'address' => '51 Middle st.'
]
]);
} }
} }