Add Include File

Post Reply
thomas
User
Posts: 131

Add Include File

Post by thomas »

It will be nice to have a option in the PHPMaker itself to add a include file
As I use to create many project but I have a common function which I have created and want to use on all the project. For this I can include the file from the server script but whenever I change something on the code I have to copy it on all the project again. sometime i forgot for some project.

So if there is a option to include a file just like the Template file option on the Generate Page
Then we can keep the common file in single folder and it can be included on all the project easily.


arbei
User
Posts: 9384

Post by arbei »

You may include your file by server side Global Code, e.g.

include  __DIR__ . "/../myfolder/myfile.php"; // Assume the "myfolder" folder is under the project folder directly

Then your code will be under the project namespace, you do not need to use \ when using your functions or classes.


thomas
User
Posts: 131

Post by thomas »

This is to insert to a particular project only.
I mean where I can use for every project just like selecting Template while Generating the code.


arbei
User
Posts: 9384

Post by arbei »

You may create an extension so you can select it for any project easily, see Extensions -> Making Extensions.


Post Reply