I have a class called numDisplay containing several methods. Most of those methods need to use a method from another class called prefs which is contained in another file during the course of their duties. I think I could include the file, instantiate the class prefs and then access the method i...
I know that you can use nested functions in PHP. Here is the question: I have this code: class ClassName { private $data; function __construct() { } public function myFunction() { if($condition1 != NULL) { ...
I am getting this message on going to several pages: Warning: session_start(): Function spl_autoload_call() hasn't defined the class it was called for in /var/www/library/session/session.php on line 18 This is the file that is creating the calls: <?php namespace iX\session; ...
for to reduce number of queries, when i select something from my database i want to launch the best possible one, which can be one of these: 1- SELECT ... FROM cities JOIN states ON city.stateID = state.stateID WHERE city.cityID = ... 2- SELECT ... FROM cities WHERE city.cityID = ... 3- SELECT ....
I am digging into some Magento code. I'm looking at class Mage_Catalog_Model_Session There is code in class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template function getCurrentOrder like this: Mage::getSingleton('catalog/session')->getSortOrder(); Now, Mage::getSinglet...
I am very new to PHP Object Orientated Programming so was wondering if I could get some good advice on a database object I created. I call the class db and include my class into every page load and initiate the database object using $db = new db. I then call the method inside this for each acti...
How to decide which php technique to use when building a website like MVC, OOP, etc...? What criteria should be considered to decide? And what type of website MVC is good for?
Apologies in advance for the complexity of this question! After reading about the Data Mapper pattern here on Stack Overflow, I'm in the middle of refactoring the Model layer of my own PHP framework. It used to have a ActiveRecord-like implementation but it was getting too complex. A model tha...
i'm newbie in MVC (using codeIgniter as my example) and i have read MVC fat model and skinny controller for like 3 times, what i got : model does the hardwork while controller calls the model and passes the data to be rendered by view but i have one confusion , example i have an admin page th...
I wrote a quick CI library class to render my pages so I wouldn't have to keep typing '$this->load->view' all the time and for DRY. Now when I re-render my contact form after passing in invalid data the error messages aren't showing up. The library class: class Page extends CI_Controller { ...
« first day (32 days earlier) ← previous day next day → last day (278 days later) »