Dit is het bekende liedje, ik weet alleen niet wat er aan de hand is.
Wie kan mij hierbij helpen?
Warning: Missing argument 1 for Application::__construct(), called in C:\xampp\htdocs\library\application.class.php on line 24 and defined in C:\xampp\htdocs\library\application.class.php on line 7
<?php
class Application {
protected $_uri;
protected $_model;
function __construct($uri) { // Line 7
$this->_uri = $uri;
$this->loadController($this->_uri['controller']); // UsersController
$this->loadModel($this->_uri['model']); // User
$this->_template = new Template($this->_uri['controller'], $this->_uri['method']);
}
function loadController($class) {
$file = ROOT . DS . 'application' . DS . 'controller' . DS . $class . '.php';
if(!file_exists($file)) {
throw new Exception('Bestand niet gevonden', 404);
}
require_once($file);
$controller = new $class; // Line 24
if(method_exists($controller, $this->_uri['method'])) {
$controller->{$this->_uri['method']}($this->_uri['var']);
}
else {
$controller->index();
}
}
class UsersController extends Application {
}
[/code]
url waarmee ik het script aanroep: http://localhost/users/add
edit: die url wordt doorgestuurd naar -> /public/index.php?url=users/add
2.598 views