Tagged Questions
0
votes
2answers
56 views
along right lines for an application class for mvc?
Please could you review and critic my code and logic. If this is along the right lines for an application mvc class or not. Thanks
namespace dh_mvc2;
use dh_mvc2\dispatchers\Base_Dispatcher;
use ...
2
votes
0answers
72 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 ...
0
votes
0answers
28 views
Making one object the property of another whilst avoiding scope issues
After being inspired by some MVC style design patterns, I have been trying to separate data from views in my code and move toward a more sensibly organized object based approach. (please, don't bother ...
0
votes
0answers
253 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 ...
3
votes
2answers
2k views
Small MVC for PHP
The following is a new question based on answers from here: Small PHP MVC Template
I have written a small MVC template library that I would like some critiques on.
The library is located here
...
0
votes
1answer
83 views
Review: Finished router class for custom mini framework
I have finished my router and would like your thoughts on anything that may be inefficient of could be done better!:
class Router {
public $start_page = 'Dashboard' ; // Change to your home/default ...
1
vote
1answer
70 views
File loop and logic in controller of view header?
I have the following in the header.php file which is included in all of my views:
$dh = opendir(Vs.get_class($this).'/js') ;
while($script = readdir($dh)) {
if(!is_dir($script))
{
...
2
votes
1answer
250 views
A PHP MVC class
I had asked a first question about this class a while ago and got a few answers here which made me rewrite it completely.
I removed all statics and globals, added my variables as arguments for the ...
0
votes
2answers
255 views
How can I improve my PHP backend for html5/js mobile app?
I would really appreciate any feedback on the back-end of my mobile application.
I tried to keep an MVC pattern, where I considered the app to be my view.
Perhaps an REST framework would have been ...
1
vote
1answer
632 views
MVC Structured CMS
I'm creating a MVC structured content management system as both a means to learn better OOP and redesign my tacky website to me more modular and simplistic. My aim is to approach everything with ...
1
vote
2answers
277 views
Controller for an Administrator User, can this be improved? (codeigniter)
I want to write better code.
This is a simple controller class for an administrator login.
Are there conventions or tips in PHP to rewrite this code and improve it?
<?php
class Administrators ...
2
votes
2answers
910 views
PHP Router MVC OOP
I just finished rewriting my Router class. Any input would be much appreciated.
The class routes URLs based on a site.com/class/method/param/param/etc syntax.
One thing I've done differently is ...
2
votes
1answer
74 views
How to shorten long code but still keep in the philosphy of Zend framework
I have been wondering this for a while. Take this example:
<?= Zend_Registry::get('translate')->_('translate me!');
I have my views cluttured with such code. My coworkers also complain often ...
2
votes
0answers
67 views
Design for uploading a file and persisting it to a data store
Say we have a spreadsheet (.CSV) being uploaded with static columns
| (int) item 1 | (string) item 2 | (int)item 3]|
That needs to be persisted to a data store, then sent back to a browser to ...