nicolas/phoponent

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.

dev-master 2018-07-17 06:45 UTC

This package is auto-updated.

Last update: 2024-09-27 23:39:30 UTC


README

LICENCE GNU GPL

Sbuild Scrutinizer Code intelligence Scrutinizer Code Quality

PHP framework for creating HTML components in PHP. each component is an MVC pattern and its view can contain other components.

Installation

Clone Phoponent git repository:

    git clone https://github.com/nicolachoquet06250/phoponent

Usage

Use the available commands.

Several commands are available:

  • php Phoponent
    • help command
  • php Phoponent make:debug
    • enable and disable debug mode.
  • ...etc

Create html page.

For create an Html page, create Html file in app directory.

For view this page, go to your browser and tape http(s)://your_domain.com/?p=index.html

Create php component

For create a php component, simply tape this command in your terminal:

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.

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

Thereafter, update files for get the expected result.

For your component to be taken into account, it must be written on the html page.

You can write it in 3 different ways without impacting its understanding by the framework:

  • 1st way:
<My_component parameter="value"></My_component>
  • 2nd way:
<My_component parameter="value">
    text to write in the 'value' variable
</My_component>
  • 3rd way:
<My_component parameter="value"/>

For externals libs, include them in external_libs directory

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; )
  • Voir les sites suivants: