Skip to content

Instantly share code, notes, and snippets.

@zircote
Created February 11, 2012 23:04
Show Gist options
  • Select an option

  • Save zircote/1804895 to your computer and use it in GitHub Desktop.

Select an option

Save zircote/1804895 to your computer and use it in GitHub Desktop.
Zend_Rest_Route
<?php
// 205
// Map PUT and POST to actual create/update actions
// based on parameter count (posting to resource or collection)
switch( $values[$this->_actionKey] ){
case 'post':
if ($pathElementCount > 0) {
$values[$this->_actionKey] = 'put';
} else {
$values[$this->_actionKey] = 'post';
}
break;
case 'put':
$values[$this->_actionKey] = 'put';
break;
}
//220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment