V
V
Vadim Ivanenko2014-06-23 00:26:27
JavaScript
Vadim Ivanenko, 2014-06-23 00:26:27

How to organize application structure on Zend Framework 2 to create AJAX REST API?

Started learning ZF2. Now I want to write a web service and I would like to think over the structure.

Let's say I create modules that will have models and Restful controllers.
Modules
-- ApiUsers
---- src
------ ApiUsers
-------- Controller
-------- Model
-- ApiBlog
... etc.

0) API versions.
- Will it be convenient to work with such an application structure in case of new versions? What problems can there be?

Now you need to write the client side using AngularJS, AJAX and at the moment I have little idea how this thing will interact with the service.

1) Convenient URL.
Mob. applications work directly with the API (host.ru/api/v1/blog/posts) and do not display URLs, but browser users need host.ru/blog/posts.
- How to do this? Do I need more modules, controllers, views, or can this be implemented using JS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
naneri, 2014-06-23
@supra7sky

On the second question - a convenient URL - can be implemented on Angular, it just has a philosophy - working with api. It turns out your api will just be needed only to access data from the database.

O
Oleg Abrazhaev, 2014-07-31
@seyfer

Use Apigility

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question