2017 © Pedro Peláez
 

library persian-tools-bundle

Persian Tools for Symfony 2

image

intuxicated/persian-tools-bundle

Persian Tools for Symfony 2

  • Tuesday, February 16, 2016
  • by intuxicated
  • Repository
  • 4 Watchers
  • 10 Stars
  • 250 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

sfPersianTools

Persian tools for Symfony framework., (*1)

knpbundles.com, (*2)

ohloh.com, (*3)

Installation

Download PersianToolsBundle using composer

Add PersianToolsBundle in your composer.json, (*4)

{
    "require": {
        "intuxicated/persian-tools-bundle": "dev-master"
    }
}

Now tell composer to download the bundle by running the command, (*5)

$ php composer.phar update intuxicated/persian-tools-bundle

Enable the bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Intuxicated\PersianToolsBundle\PersianToolsBundle(),
    );
}

Twig Filters


{{ '1364509205'|pdate }} {# result: 1392-01-09 #} {{ '1364509205'|pdate('Y-m-d H:i:s') }} {# result: 1392-01-09 02:50:05 #} {{ '123456789'|pnumber }} {# result: ۱۲۳۴۵۶۷۸۹ #} {{ 'ملك عربي'|pletter }} {# result: 'ملک عربی'#}

Twig Functions

pdate, (*6)

pstrftime, (*7)

pmktime, (*8)

pcheckdate, (*9)

pgetdate, (*10)

DayOfYear return past days of the year, (*11)

isKabise return true if year is intercalary, (*12)

pnumber convert English/Arabic numbers to Persian numbers, (*13)

pletter convert Arabic letters to Persian Letters, (*14)

Controller Functions

You can use all twig functions in controller. just simply load persian_tools service :, (*15)

$pt = $this->get('persian_tools');

// example
echo $pt->pnumber('123456');

License

https://github.com/intuxicated/sfPersianToolsBundle/blob/master/LICENSE, (*16)

The Versions

16/02 2016

dev-master

9999999-dev http://intuxicated.ir

Persian Tools for Symfony 2

  Sources   Download

MIT

The Requires

 

by Mohammad Niknam

tools persian persian number persian tools pdate