2017 © Pedro Peláez
 

library helpers

Common helpers

image

tazzy/helpers

Common helpers

  • Tuesday, October 17, 2017
  • by tawazz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Tazzy-Helpers

php helper functions for common tasks ranging from database , file handling, validation,emails,hashing, tokens and sessions, (*1)

Using Tazzy-Helpers

  • To use Tazzy-Helpers in your project:, (*2)

    • include "Tazzy-Helpers/autoload.php";
  • Database accesss:, (*3)

  • create secrets.php file
  • add config
$GLOBALS['config'] = [
  'db'        => [
      'driver'   => 'mysql',
      'host'     => 'localhost',
      'username' => 'root',
      'password' => 'secret',
      'db'       => 'database',
      'prefix'   => ''
  ]
];
* edit the config file to set your database config settings. Note Database uses PDO
  • There is two ways to use the database helpers, one way is to use the querybuilder class which uses php code to create sql queries and the other way is to inherit the Table class to use it on your models for a basic ORM

DB usage

  • Raw queries
  $users = DB::getInstance()->query('Select * from users');
  if(!$users->count()){
      echo 'no such user found';
  }else{
    foreach($users->result() as $user){
        echo $user->username;
    }
  }
  • Insert into Database
$insert = DB::getInstance()-> insert('users',array(
  'firstname'=> 'john',
  'lastname'=> 'doe',
));
  • Update
$update = DB::getInstance()->update('users',array('id','=', '1'),array(
   'firstname'=> 'alex'
 ));

The Versions

17/10 2017

dev-master

9999999-dev https://github.com/tawazz/Tazzy-Helpers

Common helpers

  Sources   Download

MIT

The Requires

  • php >=7.0

 

helpers utils

16/11 2015

dev-dev

dev-dev

  Sources   Download

16/08 2015

dev-labs

dev-labs

  Sources   Download