We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to use files that have only php functions in phalcon?

How to use files that have only php functions in phalcon?

I tried to register in my module with the example available in the phalcon documentation

// Register some files

$ loader-> registerFiles (

[

    'functions.php',

]

);

But I did not succeed. The php file is in the library folder.

The project has the following folder structure:

--- Apps

---- / Backend

-------------- / controller

-------------- / views

-------------- / models

-------------- / Module.php

-------------- / library / funcoes.inc.php

--- public

-------- etc......

I just include them like the vendor/autoloader for composer. standard PHP

Loader is required for class, namespaces loading as defined in https://www.php-fig.org/psr/psr-4/. If you want to load some specific function, you should include it manually as Trent Ramseyer said.