本文介绍了CakePHP的JsController找不到。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图从Web根目录访问JavaScript文件,我得到以下错误:

When trying to access Javascript files from the webroot, I get the following error:

Missing Controller
Error:

JsController could not be found.
Error:

Create the class JsController below in file: app\Controller\JsController.php

<?php
  class JsController extends AppController {

  }
?>

我运行没有.htaccess文件。下面是我的配置:

I'm running without .htaccess files. Here is my configuration:

Listen 9090

<Directory "c:/wamp/apscmdb/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride none

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1

</Directory>

<VirtualHost *:9090>
    DocumentRoot "c:\wamp\apscmdb"

    <Directory "c:/wamp/apscmdb/">
            RewriteEngine On
            RewriteBase /app/webroot
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ index.php [QSA,L]

    </Directory>


</VirtualHost>

我想下面的code:
回声$这个 - &GT;&HTML的GT;脚本('门户');

,输出:
&LT;脚本类型=文/ JavaScript的SRC =/ JS / portal.js&GT;&LT; / SCRIPT&GT;

我发现这个听起来相似,但没有解决方案已提供:

I found this that sounds similar, but no solution has been provided:Error: JsController could not be found

推荐答案

解决方案:


  1. 或者使用.htaccess文件

  2. 或修改HTML辅助输出适合Webroot公司网址

这篇关于CakePHP的JsController找不到。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 10:37