| | |
| | | <?php
|
| | | class IndexController extends Yaf_Controller_Abstract{
|
| | | public function indexAction(){
|
| | | //$this->_view->word = "hello world";
|
| | | $message = 'hello';
|
| | | $example = function ($data) use ($message){
|
| | | return "{$data},{$message}";
|
| | | };
|
| | | |
| | | echo $example('world');
|
| | | //or
|
| | | //$this->getView()->word = "hello world";
|
| | | $this->redirect('/user_login.html');
|
| | | }
|
| | | } |
| | |
| | | else{ |
| | | exit($this->showSuccess('登录成功', true)); |
| | | } |
| | | } |
| | | } |
| | | else{ |
| | | $session = Yaf_Session::getInstance(); |
| | | if(isset($session['user'])){ |
| | | $this->redirect('/admin/index/index'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |