mab741 2012-07-30 18:01:06 4269次浏览 14条回复 0 0 0

http://210.51.11.96/blog/index.php 看这个网址,点搜索,应该出机票的列表,可是根本到不了那页,老是回首页。

  • 回复于 2012-07-30 19:01 举报

    Debug一下,看看到哪儿怎么执行的~

  • 回复于 2012-07-30 19:30 举报
    <?php
    // uncomment the following to define a path alias
    // Yii::setPathOfAlias('local','path/to/local-folder');
    
    // This is the main Web application configuration. Any writable
    // CWebApplication properties can be configured here.
    return array(
    	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    	'name'=>'JPS_机票频道',
    
    	// preloading 'log' component
    	'preload'=>array('log'),
    
    	// autoloading model and component classes
    	'import'=>array(
    		'application.models.*',
    		'application.components.*',
    	),
    
    	'defaultController'=>'Index',
    
    	// application components
    	'components'=>array(
    		'user'=>array(
    			// enable cookie-based authentication
    			'allowAutoLogin'=>true,
    		),
    		'smarty'=>array(
    			'class'=>'application.extensions.CSmarty',
    		),
    		/*'db'=>array(
    			'connectionString' => 'sqlite:protected/data/blog.db',
    			'tablePrefix' => 'tbl_',
    		),*/
    		// uncomment the following to use a MySQL database
    		//数据库连接MYSQL
    		'db'=>array(
    			'connectionString' => 'mysql:host=localhost;dbname=jps',
    			'emulatePrepare' => true,
    			'username' => 'root',
    			'password' => '123456',
    			'charset' => 'utf8',
    			'tablePrefix' => 'tpl_',
    		),
    				//错误提示页
    		'errorHandler'=>array(
    			// use 'site/error' action to display errors
                'errorAction'=>'index/error',
            ),
    		//路由跳转
            'urlManager'=>array(
            	'urlFormat'=>'path',
            	'rules'=>array(
            		'post/<id:\d+>/<title:.*?>'=>'post/view',//可以删除
            		'posts/<tag:.*?>'=>'post/index',//可以删除
            		'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            	),
            ),
    		'log'=>array(
    			'class'=>'CLogRouter',
    			'routes'=>array(
    				array(
    					'class'=>'CFileLogRoute',
    					'levels'=>'error, warning',
    				),
    				// uncomment the following to show log messages on web pages
    				/*
    				array(
    					'class'=>'CWebLogRoute',
    				),
    				*/
    			),
    		),
    	),
    
    	// application-level parameters that can be accessed
    	// using Yii::app()->params['paramName']
    	'params'=>require(dirname(__FILE__).'/params.php'),
    );
    

    Debug放那呀

  • 回复于 2012-07-30 20:28 举报

    不知道为什么,除了首页别的页面全找不开呀

  • 回复于 2012-07-30 20:59 举报

    view和controller的代码贴出来看看撒

  • 回复于 2012-07-30 21:05 举报

    我先下了一个YII框架,里边有测试内容全不能正常显示

  • 回复于 2012-07-30 21:06 举报

    只可以打开首页二级页面打不开,

  • 回复于 2012-07-30 21:22 举报

    是不是Apache的rewrite规则写的不对?

  • 回复于 2012-07-31 07:15 举报

    不知道和APC扩展有没有关系,服务器没有上这个扩展,用的不是Apache 是nginx

  • 回复于 2012-07-31 07:48 举报

    'defaultController'=>'Index',
    你的默认控制器是index吗?我想看一下IndexController.php这个文件的内容。

  • 回复于 2012-07-31 09:30 举报
    header("content-Type: text/html; charset=gb2312");
    class IndexController extends Controller {       
             public function init(){
             	$smarty = Yii::app()->smarty;
             	$baseUrl = Yii::app()->request->hostInfo.Yii::app()->baseUrl.'/';
             	$smarty->assign('baseUrl',$baseUrl);
             }
             
              public function actionIndex(){
                  $smarty = Yii::app()->smarty;
                  $airport = Airport::model()->findAll();
                  $smarty->assign('airlines',$airlines);
                  $smarty->display('flight/flight_search.html');
                  
              }
               public function actionList(){
    	    $airport = Airport::model()->findAll();
                    $smarty->assign('agoDepartureDate',date('Y-m-j',strtotime($_REQUEST['DepartureDate'])-(1*24*3600)));
                    $smarty->assign('backDepartureCity',date('Y-m-j',strtotime($_REQUEST['DepartureDate'])+(1*24*3600)));
                    $smarty->assign('ArrivalCity',$_POST['ArrivalCity']);
                    $smarty->assign('airport',$airport);
                    $smarty->assign('val',intval($_REQUEST['val']));
                    $smarty->assign('time',intval($_REQUEST['time']));
                    $smarty->assign('filter',$flight['filter']);
                    $smarty->assign('flight_list',$flight['list']);
                    $smarty->assign('carrier',$flight['carrier']);
                    $smarty->assign('count',  count($flight['list']));
                  }else{
                    $smarty->assign('No_resault',1);
                  }
                  $smarty->display('flight/flight_list.html');
              }
         }
    
  • 回复于 2012-07-31 09:31 举报

    现在是BLOG的二级页面也不能正常显示

  • 回复于 2012-07-31 09:35 举报

    就是我新下了一个YII框架解压了放上去,二级页面也不能正常显示

  • 回复于 2012-07-31 10:46 举报

    http://210.51.11.96/yii/demos/blog/index.php 看看这,这就是新传的地址。

  • 回复于 2012-07-31 11:17 举报
    //路由跳转
           /* 
    'urlManager'=>array(
    	'urlFormat'=>'path',
    	'rules'=>array(
    		'post/<id:\d+>/<title:.*?>'=>'post/view',//可以删除
    		'posts/<tag:.*?>'=>'post/index',//可以删除
    		'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
    ),
    ),*/ 
    

    这样就没有问题了,

您需要登录后才可以回复。登录 | 立即注册