PHP code example of leeroy / php-inflector
1. Go to this page and download the library: Download leeroy/php-inflector 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/ */
leeroy / php-inflector example snippets
Inflector::underscore("PhpInflector\Inflector"); # => php_inflector/inflector
PhpInflector\Inflector::parameterize("Ærøskøbing on Water"); # => aeroskobing-on-water
PhpInflector\Inflector::foreign_key("Admin\Post"); # => post_id
PhpInflector\Inflector::denamespace("PhpInflector\Inflector\Inflections"); # => Inflections
PhpInflector\Inflector::dasherize("puni_puni"); # => puni-puni
PhpInflector\Inflector::inflections(function($inflect){
$inflect->acronym('RESTful');
});
PhpInflector\Inflector::titleize('RESTfulController'); # => RESTful Controller
json
{
"npunt/php-inflector": "1.0.*"
}
}