2017 © Pedro Peláez
 

library rapture-helper

Rapture helper component

image

iuliann/rapture-helper

Rapture helper component

  • Sunday, July 9, 2017
  • by iuliann
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 46 % Grown

The README.md

Rapture Helper component

PhpVersion License, (*1)

Rapture Helper has multiple classes for helping with common tasks like: - Arrays manipulation - Strings manipulation - Country codes - Frontend assets collection - Time/Date - Render HTML elements - Locale setup for Gettext, (*2)

Requirements

  • PHP v7.0

Install

composer require mrjulio/rapture-helper

Quick start

# Assets
$assets = new Assets();
$assets->add(['styles' => 'css/main.css', 'script' => ['js/jquery.js', 'js/main.js']]);
$assets->renderCss();
// <link rel="stylesheet" type="text/css" href="/assets/css/main.css" />
$assets->renderJs();
// 
// 

# Time
$t = Time::now();
// getters
$t->getYear();          // .. $t->getSecond()
$t->getDayOfWeek();     // 1=Monday...7=Sunday
$t->getDayOfYear();     // 0 through 365
$t->getWeekOfYear();    // ISO-8601 week number of year, weeks starting on Monday
$t->getDaysInMonth();   // 28..31
$t->getQuarter();       // 1..4
// checks
$t->isWeekend();
$t->isWeekday();
$t->isToday();
$t->isYesterday();
$t->isTomorrow();
$t->isNextWeek();
$t->isLastMonth();  
$t->isCurrentYear();    //etc..
// modifiers start with 'go'
$t = Time::go()->goBack('1 day')->goToNext(Time::MONDAY)->goToStartOf(Time::DAY);
// format
$t->toDate(); // Y-m-d
$t->toTime(); // H:i:s
$t->toDateTime(): // Y-m-d H:i:s

# Strings
$enc  = Strings::encrypt('secret', 'secret-key');   // not for production
$dec  = Strings::decrypt($enc, 'secret-key');
$slug = Strings::sluggify('Hello world!'); // hello-world

About

Author

Iulian N. rapture@iuliann.ro, (*3)

Testing

cd ./test && phpunit

License

Rapture Helper is licensed under the MIT License - see the LICENSE file for details., (*4)

The Versions

09/07 2017

dev-master

9999999-dev http://rapture.iuliann.ro

Rapture helper component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library

09/07 2017

v1.0.1

1.0.1.0 http://rapture.iuliann.ro

Rapture helper component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library

15/06 2017

v1.0

1.0.0.0 http://rapture.iuliann.ro

Rapture helper component

  Sources   Download

MIT

The Requires

  • php >=7.0.4

 

library