Laravel 4.2: Include a PHP file (library) into controller

前端 未结 2 895
名媛妹妹
名媛妹妹 2020-12-15 10:57

I\'m doing a project using Laravel 4.2 where I need to include a PHP file (a library to transform a PDF into Text) into the controller, and then return a variable with the t

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-15 11:22

    I think you're right bro, but, i find another way, maybe not the right way, but it works.

    Is like this, I created a new folder called Includes and put my files in there, then in the /app/start/global.php i added this line:

    require app_path().'/includes/vendor/autoload.php';
    

    And now is working :D

提交回复
热议问题