试图获取非对象的属性(查看:C:\ xampp \ htdocs \ wys \ wys \ app \ views \ index \ index.blade.php

时间:2015-01-19 10:52:47

标签: php laravel-4

ErrorException (E_UNKNOWN)

尝试获取非对象(View: C:\xampp\htdocs\wys\wys\app\views\index\index.blade.php)

的属性
http://Illuminate\View\Engines\CompilerEngine handleViewException
…\bootstrap\compiled.php9881 

错误代码

$this->handleViewException($e, $obLevel);

Controller.php这样

public function editnewsandevents($ neid)     {        $ newsevents = ForumNewsevent :: find($ neid);

return View::make('editnewsandevents.editnewsandevents')
->with('newsevents',$newsevents);

}

public function update(){

$validation = Validator::make(Input::all(), array(
            'neh'=>'required|min:2',
        'neb'=>'required|min:5',
    )
); 
if($validation->fails()) {

    return Redirect::back()->withInput()
    ->withErrors($validation);
} else {

         $user   = Auth:: ForumNewsevent()->neid;
        //$newsevents = Input::get('neid');
    $nheader = Input::get('neh');
    $nbody=  Input::get('neb');
  ForumNewsevent::where('neid', $user)
    ->update(array(
        'nheader'    =>  $nheader,
        'nbody' =>  $nbody

    ));
    return Redirect::route('addnewsandevents')->with
           ('success','you updated sucessfully.');
}  

如何解决这个问题?

$user   = Auth:: ForumNewsevent()->neid;// in this code 

在routes.php页面im中使用not Auth ...其前缀/ editnewsandevents。我认为这行代码是错误的

可以更正此代码吗

0 个答案:

没有答案