Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:16:57+00:00 2026-06-17T23:16:57+00:00

I want to implement a RESTful design in Zend Framework 1. I am not

  • 0

I want to implement a RESTful design in Zend Framework 1. I am not sure how to document the resources and which methods are allowed and which extra parameters can be supplied.

My current implementation uses a controller name as resource and the HTTP methods are the action names. I am already sending “Allow” in the header containing:

GET, PUT, PATCH, LINK, UNLINK, POST, DELETE, HEAD, OPTIONS

I am wondering how I can document the possible and required parameters for the client.

  1. Is there a common DocBlock convention?
  2. Is it feasible to “autodocument” the possible extra parameters with HTTP headers (like the “Allow” part)

Right now I am making up DocBlock attributes and sending them on an “OPTIONS” request.

/**
 * @route /data/results
 * @method GET
 * @requiredParams pid The project ID
 * @queryParams tid The team ID
 */
public function getAction()
{
    $pid = $this->_getParam('pid');
    $teamId = $this->_getParam('tid');

    if (null === $pid) {
        $this->getResponse()->setHttpResponseCode(400);
        $this->getResponse()
        ->setBody(Zend_Json::encode(array('required parameters missing')));
    } else {
        $this->getResponse()->setBody(Zend_Json::encode(array($pid, $teamId)));
        $this->getResponse()->setHeader('Content-Type', 'application/json');
        $this->getResponse()->setHttpResponseCode(200);
    }
}

public function optionsAction()
{
    $reflect = new Zend_Reflection_Class($this);
    foreach (explode(',',$this->getAllowedMethods()) as $method) {
        $action = strtolower(trim($method)) . 'Action';
        try {
            $docs[] = $method.' '.$reflect->getMethod($action)
                    ->getDocblock()->getContents();
        } catch(Zend_Reflection_Exception $e) {

        }
    }

    $this->getResponse()->setBody(implode("\n",$docs));
    $this->getResponse()->setHttpResponseCode(200);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:16:57+00:00Added an answer on June 17, 2026 at 11:16 pm

    There seem to be not accepted standards. A good resource is:

    https://github.com/nelmio/NelmioApiDocBundle

    for the Symfony2 framework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement the restful convention on my controllers but am not sure
I want to implement file upload in RESTful way using openrasta but not able
I want to implement the recently approved PATCH HTTP verb in a RESTful service
I want to implement an application which will work as a parser. User will
I am trying to implement a RESTful API in which I have to upload
I want to create a sample RESTful web service in java which involves all
I want to implement a RESTful webservice for an Android App using JSON. Do
I have a RESTful webservice which communicates over HTTPS. I want to prevent other
I'm writing some restful serverside resources which talk with dojo's JsonRestStore (JRS) on the
I want to implement spring security on a jersey Restful web service, both on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.