original_string: public function thumbnail($type)
      {
          // We take image from posts field
          $image = $this->attributes['image'];
          // We need to get extension type ( .jpeg , .png ...)
          $ext = pathinfo($image, PATHINFO_EXTENSION);
          // We remove extension from file name so we can append thumbnail type
          $name = rtrim($image, '.'.$ext);
          // We merge original name + type + extension
          return $name.'-'.$type.'.'.$ext;
      }
code: public function thumbnail($type)
      {
          // We take image from posts field
          $image = $this->attributes['image'];
          // We need to get extension type ( .jpeg , .png ...)
          $ext = pathinfo($image, PATHINFO_EXTENSION);
          // We remove extension from file name so we can append thumbnail type
          $name = rtrim($image, '.'.$ext);
          // We merge original name + type + extension
          return $name.'-'.$type.'.'.$ext;
      }
code_tokens: public function thumbnail ( $ type ) { // We take image from posts field $ image = $ this -> attributes [ 'image' ] ; // We need to get extension type ( .jpeg , .png ...) $ ext = pathinfo ( $ image , PATHINFO_EXTENSION ) ; // We remove extension from file name so we can append thumbnail type $ name = rtrim ( $ image , '.' . $ ext ) ; // We merge original name + type + extension return $ name . '-' . $ type . '.' . $ ext ; }
docstring: Method for returning specific thumbnail for post.
docstring_tokens: Method for returning specific thumbnail for post .