Welcome Guest, Not a member yet? Register   Sign In
Defining extra constants CI 4
#2

(This post was last modified: 03-29-2020, 06:29 AM by jreklund.)

@ZoeF

There must be numerous ways to achieve the task of having your own constants.

The way I do it is to create a Super Class and for all your Classes to inherit the super Class:

Code:
<?php
// CI_VERSION 4.??
Class My_SuperClass extends CI_Controller
{
  define('CONST_001', 'CONST_001');
  define('CONST_002', 'CONST_002');
  define('CONST_003', 'CONST_003');
}// endclass

Class blog extends  {
  // all constants will be available here
}// endclass
Reply


Messages In This Thread
Defining extra constants CI 4 - by ZoeF - 03-28-2020, 05:25 PM
RE: Defining extra constants CI 4 - by John_Betong - 03-28-2020, 11:31 PM
RE: Defining extra constants CI 4 - by ZoeF - 03-29-2020, 05:06 AM
RE: Defining extra constants CI 4 - by InsiteFX - 03-29-2020, 07:46 AM
RE: Defining extra constants CI 4 - by kilishan - 03-30-2020, 11:21 AM
RE: Defining extra constants CI 4 - by ramonpuig - 04-27-2024, 09:44 AM
RE: Defining extra constants CI 4 - by luckmoshy - 04-27-2024, 10:47 PM
RE: Defining extra constants CI 4 - by InsiteFX - 04-27-2024, 10:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB