Better way of importing libraries into a class

38
February 12, 2019, at 9:20 PM

I have developed an external module within an existing application. I want to make this module more or less reusable. This module requires 6 classes/constants from my existing application. I can try to import those via the parent class in my module I.e. ‘$module = new myModile($class1, $class2, $class3, $constant1...)’

But, definition will be very length and my module has quite few files and I will have to have some way of distributing specified classes between other files.

So, the question is, is there a better way to achieve what I am after? I also have those same definitions inside the application, so it may feel odd having to redefine them inside the module.

READ ALSO
CraftCMS - CraftQL querying globals always returns error

CraftCMS - CraftQL querying globals always returns error

When querying globals from the GraphiQl interface, from my frontend application, or from an API explorer like Insomnia, CraftQL returns an error Trying to get property of non-object

34
Sending email over SMTP with sendgrid

Sending email over SMTP with sendgrid

I have a html fieldset and a short php file for sending an email via sendgrid when the submit button is clicked

25
bulk insert working in ssms but not working while executing from php

bulk insert working in ssms but not working while executing from php

I'm trying to insert the data from a text file into my databaseI'm using SQL Server Management Studio 17

36