- Explore MCP Servers
- MCParfum
Mcparfum
What is Mcparfum
Simple PHP MVC OOP is a basic and straightforward framework designed for PHP 7.4 and later versions. It implements the Model-View-Controller (MVC) design pattern using Object-Oriented Programming (OOP). This framework serves as an educational tool for students to grasp the fundamental components of MVC and their interactions, facilitating a deeper understanding of how MVC operates in various frameworks.
Use cases
The framework is ideal for educational purposes, particularly for students learning web development, PHP programming, and the MVC architecture. It can be utilized for developing small to medium web applications, prototypes, and projects that require a basic understanding of MVC principles without the complexity of larger frameworks.
How to use
To use the framework, follow these steps: Install dependencies via Composer, rename and configure the parameters.env
file with the appropriate environment variables, adjust the BASE_DIR
path according to your web server’s directory structure, and then access the application through your web browser by navigating to http://localhost/{BASE_DIR}/index.php
.
Key features
Key features of the Simple PHP MVC OOP framework include a clear directory structure for organizing controllers, models, and views, interfaces for controller implementation, customizable exception handling, and utility classes for various tasks. It is lightweight and provides a foundational understanding of MVC without excessive abstraction or complexity.
Where to use
This framework is best used in educational settings, particularly for students and beginners in web development. It can be employed for building small web applications or learners’ projects in environments using WAMP, XAMPP, MAMP, or LAMP servers, where a straightforward MVC implementation is beneficial for hands-on learning.
Overview
What is Mcparfum
Simple PHP MVC OOP is a basic and straightforward framework designed for PHP 7.4 and later versions. It implements the Model-View-Controller (MVC) design pattern using Object-Oriented Programming (OOP). This framework serves as an educational tool for students to grasp the fundamental components of MVC and their interactions, facilitating a deeper understanding of how MVC operates in various frameworks.
Use cases
The framework is ideal for educational purposes, particularly for students learning web development, PHP programming, and the MVC architecture. It can be utilized for developing small to medium web applications, prototypes, and projects that require a basic understanding of MVC principles without the complexity of larger frameworks.
How to use
To use the framework, follow these steps: Install dependencies via Composer, rename and configure the parameters.env
file with the appropriate environment variables, adjust the BASE_DIR
path according to your web server’s directory structure, and then access the application through your web browser by navigating to http://localhost/{BASE_DIR}/index.php
.
Key features
Key features of the Simple PHP MVC OOP framework include a clear directory structure for organizing controllers, models, and views, interfaces for controller implementation, customizable exception handling, and utility classes for various tasks. It is lightweight and provides a foundational understanding of MVC without excessive abstraction or complexity.
Where to use
This framework is best used in educational settings, particularly for students and beginners in web development. It can be employed for building small web applications or learners’ projects in environments using WAMP, XAMPP, MAMP, or LAMP servers, where a straightforward MVC implementation is beneficial for hands-on learning.
Content
Simple PHP MVC Orientado a Objetos
Simple PHP MVC OOP es un framework básico y sencillo de MVC diseñado para PHP 7.4 y versiones posteriores. Fue desarrollado a lo largo de varios períodos académicos en el contexto de la asignatura de Desarrollo de Negocios Web. El propósito de este framework es proporcionar una base para la creación de aplicaciones web en PHP, haciendo uso del patrón de diseño Modelo-Vista-Controlador (MVC) y la programación orientada a objetos (OOP). Esto brinda la oportunidad a los estudiantes de comprender cada uno de los componentes del MVC y cómo interactúan entre sí. El diseño se encuentra en un nivel de abstracción muy elemental, lo que permite adquirir los fundamentos y comprender cómo operan los componentes de un MVC, facilitando su comprensión y aplicabilidad en otros frameworks MVC.
Instalación
- Ejecutar el comando
composer install
para instalar las dependencias.
- Nota: Si no tiene instalado composer en su computadora puede descargarlo desde el sitio web oficial Composer.
- Copiar y renombrar el archivo
renameTo_parameters.env
aparameters.env
y configurar las variables de entorno. - En el archivo
parameters.env
modificar la líneaBASE_DIR =
por la ruta relativa de la carpeta de su proyecto en el servidor web.- Ejemplo en WAMP:
BASE_DIR = SimplePHP_MVC_OOP
si la ruta a la carpeta e su proyecto esC:\wamp64\www\SimplePHP_MVC_OOP
- Ejemplo en XAMPP:
BASE_DIR = mvc
si la ruta a la carpeta e su proyecto esC:\xampp\htdocs\mvc
BASE_DIR = nw/mvc
si la ruta a la carpeta e su proyecto esC:\xampp\htdocs\nv\mvc
- Ejemplo en MAMP
BASE_DIR = mvc
si la ruta a la carpeta e su proyecto es\Applications\MAMP\htdocs\mvc
- Ejemplo en LAMP
BASE_DIR = mvc
si la ruta a la carpeta e su proyecto es/var/www/html/mvc
- Ejemplo en WAMP:
- Correr en el Browser la ruta
http://localhost/{BASE_DIR}/index.php
donde{BASE_DIR}
es el nombre de la carpeta de su proyecto. Nota si su web server corre en otro puerto recuerde agregar el puerto en la ruta. Ejemplo:http://localhost:8080/{BASE_DIR}/index.php
Estructura de directorios
La estructura de directorios del framework es la siguiente:
SimplePHP_MVC_OOP ├── src │ ├── Controllers Carpeta que contiene los controladores de la aplicación. | | ├── IController.php Interfaz que deben implementar todos los controladores. | | ├── PrivateController.php Controlador base para las vistas privadas. | | ├── PublicController.php Controlador base para las vistas públicas. | | ├── PrivateNoAuthException.php Excepción para vistas privadas sin autorización. | | └── PrivateNoLoggedException.php Excepción para vistas privadas sin sesión iniciada. | ├── Dao Carpeta que contiene los DAOs (Modelos) de la aplicación. | | ├── Dao.php Conexion a la base de datos. | | └── Table.php Clase base para los DAOs. | ├── Utilities Clases de utilidad. | └── Views | | ├── templates Carpeta que contiene las plantillas de las vistas. | | └── Renderer.php Clase para renderizar las vistas. ├── public Carpeta pública del proyecto para recursos estáticos. │ ├── css Carpeta para hojas de estilo. │ ├── imgs Carpeta para imágenes. │ └── css_src Carpeta para hojas de estilo fuente con LESS. ├── vendor Carpeta para dependencias de composer. ├── .gitignore Archivo para ignorar archivos y carpetas en git. ├── composer.json Archivo de configuración de composer. ├── index.php Archivo de entrada de la aplicación. ├── parameters.env Archivo de configuración de variables de entorno. └── README.md Archivo de documentación.