Kategooria:File Types

Allikas: Juhised

The project is divided into logical parts - modules. Every module has its own package folder and written with small letters. Files except index.phps are considered as class files and their names are written accordingly. index.phps are controllers that use classes and objects. Some very common files belong to the default package (root folder).

The old administration part is in the folder haldus. It is suggested that all the new modules will be created as new packages that reside directly in the root folder. Every administration part has its own package with at least three important files:

  1. the controller index.php;
  2. the model with the content name of the package. There can be more than one models per package;
  3. the view with the content name of the package and ...View.php. There can be more than one view per package.

Every module resides in a separate folder. The folder's name is the package name. Sometimes it is necessary to call a function inside a module that belongs to another module. Therefore, there is a function called handleModule in View.php. By creating a new module it is necessary to put such a part to handleModule:

			case 'permissions':
			{
				View::redirectModule('load');
 
				exit;
			}

As you see, it looks like a translation. This is because we want to use as much as possible the native language in the web address's folder names. The redirection takse part in the function redirectModule and there we have to choose whether we redirect into haldus or directly. For new modules, please use the second or direct folder case. Everywhere where we want to call a function from another module we do it so:

							<a href="?module=permissions&amp;function=buildFormOfModifyingUserRights[additional parameters]">

All the database-related actions will be taken in models while the views handle only the GUI-s. In order to distinguish classes in the versions of PHP less than 5, it is important not to repeat class file names. As also other files than the PHP ones are needed, there is a folder called assets for them. It is also logically structured. The documentation is in the docs subfolder, images in images, DTD-files in dtd, JavaScript files in js etc.

Leheküljed kategoorias "File Types"

Antud kategoorias on ainult järgmine lehekülg.