PHP code example of adcog-cpi / translation-bundle
1. Go to this page and download the library: Download adcog-cpi/translation-bundle 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/ */
adcog-cpi / translation-bundle example snippets
// SomeController.php
/** @var EB\TranslationBundle\Translation $translation */
$translation = $this->get('eb_translation');
// <a href="/" title="Home page title">Home page name</a>
$translation->link('home');
// <a href="/page-1" title="Home page title">Home page name</a>
$translation->link('home',{'page':1});
// <a href="/" title="Home page title">something</a>
$translation->link('home',{},{'name':'something'});
// <a href="/" title="something">Home page name</a>
$translation->link('home',{},{'title':'something'});
// <a href="/" title="Home page title" class="something">Home page name</a>
$translation->link('home',{},{'class':'something'});
// Home page name
$translation->name('home');
// Home page title
$translation->title('home');
// Home page description
$translation->description('home');