Gerisi api eylem

0 Cevap php

m developing rest api by zf. this is my user controller.

<?php
class UserController extends Zend_Rest_Controller
{

    public function init()
    {
        $this->_helper->viewRenderer->setNoRender(true);
    }

   public function indexAction()
    {
         $this->getResponse()
            ->appendBody("From indexAction() returning all articles");
    }

    public function getAction()
    {
        $this->getResponse()
            ->appendBody("From getAction() returning the requested article");

    }

    public function postAction()
    {
        $this->getResponse()
            ->appendBody("From postAction() creating the requested article");

    }

    public function putAction()
    {
        $this->getResponse()
            ->appendBody("From putAction() updating the requested article");

    }

    public function deleteAction()
    {
        $this->getResponse()
            ->appendBody("From deleteAction() deleting the requested article");

    }


}
?>

Bu url çalıştırarak http://quickstart.local/user/ alıyorum

From indexAction() returning all articles

ve bu url çalıştırarak http://quickstart.local/user/1 alıyorum

From getAction() returning the requested article

i mesajı test edebilirsiniz, nasıl eylemi silmek, koydu.

Teşekkürler

0 Cevap