seedproject-api/core/Controller.php
Carlos Arias a447b17e69 Initial commit: SeedProject API framework
PHP MVC seed project with router, database layer, auth helpers,
LLM provider integrations, Stripe gateway, and console commands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVcDB9cRQZRRmUivMHRQGL
2026-09-14 16:15:41 -05:00

29 lines
No EOL
677 B
PHP

<?php
class Controller {
function __construct() {
$this->view = new View();
$this->view->_c = $this;
}
/**
*
* @param string $name Name of the model
* @param string $path Location of the models
*/
public function loadModel($name, $modelPath = 'models/') {
$path = $modelPath . $name.'_model.php';
if (file_exists($path)) {
require $modelPath .$name.'_model.php';
$modelName = $name . '_Model';
$this->model = new $modelName();
$this->view->_m = $this->model; // extends [model] access to views
}
}
}