我有一個configuration.php作爲一個單獨的文件.IT contat bellow pardFactory類有11個變量。我需要從array.that $ ConfigData中分配它們的值。我將如何做這個?指定數組值來分開類值
CLASS
<?php
class PardFactory {
public $TITLE = 'Sri lanka Accommodation';
public $ONLINE = 'Site Online';
public $OFFLINE = '';
public $EMAIL = '';
public $METADESCRIPTION = '';
public $METAKEYWORDS = '';
public $COPYRIGHT = '';
public $HOST = '';
public $DATABASE = '';
public $USERNAME = '';
public $PASSWORD = '';
}
?>
ARRAY
$ConfigData = array($adminConfig->TITLE,
$adminConfig->ONLINE,
$adminConfig->OFFLINE,
$adminConfig->EMAIL,
$adminConfig->METADESCRIPTION,
$adminConfig->METAKEYWORDS,
$adminConfig->COPYRIGHT,
$adminConfig->HOST,
$adminConfig->DATABASE,
$adminConfig->USERNAME,
$adminConfig->PASSWORD);
欲數組值傳遞給類值。
另外,我只需要在那個configuration.php中有上面那個pardFactory類。如果我想要像上面那樣,我需要先將pardFactory類包含到configuration.php中。我需要有這個文件如Joomla的configuration.php文件
我需要的只是上面pardFactory類在configuration.php..IF我會做類似上面我需要首先包括pardFactory類的configuration.php文件。我需要這個文件像joomla configuration.php文件 – wasana