Guide de l'apprenti développeur/en

De WIKI-BOKEH
Aller à : navigation, rechercher

<languages />This page content is intended for developers or user wanting to contribute to Bokeh code

Introduction[ ]

Bokeh code is written in PHP, based on a tuned Zend Framework 1.6.2. There are 3 main parts in files structure from the installation directory in which you put Bokeh:

  • OPAC "application /modules/opac": aka frontoffice, it contains all the screens a library user can see,
  • Admin "application/modules/admin": aka backoffice, it contains all the screen the portal admin can see,
  • Cosmogramme "cosmogramme/": it contains the record integrator of Bokeh

Find the code[ ]

Here we will tell you how to find the code of a particular function or screen.

All the screen that Bokeh display (front or backoffice) is the result of the execution of a "controller". All the controllers are found under:

  • "application/modules/opac/controllers"
  • "application/modules/admin/controllers"

Zend Framework (aka ZF) decides from the url requested which controller to execute. If you request "http://my-bokeh.com/admin/profil/edit/id_profil/1" ZF will split this into parts to take its decision, this process is called routing:

  • "admin/profil/edit": Is the path of the requested resource
  • "id_profil/1": Is a parameter named "id_profil" which value is "1" that will be given to the controller

The "admin/profil/edit" path give us 3 informations

  • Module: admin or opac. In this example we will look into "application/modules/admin/controllers/"
  • Controller: can be any name in latin caracters. To obtain the controller's name we uppercase first caracter and suffix with "Controller.php". In this example we will open "application/modules/admin/controllers/ProfilController.php",
  • Action: the name of the particular function (method) that will be called in the controller. To obtain the action's name we suffix it with "Action". In this example we will look for a "editAction" method in the controller's code.


Another example:

  • I want to create a screen in frontoffice which display library's opening time.

It's url should be /opening

  • I create a controller file in application/modules/opac/controllers
  • This file MUST be named OpeningController.php to match the url and MUST contains a OpeningController class declaration.
  • I add a directory to hold display code in application/modules/opac/view/scripts/
  • This directory MUST be named opening to match the controller's name
  • In this directory I add an index.phtml file in which we will write the needed html

Access database[ ]

Bokeh uses Storm ( Read the doc )