Welcome Guest, Not a member yet? Register   Sign In
Preventing DRY in OOP
#13

[eluser]InsiteFX[/eluser]
Registry_helper

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ------------------------------------------------------------------------
* Created by Php Designer 8.
* Date  : 10/20/2013
* Time  : 11:29:08 AM
* Author: Raymond L King Sr.
* The Learn CodeIgniter Development Team.
*
* Helper registry_helper
*
* ------------------------------------------------------------------------
* To change this template use File | Settings | File Templates.
* ------------------------------------------------------------------------
*/

// ------------------------------------------------------------------------

/**
* reg_set()
*
* Sets a new property.
*
* Usage: reg_set($index, $key, $val);
*
* @access public
* @param array
* @return mixed depends on what the array contains
*/
if ( ! function_exists('reg_set'))
{
function reg_set($index = '', $key = '', $val = '')
{
        $_ci = get_instance();
  $_ci->registry->set($index, $key, $val);
}
}

// ------------------------------------------------------------------------

/**
* reg_get()
*
* Gets a registry value.
*
* Usage: $result = reg_get($index, $key);
*
* @access public
* @param array
* @return mixed depends on what the array contains
*/
if ( ! function_exists('reg_get'))
{
function reg_get($index = '', $key = '')
{
        $_ci = get_instance();
  return $_ci->registry->get($index, $key);
}
}

// ------------------------------------------------------------------------

/**
* reg_get_index()
*
* Get a registry index.
*
* Usage: $result = reg_get_index($index);
*
* @access public
* @param array
* @return mixed depends on what the array contains
*/
if ( ! function_exists('reg_get_index'))
{
function reg_get_index($index = NULL)
{
        $_ci = get_instance();
  return $_ci->registry->get_index($index);
}
}

// ------------------------------------------------------------------------

/**
* reg_exists()
*
* Checks to see if a registry index and key exists.
*
* Usage: $result = reg_exists($index, $key);
*
* @access public
* @param array
* @return mixed depends on what the array contains
*/
if ( ! function_exists('reg_exists'))
{
function reg_exists($index = '', $key = '')
{
        $_ci = get_instance();
  return $_ci->registry->exists($index, $key);
}
}

// ------------------------------------------------------------------------

/**
* reg_delete()
*
* Deletes a registry index and key.
*
* Usage: $reult = reg_delete($index, $key);
*
* @access public
* @param array
* @return mixed depends on what the array contains
*/
if ( ! function_exists('reg_delete'))
{
function reg_delete($index = '', $key = '')
{
        $_ci = get_instance();
  return $_ci->registry->delete($index, $key);
}
}

// ------------------------------------------------------------------------

/**
* reg_clear()
*
* Resets and clears out the registry arrays.
*
* Usage: reg_clear();
*
* @access public
* @param array
* @return mixed depends on what the array contains
*/
if ( ! function_exists('reg_clear'))
{
function reg_clear()
{
        $_ci = get_instance();
  $_ci->registry->clear();
}
}


/**
* ------------------------------------------------------------------------
* Filename: registry_helper.php
* Location: ./application/helpers/registry_helper.php
* ------------------------------------------------------------------------
*/

Enjoy


Messages In This Thread
Preventing DRY in OOP - by El Forum - 01-09-2014, 05:44 AM
Preventing DRY in OOP - by El Forum - 01-09-2014, 10:01 AM
Preventing DRY in OOP - by El Forum - 01-09-2014, 10:33 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 01:41 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 05:22 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 10:11 AM
Preventing DRY in OOP - by El Forum - 01-10-2014, 02:12 PM
Preventing DRY in OOP - by El Forum - 01-11-2014, 05:12 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 05:44 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 05:54 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:09 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:10 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:13 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:17 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:29 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:33 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 07:49 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 07:51 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 07:54 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 09:16 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 09:58 AM
Preventing DRY in OOP - by El Forum - 01-11-2014, 06:09 PM
Preventing DRY in OOP - by El Forum - 01-12-2014, 05:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB