Ouzo\Utilities\Strings::appendSuffix PHP Method

appendSuffix() public static method

Example: $string = 'Daenerys'; $stringWithSuffix = Strings::appendSuffix($string, ' Targaryen'); Result: Daenerys Targaryen
public static appendSuffix ( string $string, string $suffix = '' ) : string
$string string
$suffix string
return string
    public static function appendSuffix($string, $suffix = '')
    {
        if (is_null($string)) {
            return null;
        }
        return $string . $suffix;
    }

Usage Example

Beispiel #1
0
 public function getClassName()
 {
     $class = Strings::underscoreToCamelCase($this->controller);
     if (Strings::endsWith($class, 'Controller')) {
         return $class;
     }
     return Strings::appendSuffix($class, 'Controller');
 }
All Usage Examples Of Ouzo\Utilities\Strings::appendSuffix