« first day    last day (310 days later) » 

1:15 AM
Lusitanian has made a change to the feeds posted into this room
Lusitanian has stopped a feed from being posted into this room
Lusitanian has made a change to the feeds posted into this room
 
1:27 AM
0
Q: Why not make MVC model methods static?

RelevartI am trying to implement an MVC framework in PHP, and I'am trying to understand it based on other peoples example codes. I see almost everywhere, that Models are instantiated in the Controller or somewhere. The thing that I don't understand is why do I need to instantiate models, why isn't it g...

0
Q: Best way to send data from controller to view after a form is submitted?

GazillionI'm developing a basic web app using the MVC architecture. I'm building my own to try and fully understand how the MVC arch works so this doubles as a learning exercise. I am using the Aura Router classes to map my URLs to controllers and action so that something like mysite.com/login will be ma...

0
Q: Instantiating objects in a MVC in PHP

user1582882I 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 database object also. Is it a bad practice to create a new database object for each of these classes, li...

1
Q: Global Logging method in MVC based web app

imperium2335I am creating a management/crm system. I have a class in my libs folder called Util which contains some static functions. I want to create a static function for logging user actions from anywhere in my system i.e. Util::log($userId, $action) ; The bit that has me wondering is how should...

0
Q: Is the Service layer where all my real methods go?

DavidFrom all the tutorials I've read the service layer only seems to only have one or two methods in it so I am unsure whether services are only supposed to be lightweight/skinny as opposed to fat with as many methods as you need If I have a Post domain object and have a PostService class is this wh...

 
 
4 hours later…
5:19 AM
1
Q: Should I pass session data from my controller, or read it in the service layer?

Kim PrinceI have a fairly typical MVC application in PHP. Quite often I need to grab data from the session but I'm never sure if I should do this in the controller, or in the service. For example, if a request hits domain.com/user/edit, my controller could get the current user from the session and pass i...

 
 
2 hours later…
7:37 AM
0
Q: PHP Saving Obj in session then changing it's value on another page

JanguiI am new in OOP with PHP and I'm trying to do something like this: Class entry form is inside it's own file. index.php creates an object from class entry form and stores it in session. page1.php - I want to be able to call this object back and run some methods on it to modify it's values. Except ...

 
 
2 hours later…
10:15 AM
0
Q: Object orientet programming method calls

user2086527Hi is there any way to do this (in PHP): I want to execute method of a from method of b class Is it good practice if it is possible or there is some pattern to be used class A { function start(){ echo 'start'; enter code here } function other(){ echo 'other; } ...

 
 
2 hours later…
12:34 PM
2 hours later…
 
 
3 hours later…
3:31 PM
1
Q: Placement of interface implementation, rules of thumb

Jeroen De DauwI have a number of situations where I have some BaseInterface that gets implemented by a bunch of objects. These objects also typically should implement interfaces such as Serializable or Counatble. Now it's unclear to me on when to have these additional interfaces be specified as being implement...

0
Q: Select records from MYSQL database grouped by day

funkyjimbobI have a database of records that have a timestamp asscoiated with them. I would like to pull records from the database grouped by day, so if there are other records with the same date (24 hour span) I would like them to be grouped together. Can this be done with MYSQL or will I have to pull the ...

 
 
2 hours later…
5:32 PM
0
Q: Is it okay have database logic in my Auth class?

DavidI have loads of domain objects which use data mappers to do the needed database work so the domain objects have no idea about the mappers or where the data is coming to keep a high level of abstraction. Now my question is I have an Auth object which I use like this early in my applications startu...

 
 
2 hours later…
7:11 PM
-1
Q: syntax error, unexpected T_PRINT, expecting T_STRING

rahul daglii'm getting this error: Parse error: syntax error, unexpected T_PRINT, expecting T_STRING in /homepages/26/d94605010/htdocs/lz/writecodeonline.com/php/index.php(190) : eval()'d code on line 7 Example: Class HelloWorld { public $word; public function print() { ...

 
1
Q: What does a domain object factory look like?

DavidI have a DataMapperFactory and I think I am doing it correctly and it makes sense to have one but I have a DomainObjectFactory too but it just seems pointless. This is it: namespace libs\factories; use models as Models; class DomainObjectFactory { public function build($name) { $c...

 
 
2 hours later…
9:19 PM
room topic changed to [php] [oop] feed: Just for easily keeping track of [php] [oop] tagged questions [feed] [oop] [php]
 
9:54 PM
0
Q: PHP - Which class invoked my static method?

RonaldI need to know what kind invokes a static method, without sending as parameter class foo { public static function test($clase) { echo "Class invoke:" . FUNCTION(); } } class A { public function x { foo::test(); } } class B { public function y { foo::test(); } } class C { pub...

 
 
2 hours later…
11:48 PM
0
Q: mvc Should I prepare container to set each variable(get result from controller.php < model.php, make the base view file, the each view file is node)

user1775888Below code is what I learning how to build a login system in mvc, I'm newbie. Now I'm confuse about few question 1. should I code in index.php like this?: <html><body> <div class="account_area">$acc</div> <div class="...">$var</div> prepare container to set eac...

 

« first day    last day (310 days later) »