php找不到对象怎么办,找不到对象!在Fuel php中重定向路由之后

下面是我的fuelphp项目的目录结构

>燃料

>日志

>公众

> tmp

在公共文件夹中我有

>资产

> index.php

当我点击基本URL以外的任何URL时,它会抛出以下错误

找不到对象错误

这是我的登录代码

public function action_index(){

$html = new Template();

if(Session::get("logged_in")){

Response::redirect('/test-newsletter');

exit(0);

}

// die("in ifss");

if(Input::post()){

$username = Input::post('username','');

$password = Input::post('password','');

if($username === "username" && $password === "password") {

Session::set('logged_in', true);

Response::redirect('/test-newsletter');

}else{

$html->assign('message','Wrong username or password');

}

}

return $html->fetch('login.tpl');

}

这是我的routes.php

return array(

"_root_" => "default/index",

"logout" => "default/logout",

"_404_" => "default/404",

"time" => "default/time",

"test" => "default/test",

"birthdays" => "backstage/birthdays",

"earned-status" => "backstage/earned_status",

"nearly-new-status" => "backstage/nearly_new_status",

"placed-order" => "backstage/placed_order",

"user-history" => "backstage/user_history",

"test-newsletter" => "backstage/test_newsletter",

"preview-email" => "backstage/preview_email",

"view-email/:id" => "backstage/view_email",

"api/set-date" => "backstage/api_set_date"

);

这是Backstage控制器test_newsletter函数

public function action_test_newsletter(){

die("here");

$submitted = Input::post("submit", false);

$points = Input::post("points", "");

$email = Input::post("email", "");

$type = Input::post("type", "");

$html = new Template();

$html->assign("points", $points);

$html->assign("email", $email);

$html->assign("type", $type);

$html->assign("message", "");

if($submitted){

$testService = new TestService(trim($type), trim($email), trim($points));

if($testService->isValid()){

$testService->processEmail();

$html->assign("message", "Email Sent!");

}else{

$html->assign("message", $testService->getErrorMesssage());

}

}

return $html->fetch("test_newsletter.tpl");

}

但登录后它不会转到test_newsletter,而是显示我找不到Object错误.

**我已经读过,我们需要在项目的某处放置.htaccess,但我不清楚.可以指导我**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值