Linked Questions
63 questions linked to/from How can I implement an Access Control List in my Web MVC application?
5
votes
2answers
285 views
PHP - Where to put RBAC and Authentification in an MVC application? [duplicate]
I'm working on an MVC application with this structure:
Request
V
FrontController <-> Router
V
Controller <-> Model
V
View
I have two other components that I ...
-1
votes
3answers
246 views
Generating a list of permissions [duplicate]
I'm working on a custom framework strictly for fun and educational purposes. I've read over this question on how to implement permissions and I like the answers; either using a decorator pattern and / ...
529
votes
5answers
162k views
How should a model be structured in MVC? [closed]
I am just getting a grasp on the MVC framework and I often wonder how much code should go in the model. I tend to have a data access class that has methods like this:
public function CheckUsername($...
6
votes
5answers
7k views
Where do I put a database query in MVC?
The last few days, I have extensively read books and web pages about OOP and MVC in PHP, so that I can become a better programmer. I've come upon a little problem in my understanding of MVC:
Where do ...
19
votes
3answers
2k views
Testable Controllers with dependencies
How can I resolve dependencies to a controller that is testable?
How it works: A URI is routed to a Controller, a Controller may have dependencies to perform a certain task.
<?php
require '...
5
votes
3answers
5k views
PHP - Implement logging mechanism to file in several classes
I would like to implement logging mechanism to file in PHP:
log file path will be in config file config.php
in several classes I would like to log some events into the log file
For example:
...
3
votes
3answers
6k views
Getting familiar with MVC - how do I work with session logic, additional classes and background logic
While coding PHP, I decided to move from spaghetti code and try to implement MVC.
To implement the MVC framework, I vent to this article
Article gave a good start and I managed to create my site, and ...
11
votes
4answers
2k views
rules to redirect to subdomain
Who defines the URLs to be redirected to the mobile version?
Lets take twitter as an example:
https://twitter.com -> redirect mobile
https://dev.twitter.com -> not redirect mobile
In an MVC ...
4
votes
2answers
6k views
PHP MVC from the scratch - How to connect these classes?
First of all, I know that
don't reinvent the wheel
there are lot of frameworks out there for MVC.
This is not for a production work, but for my hobby project. I am writing an MVC from the scratch ...
7
votes
3answers
2k views
Why is auth typically in the Controller in MVC?
I've been doing a lot of tutorials for different MVC frameworks, and it seems very typical for Authorization to take place in the Controller. Why?
My thought is the Controller should only be used to ...
3
votes
1answer
3k views
how to structure MVC models and ORM models
I have some trouble getting a good folder structure in my project and i would like to know what other ways i could use to structure my files.
I'm currently working in an MVC sturctured folder.
www/
...
5
votes
2answers
2k views
validation in mvc php
I don't know which one is the best?
do you think it's better to validate user login form or other forms in controller or it's better to define one class for example 'security class' in model to ...
5
votes
3answers
3k views
Objective oriented design in a PHP MVC Framework
Traditionally in a MVC framework (Such as CodeIgniter or Kohana) I create controllers as I create different pages. There will be a login controller, a home controller and so on. But recently I learned ...
1
vote
1answer
11k views
redirect users to different pages based on role php
I need to redirect users to different pages based on the roles given to them in the database. Only the username and password is submitted on the login page. I have to fetch the role from the database ...
2
votes
1answer
6k views
PHP: MVC User authentication and global user object?
I'm writing my first real MVC-application with PHP. I'm not using a framework because my application is so small that I figured it would be faster to write everything from scratch.
In my app, users ...