Monday, February 22nd, 2010
I’ve been coding away all week, that is between my other jobs at home
In all my ‘wisdom’ and persistence i made a small app with Yii which stores data in an array and serializes it into a db, and a basic CRUD, a proof of concept to see if the framework was capable of doing this and in the fastest way possible.
No problem so far, getting it is simple, but apparently you Yii doesn’t permit everything. So you need a $temp variable to store the model data in, suffice to say that it isn’t really the shortest route to take nor in my opinion the fastest bus alas I have to do with it. This little app of not more then a 60 lines of code took me four days, four damn days to figure out the error, honestly if we have methods to ’save space’ in your coding why not permit them?
I’m not going to bother everybody with my nagging so, I’ll stop here.
For those who want to see the topic on the yii forums.
Posted in General, Projects, tutorials | No Comments »
Monday, September 7th, 2009
Yii framework (yiiframework.com) is a very fast php5 framework. At first it seems like a jungle in the code, everything is put into motion to make the framework very fast. It’s been really a steep lurning curve, even if you seen oop programming, alas seen it in a totally different way that corresponds to nothing in yii. So you have to adapt to it’s style of coding, writing and thinking.
It’s not a regular MVC framework, yii had a module concept integrated, if you want to use it that it. Tinny mini applications, pull them out and they don’t work but in the larger application they work just fine.
The logic as said is a bit different, in the configuration of the app you got one large file that has everything in it, but it’s messy, so i sacrificed a bit of my speed to put it into separate files, separated db config and routes as this gave a more clear picture of the code and you find your environment variables really fast, if you need to switch dbs
The documentation of yii could be better, some things are left up to your sense, chuncks of code are left out instead of leaving the whole things standing which would be far more handy. Luckily for he who wants to contunie with it there is a good forum with dedicated people answering even the most idiotic questions.
Posted in Technology | No Comments »
Monday, July 27th, 2009
I’m attached to codeigniter, I know my way around but codeigniter as a a easy to use but now I want something more darring and so this is it, Symfony framework, I think I’ll be doing that in my vacation that starts in about a week
Posted in me | No Comments »
Tuesday, June 30th, 2009
redirect()
Does a “header redirect” to the local URI specified. Just like other functions in this helper, this one is designed to redirect to a local URL within your site. You will not specify the full site URL, but rather simply the URI segments to the controller you want to direct to. The function will build the URL based on your config file values.
The optional second parameter allows you to choose between the “location” method (default) or the “refresh” method. Location is faster, but on Windows servers it can sometimes be a problem. The optional third parameter allows you to send a specific HTTP Response Code – this could be used for example to create 301 redirects for search engine purposes. The default Response Code is 302. The third parameter is only available with ‘location’ redirects, and not ‘refresh’. Examples:
if ($logged_in == FALSE)
{
redirect('/login/form/', 'refresh');
}
// with 301 redirect
redirect('/article/13', 'location', 301);
This was the excerpt from the codeigniter userguide but what they don’t really tell is the essential:
redirect(‘controller/function/param’, ‘refresh’);
Posted in Technology, tutorials | No Comments »
Saturday, March 28th, 2009
I’m working on a website system an facing this problem where and how to store my configurations in the database. So you want to store your configuration vars in a configuration table in the database, that’s great and fun to do too.
Why do it?
Your application becomes easier to update to a newer version, most of the time, when creating a newer version you will strip – change – add some variables for configurations, with a database it’s easier and you (or the admin) can change things on the fly.
How?
One or more tables like this:
Mysql table:
+------------------+
| config |
+------------------+
| id |
| name |
| value |
+------------------+
If you want you can add an selection column to get only the ones needed for that function but this is the best way when being in a development environment I think
Posted in tutorials | 1 Comment »