• <legend id='MifQX'><style id='MifQX'><dir id='MifQX'><q id='MifQX'></q></dir></style></legend><tfoot id='MifQX'></tfoot>

    1. <small id='MifQX'></small><noframes id='MifQX'>

        <bdo id='MifQX'></bdo><ul id='MifQX'></ul>

      1. <i id='MifQX'><tr id='MifQX'><dt id='MifQX'><q id='MifQX'><span id='MifQX'><b id='MifQX'><form id='MifQX'><ins id='MifQX'></ins><ul id='MifQX'></ul><sub id='MifQX'></sub></form><legend id='MifQX'></legend><bdo id='MifQX'><pre id='MifQX'><center id='MifQX'></center></pre></bdo></b><th id='MifQX'></th></span></q></dt></tr></i><div id='MifQX'><tfoot id='MifQX'></tfoot><dl id='MifQX'><fieldset id='MifQX'></fieldset></dl></div>

        Laravel 4.2:将 PHP 文件(库)包含到控制器中

        Laravel 4.2: Include a PHP file (library) into controller(Laravel 4.2:将 PHP 文件(库)包含到控制器中)

              <i id='ufJjm'><tr id='ufJjm'><dt id='ufJjm'><q id='ufJjm'><span id='ufJjm'><b id='ufJjm'><form id='ufJjm'><ins id='ufJjm'></ins><ul id='ufJjm'></ul><sub id='ufJjm'></sub></form><legend id='ufJjm'></legend><bdo id='ufJjm'><pre id='ufJjm'><center id='ufJjm'></center></pre></bdo></b><th id='ufJjm'></th></span></q></dt></tr></i><div id='ufJjm'><tfoot id='ufJjm'></tfoot><dl id='ufJjm'><fieldset id='ufJjm'></fieldset></dl></div>
              <tfoot id='ufJjm'></tfoot>
              • <bdo id='ufJjm'></bdo><ul id='ufJjm'></ul>
              • <small id='ufJjm'></small><noframes id='ufJjm'>

                  <tbody id='ufJjm'></tbody>
                1. <legend id='ufJjm'><style id='ufJjm'><dir id='ufJjm'><q id='ufJjm'></q></dir></style></legend>

                  本文介绍了Laravel 4.2:将 PHP 文件(库)包含到控制器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 Laravel 4.2 做一个项目,我需要在控制器中包含一个 PHP 文件(一个将 PDF 转换为文本的库),然后返回一个带有文本的变量,知道怎么做吗?

                  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 text, any idea how?

                  这是我的控制器:

                  public function transform() {
                      include ('includes/vendor/autoload.php');
                  }
                  

                  还有我的 /app/start/global.php 文件:

                  ClassLoader::addDirectories(array(
                      app_path().'/commands',
                      app_path().'/controllers',
                      app_path().'/models',
                      app_path().'/database/seeds',
                      app_path().'/includes',
                  
                  ));
                  

                  这是错误:

                  include(includes/vendor/autoload.php): failed to open stream: No such file or directory
                  

                  推荐答案

                  我认为你是对的兄弟,但是,我找到了另一种方法,也许不是正确的方法,但它有效.

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

                  就是这样,我创建了一个名为 Includes 的新文件夹并将我的文件放在那里,然后在/app/start/global.php 中添加了这一行:

                  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';
                  

                  现在正在工作:D

                  这篇关于Laravel 4.2:将 PHP 文件(库)包含到控制器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                        <tbody id='hL5UL'></tbody>

                      <tfoot id='hL5UL'></tfoot>
                      • <bdo id='hL5UL'></bdo><ul id='hL5UL'></ul>
                        1. <i id='hL5UL'><tr id='hL5UL'><dt id='hL5UL'><q id='hL5UL'><span id='hL5UL'><b id='hL5UL'><form id='hL5UL'><ins id='hL5UL'></ins><ul id='hL5UL'></ul><sub id='hL5UL'></sub></form><legend id='hL5UL'></legend><bdo id='hL5UL'><pre id='hL5UL'><center id='hL5UL'></center></pre></bdo></b><th id='hL5UL'></th></span></q></dt></tr></i><div id='hL5UL'><tfoot id='hL5UL'></tfoot><dl id='hL5UL'><fieldset id='hL5UL'></fieldset></dl></div>

                          1. <small id='hL5UL'></small><noframes id='hL5UL'>

                            <legend id='hL5UL'><style id='hL5UL'><dir id='hL5UL'><q id='hL5UL'></q></dir></style></legend>