10/10/2018, 00:01 
               
            cho hỏi về lập trình trong zend
               
					trong zend mình thấy có một lớp như sau: 
class Zend_Controller_Front
{
/**
* Base URL
* @var string
*/
protected $_baseUrl = null;
/**
* Directory|ies where controllers are stored
*
* @var string|array
*/
protected $_controllerDir = null;
/**
* Instance of Zend_Controller_Dispatcher_Interface
* @var Zend_Controller_Dispatcher_Interface
*/
protected $_dispatcher = null;
/**
* Singleton instance
*
* Marked only as protected to allow extension of the class. To extend,
* simply override {@link getInstance()}.
*
* @var Zend_Controller_Front
*/
protected static $_instance = null;
....................
.....................
}
mình thấy khi khai báo protected $_dispatcher thì tại sao $_dispatcher lại là một đối tượng của lớp Zend_Controller_Dispatcher_Interface , thông thường phải khai báo là $_dispatcher =new Zend_Controller_Dispatcher_Interface() . help me !
            
         class Zend_Controller_Front
{
/**
* Base URL
* @var string
*/
protected $_baseUrl = null;
/**
* Directory|ies where controllers are stored
*
* @var string|array
*/
protected $_controllerDir = null;
/**
* Instance of Zend_Controller_Dispatcher_Interface
* @var Zend_Controller_Dispatcher_Interface
*/
protected $_dispatcher = null;
/**
* Singleton instance
*
* Marked only as protected to allow extension of the class. To extend,
* simply override {@link getInstance()}.
*
* @var Zend_Controller_Front
*/
protected static $_instance = null;
....................
.....................
}
mình thấy khi khai báo protected $_dispatcher thì tại sao $_dispatcher lại là một đối tượng của lớp Zend_Controller_Dispatcher_Interface , thông thường phải khai báo là $_dispatcher =new Zend_Controller_Dispatcher_Interface() . help me !
      
      
            
               3do            
            
               viết 02:07 ngày 10/10/2018            
                     
         
					 Được gửi bởi vunamkhtn
					
				
				
			
		
      
      
            
               vunamkhtn            
            
               viết 02:15 ngày 10/10/2018            
                     
         
					bác không hiểu ý của mình rồi , ý mình hỏi là tại sao khi khai báo như trên thì $_baseUrl lại là kiểu string còn $_dispatcher lại là đối tượng của lớp Zend_Controller_Dispatcher_Interface ,mặc dù khi khai báo cả 2 thằng đó đều khai báo giống như nhau
				
         
      
      
      
            
               jiSh@n            
            
               viết 02:07 ngày 10/10/2018            
                     
         
					 Được gửi bởi vunamkhtn
					
				
				
			
		
      
      
            
               vunamkhtn            
            
               viết 02:07 ngày 10/10/2018            
                     
         
					 Được gửi bởi jiSh@n
					
				
				
			
		
      
      
            
               jiSh@n            
            
               viết 02:02 ngày 10/10/2018            
                     
         
					 Được gửi bởi vunamkhtn
					
				
				
			
		
            Bài liên quan
         
               



