5
votes
1answer
268 views

Laravel model and controller interaction

I want to know if I'm going about creating and calling two functions from my model to my controller in the simplest and cleanest way. Model: ...
7
votes
0answers
91 views

PHP-framework with MVC architecture and Active Record pattern for the DB management

I tried to create the PHP-framework, with no experience in the task like this: Folders: ...
0
votes
1answer
71 views

Refusing to use a common template engine

As the title says, I refuse to use a common template engine. I have my reasons, so instead of doing this: ...
4
votes
2answers
76 views

Would this be considered MVC?

For many days, I've been re-designing my application, applying some custom pattern and making our code looks like a framework. I have something like this for separate the business logic, from views: ...
2
votes
1answer
3k views

Routing in MVC with PHP

I am in the progress of creating a MVC structured website. I've opted to make my own instead of using pre-constructed MVC systems as a way to teach myself better coding and understand how applications ...
1
vote
2answers
89 views

PHP Router for MVC

I recently started developing my first serious project in PHP, a MVC completely build by myself, which is quite a challenge, when being new to OOP. So the main struggle of the whole project has, and ...
8
votes
1answer
865 views

Intranet PHP application

I'm more of an IT guy (no CS course) with a strong and passionate relationship with Unix and I love KISS. I'm writing an application to help my coworkers with their daily tasks. Every now and then I ...
3
votes
1answer
91 views

MVC architecture in PHP

I have developed a few web applications according to my own coding style similar to MVC architecture. I'm a self learner. But there is no controller class or model class. In my way, I don't split the ...
3
votes
2answers
90 views

Handling page requests in MVC

Is this an efficient way to handle page requests in MVC? index.php: require 'Classes/Autoloader.php'; Autoloader::start(); Session::start(); new Bootstrap(); ...
3
votes
3answers
172 views
2
votes
2answers
1k views

Very small MVC login framework

I want to develop my own MVC framework.This is a very small framework. I have tested this framework and it's working fine. I can do CRUD without any troubles. I am using Smarty to handle the view ...
0
votes
1answer
69 views

How to write this code more efficient and simplify creation of dependency objects?

How can I write my code more efficient (not repeating same code)? And is there a solution that simplifies the way of having to create a lot of dependency objects over and over again whenever I ...
2
votes
1answer
53 views

Member restricted game with API

My website is poorly coded. The structure is pretty simple: A RewriteRule redirects /.... to /index.php?page=$1 mypages/page.php contains the page content and actions (model controller and view ...
1
vote
1answer
60 views

How to re-factor dynamic menu code to OOP in a MVC framework?

I have a MVC framework, and I am struggling with the following dynamic menu code. A menu is pretty much HTML, so technically it should reside in the View, but the dynamic part is driven by PHP and a ...
2
votes
2answers
103 views

Is this how an MVC controller supposed to be?

This is the controller I created for my MVC framework, and I think I finally got it right. Anything I can do to make the code more efficient? Is this how a MVC controller is supposed to look like? ...
0
votes
2answers
346 views

Simple sign up form

I have tried to build my first MVC sign up form. Here is the user controller method register: ...
2
votes
1answer
79 views

Is my Controller class functionality correct?

I'm building my own micro MVC framework with only the absolute core functionality. How my controller works is that my router will call the controller depending on the request method (GET or POST). ...
2
votes
1answer
51 views

What is an proper way of routing to the right controller in MVC patterns?

I always been curious on how to build great application with proper routing to my controllers, but after seeing some sources of applications like Xenforo, Joomla, it seems completely different, and ...
2
votes
1answer
145 views

Router for MVC framework: Is it OO and good to go?

Am I utilizing dependency injection correctly? Any parts of my class that I should decouple? Anything I could improve in my code when it comes to OO PHP (and MVC)? The class routes URLs based on ...
5
votes
1answer
423 views

Pvik - a small PHP framework

Pvik is a lighweight PHP framework that uses the model, view, controller principle. -- EXAMPLE -- Here is a very simple example how you build a website with the framework. I'm asking you if this is ...
0
votes
1answer
104 views

Is my first MVC architecture set up to standards?

I just started learning about the MVC architecture. And I started to create my own MVC framework to how I like it the most. Here I've got the index.php, indexcontroller.php and view.php. I'm not too ...
3
votes
1answer
145 views

Simple application to experience encapsulation

Looking at the code, is this a proper example of encapsulation? additionalComputer.php (class) ...
3
votes
1answer
138 views

Is this right structure for MVC / MVP application?

I have written a code for an application/website that I wanted to be structured similarly to MVC design pattern (but I think it's rather MVP based on comparison I read). This functions as a kind of ...
3
votes
1answer
314 views

Laravel 4 clean code review of users controller and model, trying to maintain MVC structure

I'd like you to review my attempt at creating an authorization class and let me know if there is re-factoring to be done and/or how I can make the code cleaner and abide by the MVC structure. ...
10
votes
3answers
257 views

Listener/Observer Model in PHP

I've taken a look at the SPL Listener/Observer model but found that it doesn't work when using static methods. So I wrote my own but it's very simply. Can anyone suggest ways to make it more like the ...
1
vote
1answer
51 views

Is this a model? What is controlling it (controller?) and how does the data get to the view?

My goal is to instantiate a class based on the request and call a method on it based on the request verb. The classes I'm referring to will have methods such as ...
3
votes
1answer
101 views

Best practice for generating jQuery dynamical content

I am new user of CodeIgniter and I am trying to build an application that there are lots of jQuery dynamical content. Below I provide a code that I am using in order to be precise. The code below is ...
3
votes
1answer
147 views

How can I improve my PHP model for my HTML5/JS mobile app?

I am posting the a section of the model of my application. Any/all feedback would be very helpful as I am trying to build my PHP skills, but I will ask a couple specific questions that might help ...
2
votes
2answers
594 views

A PHP MVC working with Mustache (and now nested templates!)

I'd love some feedback about this code that I'm editing and shortening now. Here's the class: ...
2
votes
1answer
151 views

Is the structure for this MVC Blog ok?

I made a MVC Blog based on a tutorial for a framework from here. It's not finished yet, but I want to know if the structure and the classes are ok and what can I change. Feel free to say anything. ...
0
votes
0answers
81 views

Symfony2: Refactor messy Controller action

I have a fairly ugly controller method I would like to refactor / extract. I can only test this in a integration type test which kind of signals a code smell. The method processes the form and needs ...
2
votes
1answer
713 views

Review my PHP router class

I'm writing yet another mvc framework just for learning purpose and i would like you guys to review my code. Whenever i'm coding i have that feeling that my code is horrible and not the most efficient ...
1
vote
1answer
554 views

Multi-page form attempt

I have just started playing around with L4 and would like to get some feedback on how I implemented a multi-page form Here are my routes: ...
1
vote
0answers
3k views

mvc example: form post

I've tried to improve my code: separate HTML/PHP, much clear, next time change will be easier. After doing research on MVC/OOP, I've made the below code to learn. I understand this is not the MVC ...
2
votes
1answer
614 views

Builder pattern for Codeigniter ActiveRecord queries

I am using Codeigniter and it's ActiveRecord. I had this idea for a base class that provided a generic getter/setter for doing simple queries on a database. I have a lot of database objects that ...
1
vote
1answer
2k views

Basic PHP MVC setup for form submissions

I'd like your thoughts on this basic implementation of MVC. The view outputs a form, and when the page is loaded, the controller checks for a form submission and then updates the model accordingly. ...
0
votes
0answers
127 views

Model Input Sanitation / Validation - Is this acceptable?

I'm fairly new to MVC concepts and PHP input validation. I'm wanting to know if the following: Follows the MVC pattern correctly - if not, how can I improve it? Has any huge apparent security ...
0
votes
1answer
823 views

PHP MVC: how to do $_POST the right way

I am not sure if I am doing right on how to handle $_POST data in MVC pattern. Below is my attempt. Am I doing it right? // Dummy $_POST data, ...
2
votes
1answer
198 views

How to put XML results in the MVC pattern?

I have been writing PHP programs in the MVC pattern for quite some time. But I am not sure if I am doing it right. For instance, I have this PHP file that prints a result in XML, and I put this file ...
2
votes
0answers
296 views

Tiny MVC - Handling validation / sanitization in a model

I was told to post this here - original post. I'm fairly new to MVC concepts and PHP input validation. I'm open to all input, but I'm largely wanting to know if the following: Follows the MVC ...
2
votes
1answer
765 views

PHP MVC - Custom Routing Mechanism

Note #2: This was a post from a while back. Although the top rated answer is useful (generally), I'm looking for something more specific to this issue including routing / architecture. I've even ...
1
vote
3answers
415 views

Look over my code for PDO and MVC

I'm building this website with PDO and Pattern MVC. I'm currently working on the login page and would like to know if this structure is correct for MVC pattern. I'd also like your opinions and ...
2
votes
1answer
571 views

Structure pages mvc + oop

I am developing a website and I want to use PDO and MVC. Before, I was coding in procedural MySQL, but I'm starting to understand the object-oriented programming. My problem is the following: If I ...
0
votes
1answer
607 views

Good, flexible and secure MVC router PHP

I have developed a new router after having learnt a lot from my previous attempts and I will be using this in sites I make from now on. In a previous question, the issue of REQUEST_URI being too ...
2
votes
1answer
2k views

Is this correct implementation of MVC pattern for PHP website?

I'm currently developing a music website using OOP PHP and I'm trying to correctly implement the Model View Controller pattern. I am creating this website from scratch so I would like to avoid ...
1
vote
1answer
91 views

Is this a good way for Controller to interact with Model ? (MVC)

In my controller I had the idea to do something like the following: ...
1
vote
1answer
674 views

Router Class In a Lightweight MVC Boilerplate

I'm trying to come up with a simple router class. I considered using a Request class but that will rather make simple to complex. That is why I did not consider creating one for my framework. ...
2
votes
1answer
317 views

Instantiating objects in a MVC in PHP

I am working on converting a PHP application to MVC, and have a couple questions! 1) I have a main Model object, that I require a database connection for, as well as a User object that uses a ...
5
votes
2answers
195 views

Spreading out model across multiple classes a good idea?

Background My project performs software application management; it covers in-app purchasing, product provisioning, account management, etc. I've recently been tasked to add a cost reporting ...
6
votes
2answers
244 views

Where should I define my entities?

I am working on my own PHP MVCframework. Now I want to know where to get and specify my entities. An example, should I do this: ...