PHP code example of skrip42 / class-name

1. Go to this page and download the library: Download skrip42/class-name library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

skrip42 / class-name example snippets


//create class name instance
$className = new ClassName('Skrip42\ClassName');
//or
$className = ClassName::from('Skrip42\ClassName');

//get data from ClassName instance
$className->getShortName(); //return 'ClassName';
$className->getNamespace(); //return 'Skrip42';
$className->getName(); //return 'Skrip42\ClassName';

//convert ClassName data
$className->toPlural()->getShortName(); //return 'ClassNames'
$className->toSingular()->getShortName(); // return 'ClassName'
$className->toSnakeCase()->getShortName(); // reutrn class_name
$className->toCamelCase()->getShortName(); // return 'ClassName'
$className->toLower()->getShortName(); // return 'className'
$className->toUpper()->getShortName(); // return 'ClassName'