Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
create new package from existing file
  • Hi, i have a php file that contains some functions, this functions will be called from other functions or from my application:

    jdf.php :

    funcrion one(){ ... }

    function two(){
    ...
    one();
    ...
    }

    ...

    how i can create a package for use this?
  • What do you mean by "package"?

    If these are global functions, and only a few small ones, you can add them to your APP bootstrap. If it's a large(r) file, place it in APPPATH/vendor, and include if from your APP bootstrap.
  • No it is small and just collection of functions to convert Georgian/Persian DateTimes, can you guide me (or gime me a code :P) please how i must add that file into APP bootstrap?
  • HarroHarro
    Accepted Answer
    If it's small, just copy them into your APPPATH/bootstrap.php, at the bottom. Then they will be available in your app and in Oil.

    If you want to keep it a seperate file, place that file in APPPATH/vendor, and use "include" in your app bootstrap to load it.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion