Download the PHP package avram/vokativ without Composer

On this page you can find all versions of the php package avram/vokativ. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vokativ

Vokativ

PHP class used to convert first names from Serbian language into their vocative case.

Introduction

Serbian language uses vocative case in order to address a person, so when someone register to a site with name Filip it is okay to greet (address) them in English with "Hello Filip", but in Serbian it would be "Zdravo Filipe", and "Zdravo Filip" is not correct and really sounds strange. But vocative is not as simple as appending "e" to a name. It has a set of rules and this PHP class tries to apply those rules to all Serbian names. If it can't, it'll use the built-in dictionary (nominative => vocative) to find a correct form.

Note that it is not perfect and please notify me if you find any erroneously converted names. PRs are also welcome.

Intallation

Install using composer with:

composer require avram/vokativ

Or manually by cloning this repository:

git clone https://github.com/avramovic/Vokativ.git

Usage

Native

<?php
require 'vendor/autoload.php';

use Avram\Vokativ\Vokativ;
use Avram\Vokativ\Dictionary\VokativIniDictionary;

$nominativ = 'Filip';
$vokativ = new Vokativ(new VokativIniDictionary());

echo "Vocative case for \"$nominativ\" is: " . $vokativ->make($nominativ) . " (source: " . $vokativ->source() . ")";

You should get output like this:

Vocative case for "Filip" is: Filipe (source: dictionary)

Laravel

This package comes with Laravel service provider and facade to make it easier to use it from any place in your code. Simply open config/app.php file and add this to service provider list:

Avram\Vokativ\Provider\VokativServiceProvider::class,

Then, right below that, in the list of facades, add this:

'Vokativ'   => Avram\Vokativ\Facade\Vokativ::class,

After that, you can use the following code anywhere in your project:

$vokativ = Vokativ::make("Filip");

//or in views
Zdravo {{ Vokativ::make("Filip") }}!

Note: While this library will work fine with most names, it can fail with some. The Laravel facade provides another function, Vokativ::safe("Filip") which will return vocative case only if it's found in the dictionary, and if not it will return nominative case (original string). For such cases you might want to extend the default dictionary, and you can do so by publishing assets from this package:

php artisan vendor:publish

This will copy the dictionary files into storage/avram/vokativ and since the Laravel integraton uses INI file by default, you'll want to edit storage/avram/vokativ/vokativ.ini. The facade will automatically switch to using published dictionary once it's published.

Symfony Bundle

This package comes bundled with a Symfony service and a Twig extension. To enable it, add:

new Avram\Vokativ\VokativBundle\AvramVokativBundle(),

to $bundles array in AppKernel.php. Then, you can use them in your Symfony code:

// in Twig 
Zdravo {{ "Filip"|vokativ }}!
// in controllers
$vokativ = $this->get("avram_vokativ.generator")->make("Filip");

All versions of vokativ with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package avram/vokativ contains the following files

Loading the files please wait ....