2012-02-26 72 views
0

我把这些代码放在我的主题文件“index.php”中 我的php版本是5.3.8 已经把.htaccess文件夹装到wordpress文件夹和options-permalink关闭了。如何让wordpress使用苗条框架?

的.htaccess

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php [QSA,L] 

的index.php

<?php get_header(); ?> 
<?php 
$app = new Slim(); 
$app->get('/', function ($test) { 
    echo "hello"; 
}); 
$app->run(); 
?> 
<?php get_footer(); ?> 

我运行这段代码,页面是空白 和铬控制台显示505错误

+0

什么是结合两者的目的是什么?另外,当涉及到路线和路线处理时,会不会有顾虑? – therons 2013-03-30 03:01:42

+0

也许做一些backbone.js或ajax调用? – 2013-06-13 00:32:44

回答

1

尝试移动get_header()get_footer()调用app-> get函数。所以,你的index.php文件应该是这样的......

<?php 
require "Slim/Slim.php"; 
$app = new Slim(); 

$app->get('/', function() {  
    get_header(); 
    echo "hello"; 
    get_footer(); 
}); 

$app->run(); 
?>