Search found 83 matches
- Fri Dec 14, 2007 4:41 am
- Forum: PHP - Theory and Design
- Topic: configuration variables passed to objects
- Replies: 42
- Views: 7281
well yeah.. <?php class test { public function c($var1, $var2, $var4, $var5, $var8, $var9, $var11, $var13) { print_r(get_defined_vars()); } } ?> If you have a function with that many parameters, it's probably ripe for refactoring. Good candidates could be to combine related parameters into paramete...
- Thu Dec 13, 2007 2:39 pm
- Forum: PHP - Theory and Design
- Topic: configuration variables passed to objects
- Replies: 42
- Views: 7281
- Thu Dec 13, 2007 2:34 pm
- Forum: PHP - Theory and Design
- Topic: Injecting an object into an object
- Replies: 16
- Views: 3254
There's also the option of passing the connection in method calls. This is more fine grained than the other suggestions, but it gives a high degree of decoupling. The problem with passing a connection in the constructor is, that you make the connection a property on the object, which uses it. Proper...
- Wed Nov 28, 2007 7:39 am
- Forum: PHP - Theory and Design
- Topic: Should I use a framework?
- Replies: 7
- Views: 2058
As for which framework to choose, it doesn't really matter. I'd say it matters a lot. Problem is, that it's hard to give advice on. Most of the available frameworks are excellent, but they are so in different ways. What fits you depends on the application, you're building and on who you are. Oh, an...
- Sat Nov 17, 2007 12:43 pm
- Forum: PHP - Theory and Design
- Topic: Securing against XSS type 1 & 2
- Replies: 11
- Views: 2018
- Wed Oct 03, 2007 3:12 pm
- Forum: PHP - Theory and Design
- Topic: Zend_View - layout like django
- Replies: 8
- Views: 2633
Syntactically different, but take a look at: http://www.tagarga.com/blok/makrell
- Mon Sep 17, 2007 8:35 am
- Forum: PHP - Theory and Design
- Topic: Dynamically convert procedural PHP to object-based
- Replies: 16
- Views: 4611
Not sure how much it relates to your problem, but see this post:
http://mikenaberezny.com/archives/76
http://mikenaberezny.com/archives/76
- Sun Sep 09, 2007 4:37 am
- Forum: PHP - Theory and Design
- Topic: Creating a Reusuable Framework (With Updates)
- Replies: 2
- Views: 830
Re: Creating a Reusuable Framework (With Updates)
I figure the best way would to use SVN and just check out the framework in each website directory and then just "update" them using svn. What do you think about this? Sounds like the right thing to do. You might want to separate framework (reusable code) from application, in separate repo...
- Mon Aug 13, 2007 3:41 pm
- Forum: PHP - Theory and Design
- Topic: Thinking MVC
- Replies: 18
- Views: 3507
Then there the subject of building hierarchies. Generally there are hierarchies of controllers and hierarchies of Views. I tend to prefer the latter because I don't find many problems that actually require full Controller hierarchies, and the complexity of getting a good hierarchical Controllers is...
- Wed Aug 08, 2007 2:42 am
- Forum: PHP - Theory and Design
- Topic: Thinking aloud: Assets/Class Management?
- Replies: 4
- Views: 1101
yea if you've used version control for anything else before than that would be a good way to go I think version control systems tend to seem mystical to those who haven't used them before, but it's really not much different from using an FTP-client. You update files, you check them in. If you add a...
- Fri Aug 03, 2007 7:36 am
- Forum: PHP - Theory and Design
- Topic: Thinking aloud: Assets/Class Management?
- Replies: 4
- Views: 1101
- Fri Aug 03, 2007 7:35 am
- Forum: PHP - Theory and Design
- Topic: Real Time PHP script for ngrep
- Replies: 2
- Views: 1286
- Tue Jul 31, 2007 2:50 am
- Forum: PHP - Theory and Design
- Topic: Tracking memory usage
- Replies: 15
- Views: 13771
- Wed Jul 25, 2007 5:50 am
- Forum: PHP - Theory and Design
- Topic: MVC and PHP
- Replies: 11
- Views: 3824
How then is the View supposed to be aware of which data to use? You program it that way. In my code though I don't tell the view which model to use or anything like that. Instead the controller takes the input, like maybe an ID, then passes it to the model. The model uses that ID to look up some da...
- Tue Jul 24, 2007 5:11 pm
- Forum: PHP - Theory and Design
- Topic: MVC and PHP
- Replies: 11
- Views: 3824
The controller (...) gets data from the model based on the input, passes data to a view, then sends the view to the client to see. In MVC, the controller shouldn't tell the view, which model to use. The controller isn't a mediator between model and view. Think of controller as write-interface to mo...