original_string: protected function renderRegion($region, $template)
      {
          if (!isset($this->data[$region])) {
              return $this->render($template, $this->data);
          }
  
          $this->data[$region] = (array) $this->data[$region];
          gplcart_array_sort($this->data[$region]);
  
          $items = array();
  
          foreach ($this->data[$region] as $item) {
              $items[] = isset($item['rendered']) ? (string) $item['rendered'] : (string) $item;
          }
  
          $this->data[$region] = $this->render($template, array($region => $items));
          return $this->data[$region];
      }
code: protected function renderRegion($region, $template)
      {
          if (!isset($this->data[$region])) {
              return $this->render($template, $this->data);
          }
  
          $this->data[$region] = (array) $this->data[$region];
          gplcart_array_sort($this->data[$region]);
  
          $items = array();
  
          foreach ($this->data[$region] as $item) {
              $items[] = isset($item['rendered']) ? (string) $item['rendered'] : (string) $item;
          }
  
          $this->data[$region] = $this->render($template, array($region => $items));
          return $this->data[$region];
      }
code_tokens: protected function renderRegion ( $ region , $ template ) { if ( ! isset ( $ this -> data [ $ region ] ) ) { return $ this -> render ( $ template , $ this -> data ) ; } $ this -> data [ $ region ] = ( array ) $ this -> data [ $ region ] ; gplcart_array_sort ( $ this -> data [ $ region ] ) ; $ items = array ( ) ; foreach ( $ this -> data [ $ region ] as $ item ) { $ items [ ] = isset ( $ item [ 'rendered' ] ) ? ( string ) $ item [ 'rendered' ] : ( string ) $ item ; } $ this -> data [ $ region ] = $ this -> render ( $ template , array ( $ region => $ items ) ) ; return $ this -> data [ $ region ] ; }
docstring: Renders a region
  @param string $region
  @param string $template
  @return string
docstring_tokens: Renders a region