-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Well as I mentioned before that block of code is superfluous, declaring the variables globally [as you have] makes them global already. Try adding this to the top of your file and check if an error is being triggered: ini_set('display_errors', 1); error_reporting(E_ALL);
-
... and the problem is? Edit Noticed this block: global $franchiseSiteAddress global $franchiseSiteAddress1 global $franchiseSiteAddress2 global $franchiseSiteLocality global $franchiseSitePostcode global $franchiseSiteCountryName global $franchiseSiteContactNo 1) You're missing a semi-colon after each declaration 2) Declaring them in the scope you have they're already global
-
Where you try it shouldn't matter, but why do you need a bookmark button? I think every browser these days, at least the popular ones, has the option to add a page at the click of a button.
-
Well it's not so much the code as the concept. I autoload objects not included already and instantiate them the usual way, no object factory or anything like that. The config object of course is different, I want to be able to call this object from any class, anywhere in the framework whilst preserving the added properties. The classes themselves are for the most part just standalone objects. There's a bootstrap type file which basically pulls everything together and instantiate the application class, passing the controller and action (that are derived from the route library) in as parameters. The application class mostly just instantiates the controller, calls the method and provides the top level exception catcher. Temporarily I just took a CI style approach and created a get_config() function that returns a singleton instance of the config object. I don't like that style but, stuck for other ideas..
-
I really want to punch Justin Bieber in the face!
Adam replied to Orionsbelter's topic in Miscellaneous
Aye that's him, didn't think his album was out yet.. -
Thanks for the response. I was thinking of a kind of master application class, but wouldn't extending it each time create a new instance of the object, not retaining any new properties added? I understand obviously Zend do it but I'm not sure how, or just having a mental block.. My config class isn't at all as complexly wrapped as Zend's, currently it's just a stand alone object. It will parse ini files used for standard configuration, but the majority of the properties are added as the program flows. The properties themselves are stored within a multi-dimensional array as a class property and called/stored through ->get() and ->set() methods. For example: $config->get('path.href_base'); Would return $this->properties['path']['href_base'] - it's pretty simple but I like it. I like the functionality of it in general at the moment, and the way everything is tied to the config object, but struggling to make it global (without actually making it global if you get me).
-
Hey up. I'm in the midst of writing my own framework based on the "MVC" architecture. I know there's already hundreds out there you could use, I'm not trying to re-invent the wheel this is more for the learning experience. I'm just curious about how others would implement the config object? I build up an array of properties throughout the code that I'd like available to every class within the code base. I know a lot of people here disagreed about the use of the singleton pattern, and globals in general, last time I mentioned it. So I'm just curious how would you do it? Thanks Adam
-
I really want to punch Justin Bieber in the face!
Adam replied to Orionsbelter's topic in Miscellaneous
I think it's the kid who won the x-factor or something. -
I really want to punch Justin Bieber in the face!
Adam replied to Orionsbelter's topic in Miscellaneous
Player. What she say? -
Brilliant. [attachment deleted by admin]
-
http://www.theregister.co.uk/2010/04/01/lhc_fifth_dimension_incursion/
-
You could also use array_values to reorder the keys, as your example does.
-
It's not a typo. "===" performs an 'identical' comparison, meaning it compares the data type too. http://php.net/manual/en/language.operators.comparison.php
-
You'd be best off finding out why it doesn't work for certain people (i.e. which browser they are using) and patching what you have. While jQuery claims to be cross-browser (including IE6) I have found bugs in IE6, unfortunately though can't think what they were off the top of my head. jQuery should be more than capable of achieving this though..
-
I'm not sure what advice we can give you on how your client should install your CMS?
-
Roughly 5 years ago when I was about 15 years old, with very little knowledge I volunteered myself to put together our newly formed Day of Defeat clan site (as it was a requirement to join the Enemy Down clan ladders). It was a shocking failure of course, but got the job done. After that I discovered PHP, and now 5 years later I work as a PHP developer.
-
How are you storing the content; a database?
-
And you're friend (who I assume must have some knowledge of browsers to want to view the source) is incapable of just viewing the source themselves?
-
Aha, just as shocked as you!
-
i'll quite while I'm ahead
-
Okra pods?
-
Generate new pages that are automatically linked?
Adam replied to morocco-iceberg's topic in PHP Coding Help
What experience do you have working with databases? -
Generate new pages that are automatically linked?
Adam replied to morocco-iceberg's topic in PHP Coding Help
By separate pages I assume you don't literally mean a separate file? You'll want to store the article within a database, most likely MySQL. Then you can pass the ID (or some piece of data that can identify the article) through the URL to a file, e.g. view_article.php?id=###. Within the file you'll look up the article in the database and display the contents. On the front page you can simply query the database to return all the articles (or say the most recent 10) and generate the link based on the ID (or the data you use to identify the article). -
The files aren't linked. I think you'll have to return the modification time of both files and check which is the most recent; then display that one.
-
You may want to look into the filemtime function.