Framework PHP permétant de créer des composant HTML en PHP. chaque composant est un pattern MVC et sa vue peux comptenir d'autres composants.
PHP framework for creating HTML components in PHP. each component is an MVC pattern and its view can contain other components., (*2)
Clone Phoponent git repository:, (*3)
git clone https://github.com/nicolachoquet06250/phoponent
Use the available commands., (*4)
Several commands are available:, (*5)
php Phoponent
php Phoponent make:debug
For create an Html page, create Html file in app
directory., (*6)
For view this page, go to your browser and tape http(s)://your_domain.com/?p=index.html
, (*7)
For create a php component, simply tape this command in your terminal:, (*8)
php Phoponent make:component
this command takes 2 parameters of which 1 obligatory: - tag : this is the tag name of your component. - type : this is the type of your component ( core or custom ) - => core is default value., (*9)
this command will create for you: - one demo model: - processes datas - one demo PHP view with its associate PHP class: - processes view - one demo controller: - return render, (*10)
Thereafter, update files for get the expected result., (*11)
For your component to be taken into account, it must be written on the html page., (*12)
You can write it in 3 different ways without impacting its understanding by the framework: - 1st way:, (*13)
<My_component parameter="value"></My_component>
<My_component parameter="value"> text to write in the 'value' variable </My_component>
<My_component parameter="value"/>
For externals libs, include them in external_libs
directory, (*14)
If you add external_libraries or class and you would like add at dependency in component:
- go to phoponent/Autoload.php file and add your file to self::$dependencies[]
variable.
- class name is key and value is class ( self::$dependencies['ma_class'] = \namespace\ma_class::class;
), (*15)