适应性和指数.phtml模板


Apigility and index.phtml template

我正在尝试创建一个索引。php页面到我的RESTful API。我所采取的措施是1)创建一个DB连接的API任何给定的它路由"帐户"2)使用postman访问/account上的帐户API,并获得HAL和JSON来响应工作3)在与3个视图模型的内容协商下创建一个新的"选择器"。"ZF'ContentNegotiation'ViewModel"、"ZF'Hal'View'HalJsonModel"answers"Zend'View'Model'ViewModel"4)在账户API中选择新创建的选择器5)创建索引。在Account/view/index下。php代码"

Test

"6)添加
'view_manager' => array(
        'template_path_stack' => array(
            'account' => __DIR__ . '/../view',
        ),
    ),
对module.config.php

7)使用postman和access/account with接受应用程序/json//worksAccept text/html//not work

如果有人能帮我找个索引就太好了。使用restful DB连接API

如果你想使用ViewModel,你应该选择RPC API。您可以按照以下文档创建RPC API

https://apigility.org/documentation/intro/getting-started create-an-rpc-service