我正在使用带有PHP 5.4 Centos 7的cakephp 2.8.3 我正在使用这个KoolSuite第三方PHP UI工具来生成网格,菜单选项卡 但是当我尝试将它包含在我的视图助手中时它没有加载并且在inspect元素控制台中我得到了这个通知: 资源解释为样式表但使用MIME类型text / html传输:“http://cake.cei.org/app/Vendor/KoolSuite/KoolTabs/styles/hay/hay.css”
控制器: 应用程序/控制器/ userscontroller.php
<?php
class UsersController extends AppController
{
var $helpers = array('Form','Kooltabinclude');
public $uses = array('User', 'CurrencyConversion', 'Asset');
public $components = array('ValidateUser');
var $name = 'Users';
public function dashboard(){}
}
?>
查看: 应用/视图/用户/ dashboard.ctp
<?
// Render Kool Tabs using Kooltabinclude helper
echo $this->Kooltabinclude->tab_include("dashboard", "");
?>
助手: 应用/视图/助手/ KooltabincludeHelper.php
<?php
App::uses('AppHelper', 'View/Helper');
class KooltabincludeHelper extends AppHelper
{
function tab_include($tabs, $active_tab, $sub_active_tab = NULL)
{
App::import('Vendor', 'KoolSuite/KoolTabs', array('file' => 'KoolSuite/KoolTabs/kooltabs.php'));
$kts = new KoolTabs("kts");
$koolpath = "Vendor/KoolSuite";
$kts->styleFolder = "$koolpath/KoolTabs/styles/hay";
}
}
?>
.vhost文件:
<VirtualHost *>
DocumentRoot /home/webroot/cake.cei.org/htdocs
ServerName cake.cei.org
<IfModule mod_security.c>
SecRuleEngine Off
SecRuleInheritance Off
SecFilterScanPOST Off
SecRequestBodyAccess Off
</IfModule>
<Directory /home/webroot/cake.cei.org/htdocs>
FileETag MTime Size
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule Vendor(.*) Vendor$1 [L]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
#this is for full functionality in .htaccess. Remove if not needed.
AllowOverride None
</Directory>
<Directory /home/webroot/cake.cei.org/htdocs/app>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
AllowOverride None
</Directory>
<Directory /home/webroot/cake.cei.org/htdocs/app/webroot>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
AllowOverride None
</Directory>
ErrorLog /home/webroot/cake.cei.org/logs/error_log
CustomLog /home/webroot/cake.cei.org/logs/access_log combined
</VirtualHost>