1283 Posts
Bucklash
7 years ago
Topic

Hi foks

I have a beforeStore field in action and an afterStore field in action.

They both call the same file, with which I use to call my class and methods....

The methods used depend upon after or before event, so I am checking more or less like this:

if (class_exists('plgCCK_FieldCode_BeforeStore'))
{
  $beforeStore = 1;
  $afterStore = 0;
}
if (class_exists('plgCCK_FieldCode_AfterStore'))
{
  $beforeStore = 0;
  $afterStore = 1;
}






Any better or preferred ways to do this?

Jon

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
1
Level 1

You could use get_class($this) .

1283 Posts
Bucklash
7 years ago
0
Level 2

Hi Klas

Experimenting away I see that all three are called when rendering:

plgCCK_FieldCode_BeforeRender

plgCCK_FieldCode_BeforeStore

plgCCK_FieldCode_AfterStore

Not what I am looking for... 

And I am not sure on get_class($this) for my situation so will mark as solved :)

Get a VIP membership