loadFile() public method

Load language content from an XML file.
public loadFile ( string $langFile ) : void
$langFile string
return void
 /**
  * Constructor method to instantiate the default controller object
  *
  * @param  Request  $request
  * @param  Response $response
  * @param  Project  $project
  * @param  string   $viewPath
  * @return self
  */
 public function __construct(Request $request = null, Response $response = null, Project $project = null, $viewPath = null)
 {
     if (null === $viewPath) {
         $cfg = $project->module('Phire')->asArray();
         $viewPath = __DIR__ . '/../../../../../view/phire/install';
         if (isset($cfg['view'])) {
             $class = get_class($this);
             if (is_array($cfg['view']) && isset($cfg['view'][$class])) {
                 $viewPath = $cfg['view'][$class];
             } else {
                 if (is_array($cfg['view']) && isset($cfg['view']['*'])) {
                     $viewPath = $cfg['view']['*'] . '/install';
                 } else {
                     if (is_string($cfg['view'])) {
                         $viewPath = $cfg['view'] . '/install';
                     }
                 }
             }
         }
     }
     $lang = isset($_GET['lang']) ? $_GET['lang'] : 'en_US';
     if (!defined('POP_LANG')) {
         define('POP_LANG', $lang);
     }
     $this->i18n = I18n::factory();
     $this->i18n->loadFile($_SERVER['DOCUMENT_ROOT'] . BASE_PATH . APP_PATH . '/vendor/Phire/data/assets/i18n/' . $this->i18n->getLanguage() . '.xml');
     parent::__construct($request, $response, $project, $viewPath);
     $this->sess = Session::getInstance();
 }
Example #2
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @return self
  */
 public function __construct($action = null, $method = 'post')
 {
     $lang = isset($_GET['lang']) ? $_GET['lang'] : 'en_US';
     if (!defined('POP_LANG')) {
         define('POP_LANG', $lang);
     }
     $this->i18n = I18n::factory();
     $this->i18n->loadFile(__DIR__ . '/../../../data/assets/i18n/' . $this->i18n->getLanguage() . '.xml');
     $this->initFieldsValues = $this->getInitFields();
     parent::__construct($action, $method, null, '        ');
     $this->setAttributes('id', 'install-form');
 }