Welcome Guest, Not a member yet? Register   Sign In
Hi, need definined a service to work to use from helpers functions
#3

(This post was last modified: 01-26-2021, 10:02 PM by yuma2020.)

(01-26-2021, 09:55 PM)InsiteFX Wrote: You can load any of CodeIgniter 4 libraries in a help by calling there service.

Example:

PHP Code:
$request Services::request();
$uri     $request->uri

You can load a help within a help.

Example:

PHP Code:
helper('text'); 

If it is a custom libraries just create a service for it or autoload it in the autoloader.

Great now if I like to make a call to a default library now, how to call a custom library created by me in the folder "Libreries"?

Please community, need call a primitive library custom not is default.
PHP Code:
<?PHP
namespace App\Libraries;
/**
 * Common - A helper class to process Common strings.
 *
 * @author Villalba Juan Manuel - https://www.hexomedesarrollos.com/
 * Date: sunday 24/01/2021
 *
 */
class CommonLibrary
{
    public function get_PortfolioCategory()
    {
        // start script
        $portfolio getTable('portfolio_category');
        return $portfolio;
    }

    public function  check_CategoryPortfolio()
    {
     
// some flow data ...
    }


Reply


Messages In This Thread
RE: Hi, need definined a service to work to use from helpers functions - by yuma2020 - 01-26-2021, 09:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB