camelize() static public method

Transform "handler-class" to "HandlerClass" and "my-op" to "myOp".
static public camelize ( $string, $type = CAMEL_CASE_HEAD_UP ) : string
$string input string
$type which kind of camel case?
return string the string in camel case
 /**
  * Retrieve the requested operation from the request
  *
  * NB: This can be an operation that not actually
  * exists in the requested component.
  *
  * @param $request PKPRequest
  * @return string the requested operation or an empty string
  *  if none can be found.
  */
 function getRequestedOp($request)
 {
     if (is_null($this->_op)) {
         $this->_op = '';
         // Retrieve the service endpoint parts from the request.
         if (is_null($rpcServiceEndpointParts = $this->_getValidatedServiceEndpointParts($request))) {
             // Endpoint parts cannot be found in the request
             return '';
         }
         // Pop off the operation part
         $this->_op = PKPString::camelize(array_pop($rpcServiceEndpointParts), CAMEL_CASE_HEAD_DOWN);
     }
     return $this->_op;
 }
Esempio n. 2
0
 /**
  * Returns a canonical form of the property
  * name ready to be used as a property id in an
  * external context (e.g. Forms or Templates).
  * @return string
  */
 function getId()
 {
     // Replace special characters in XPath-like names
     // as 'person-group[@person-group-type="author"]'.
     $from = array('[', ']', '@', '"', '=');
     $to = array('-', '', '', '', '-');
     $propertyId = trim(str_replace($from, $to, $this->getName()), '-');
     $propertyId = PKPString::camelize($propertyId);
     return $propertyId;
 }