Quote:
|
Like isset, calling empty will not raise any NOTICE if the variable is not found.
|
Which is exactly what I want it to do, not raise a notice.
Quote:
|
Also, perhaps I'm missing something, but the only way to have any form of dynamic routes is you use what you call plugins? For example, how could one have "user/1" refer to (user.php) controller::index(1) or something more abstracted like "img/abc.jpg" refer to (images.php) controller::stream('abc', 'jpg')? The Routes documentation doesn't make any mention of any more basic than straight substitution (mypage => mycontroller/func/argument).
|
At the moment only static routes are supported. I am planning on adding dynamic route support in the near future, preferably before the first BETA release. For the time being I'm just using Mod_Rewrite.
A dynamic route in the future might look like this:
PHP Code:
$route['mypage/([0-9]+)'] = 'controller/function/arg1/$1';
Quote:
|
Helpers: I'd like to see these namespaced (class-based... we can use "real" namespaces somewhere in the future). For example, you have the functions base_url, page_url, model_url and redirect; why not have these as url::base, url::page, url::model and url::redirect? The same can be said for cookie::set and cookie::delete (no cookie::get?).
|
Good idea. Probably should, and will, be done. A cookie::get() function is not necessary because you can use the built in $this->dingo->cookie() function.
Quote:
|
Models: accessible by the URL? I'm not sure this should be the case, or even if it is they should always be routed through a router.
|
One of my big pet peeves with other frameworks was the fact that you had to load models from a controller. To me that kinda defeated the whole purpose of having a model in the first place. In Dingo controllers display pages and models make changes to the database/filesystem/whatever.
Separating the models from the controllers gives your URL scheme a lot more freedom. For example: let's say you have a page users/edit/[num] to edit a user. You can have the form for that page submit to the model index.php?model=users/edit/[num], instead of having to create another controller with a different URL like users/edit2/[num] to manipulate the database.
Confusing?
Quote:
|
I think your whole section of index.php under "Detect Illegal Characters in URL" could do with some re-working. How you construct the regular expression doesn't result in what I think you think it does (confused yet?).
|
I'll have to revisit that, all I remember is it being a total pain in the you know what!
Btw, I'm considering restructuring the bootstrap for better modularity. If that makes any sense.
Thanks for all the detailed feedback everyone!