【问题标题】:Configuration issues extjs6 in laravel5.3 project?laravel5.3 项目中的 extjs6 配置问题?
【发布时间】:2017-01-21 03:33:13
【问题描述】:

我成功创建了 laravel5.3 应用程序。这是一个简单的登录应用程序。 最初我为应用程序使用刀片模板,后来我使用 extjs4

现在我想使用 extjs6。 0.

我遇到了以下问题。

我在 Laravel 公共文件夹中创建了 ExtJS 应用程序。 并从路由中加载索引页面。

在 laravel 路由中:

Route::get('/extshow', function(){
    return View::make('extjspage');
});

Extjspage.php

  <!-- The line below must be kept intact for Sencha Cmd to build your application -->
    <script id="microloader" data-app="feecee0f-b576-4366-967e-78fffdbb1023" type="text/javascript" src="../myapps/see/myapp6/bootstrap.js"></script>

来自浏览器:localhost/extshow

错误:

localhost 指向 /public 目录

如果我在 localhost 上更改 /see/myapp6/ 那么它可以工作,但是,它将成为 laravel 最初加载和路由的问题。

在上述情况下如何使用 laravel 加载 extjs6 索引?

我的 apache 配置是这样的:

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/simple-laravel-login-authentication-master/public
<Directory /var/www/html/simple-laravel-login-authentication-master/public>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
</Directory>

并在 /public/myapp6 中创建了 ExtJS 应用程序。

从 PHP 加载 ExtJS 时。

由于/myapp6 路径丢失,文件没有得到,那么如何以正确的方式引用这些文件?

【问题讨论】:

  • 当你点击它时读取的错误是什么你应该通过 src="/anysubfolder_inside_public/filename.js" 引用你的js
  • 找不到文件,如果我点击错误链接
  • 您在视图中没有正确引用文件。如果文件名是 main.js,那么您放在公共目录中的任何内容都可以访问,您想在 html 中将其引用为 src="/main.js"
  • 是的,这些是可访问的,创建 Sencha 应用程序中的唯一问题,在哪里设置我的自定义路径以正确方式访问文件。
  • 一般来说,Sencha 应用程序可以访问所有文件以创建应用程序文件夹,在我的情况下,它在 myapp6/ 之后尝试访问

标签: php apache laravel extjs


【解决方案1】:

首先使用 sencha 命令创建一个独立的 ExtJS 应用程序。 创建应用程序后,只需复制所有创建的文件夹并将它们粘贴到公共 laravel 文件夹中。然后我们可以从 php 加载 extjs 应用程序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-14
    • 1970-01-01
    • 2018-12-24
    • 1970-01-01
    • 2011-10-07
    • 2020-11-23
    相关资源
    最近更新 更多