src-dev/Mouf/Controllers/ConfigController.php
public function register($name = null, $defaultvalue = null, $value = null, $type = null, $comment = null, $fetchFromEnv = null, $selfedit = "false") {
		$this->selfedit = $selfedit;
		
		if ($selfedit == "true") {
			$this->moufManager = MoufManager::getMoufManager();
		} else {
			$this->moufManager = MoufManager::getMoufManagerHiddenInstance();
		}
		$this->configManager = $this->moufManager->getConfigManager();
		
		$this->name = $name;
				
		$this->defaultvalue = $defaultvalue;
		$this->value = $value;
		$this->type = $type;
		$this->comment = $comment;
        $this->fetchFromEnv = $fetchFromEnv;
		
		if ($name != null) {
			$def = $this->configManager->getConstantDefinition($name);
			if ($def != null) {
				if ($this->comment == null) {
					$this->comment = $def['comment'];
				}
				if ($this->defaultvalue == null) {
					$this->defaultvalue = $def['defaultValue'];
				}
				if ($this->type == null) {
					$this->type = $def['type'];
				}
                if ($this->fetchFromEnv === null && isset($def['fetchFromEnv'])) {
                    $this->fetchFromEnv = $def['fetchFromEnv'];
                }
			}
			if ($this->value == null) {
				$constants = $this->configManager->getDefinedConstants();
				if (isset($constants[$name])) {
					$this->value = $constants[$name];
				}
			}
		} else {
            $this->fetchFromEnv = true;
        }

		// TODO: manage type!
		//$this->type = $comment;
		
		$this->contentBlock->addFile(ROOT_PATH."src-dev/views/constants/registerConstant.php", $this);
		$this->template->toHtml();
	}
public function register($name = null, $defaultvalue = null, $value = null, $type = null, $comment = null, $fetchFromEnv = null, $selfedit = "false") {
		$this->selfedit = $selfedit;
		
		if ($selfedit == "true") {
			$this->moufManager = MoufManager::getMoufManager();
		} else {
			$this->moufManager = MoufManager::getMoufManagerHiddenInstance();
		}
		$this->configManager = $this->moufManager->getConfigManager();
		
		$this->name = $name;
				
		$this->defaultvalue = $defaultvalue;
		$this->value = $value;
		$this->type = $type;
		$this->comment = $comment;
        $this->fetchFromEnv = $fetchFromEnv;
		
		if ($name != null) {
			$def = $this->configManager->getConstantDefinition($name);
			if ($def != null) {
				if ($this->comment == null) {
					$this->comment = $def['comment'];
				}
				if ($this->defaultvalue == null) {
					$this->defaultvalue = $def['defaultValue'];
				}
				if ($this->type == null) {
					$this->type = $def['type'];
				}
                if ($this->fetchFromEnv === null && isset($def['fetchFromEnv'])) {
                    $this->fetchFromEnv = $def['fetchFromEnv'];
                }
			}
			if ($this->value == null) {
				$constants = $this->configManager->getDefinedConstants();
				if (isset($constants[$name])) {
					$this->value = $constants[$name];
				}
			}
		} else {
            $this->fetchFromEnv = true;
        }

		// TODO: manage type!
		//$this->type = $comment;
		
		$this->contentBlock->addFile(ROOT_PATH."src-dev/views/constants/registerConstant.php", $this);
		$this->template->toHtml();
	}
public function register ( $ name = null , $ defaultvalue = null , $ value = null , $ type = null , $ comment = null , $ fetchFromEnv = null , $ selfedit = "false" ) { $ this -> selfedit = $ selfedit ; if ( $ selfedit == "true" ) { $ this -> moufManager = MoufManager :: getMoufManager ( ) ; } else { $ this -> moufManager = MoufManager :: getMoufManagerHiddenInstance ( ) ; } $ this -> configManager = $ this -> moufManager -> getConfigManager ( ) ; $ this -> name = $ name ; $ this -> defaultvalue = $ defaultvalue ; $ this -> value = $ value ; $ this -> type = $ type ; $ this -> comment = $ comment ; $ this -> fetchFromEnv = $ fetchFromEnv ; if ( $ name != null ) { $ def = $ this -> configManager -> getConstantDefinition ( $ name ) ; if ( $ def != null ) { if ( $ this -> comment == null ) { $ this -> comment = $ def [ 'comment' ] ; } if ( $ this -> defaultvalue == null ) { $ this -> defaultvalue = $ def [ 'defaultValue' ] ; } if ( $ this -> type == null ) { $ this -> type = $ def [ 'type' ] ; } if ( $ this -> fetchFromEnv === null && isset ( $ def [ 'fetchFromEnv' ] ) ) { $ this -> fetchFromEnv = $ def [ 'fetchFromEnv' ] ; } } if ( $ this -> value == null ) { $ constants = $ this -> configManager -> getDefinedConstants ( ) ; if ( isset ( $ constants [ $ name ] ) ) { $ this -> value = $ constants [ $ name ] ; } } } else { $ this -> fetchFromEnv = true ; } // TODO: manage type!
 //$this->type = $comment;
 $ this -> contentBlock -> addFile ( ROOT_PATH . "src-dev/views/constants/registerConstant.php" , $ this ) ; $ this -> template -> toHtml ( ) ; }
Displays the screen to register a constant definition.

@Action
@Logged
@param string $name
@param string $selfedit
Displays the screen to register a constant definition .