We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Why are Actions called with a default constructor parameter of 0?

Development and Programming

Michael Rog's avatar
Michael Rog
179 posts
14 years ago
Michael Rog's avatar Michael Rog

In /system/expressionengine/libraries/Actions.php, around line 185, Actions are called using a default parameter of 0:

// Instantiate the class/method
$ACT = new $class(0);

Curiously… Why? Is it specifically to keep classes requiring a constructor parameter from loading in/as Actions?

       
Bhashkar Yadav's avatar
Bhashkar Yadav
727 posts
14 years ago
Bhashkar Yadav's avatar Bhashkar Yadav

Here the $class is a variable for the class name and class object is being instantiated dynamically. I think, this is used to avoid the error of mismatch parameters passed into contructor of that class.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.