Category: Development

  • How to advance our CMS in CakePHP

    At the end of part one, we had a working CMS.  Well, at least it was saving files and they could be displayed to the public.  In today’s article, we are going to further advance our CMS.  We will cover the following items:

    1. fckEditor
    2. Revisions

    (more…)

  • How to create a CMS with CakePHP

    I really enjoying writing code and I find that snippets just don’t always cut it for me.  So in today’s article, I am going to describe the process of creating a CMS (Content Management System) with CakePHP.

    This will be a two part article, in part one we will focus on getting the basics working.  The basics will include ability to add, edit, and delete static content pages.

    Part two will advance on our basis and allow us to create drafts and revert back to previous versions.

    (more…)

  • AJAX Select box in CakePHP

    When I created my first personal CakePHP web site, this was something that had me quite frustrated.  I struggled and struggled to figure out and understand how to do a simple “if I change this select box, how can I populate another one”.

    I had previously done this a million times in other languages with a simple Javascript onchange() function that would do my AJAX and populate my other select box.

    To solve this problem, I checked CakePHP’s web site and did not find anything useful.  Don’t forget this was almost a year ago, I find the web site has come a long way now.  Because I couldn’t find a could example, I did the next best thing, I dove write into the form helper and ajax helper.  Shortly after, I found enough information to start my trial and error process.

    Excellent, now we are getting some where.  Now that we know this, let’s create our two select boxes and make our second one populate through AJAX. (more…)

  • How to setup a route in CakePHP

    If you are like me and are creating personal web sites, one of the best ways to gain traffic to your site is through SEO.  I won’t go into detail here as I want to focus on how to setup a route in CakePHP, but having SEO friendly URLs will go a long way in helping.

    First let’s define what a “route” is.  In CakePHP it allows you to add a different path to access a specific controller and/or function in that controller.

    For example, let’s say I want to create a CMS.  I might create a controller called “StaticContent” and then place a function for each page a client would like to create.  I’m pretty sure I would start getting a lot of calls saying, “Jamie, why is my URL http://www.myaddress.com/StaticContent/myCustomPage?”  So to avoid those calls, we can use a route to make it more accessible and SEO friendly. (more…)

  • How to create a socket server in PHP

    Ever want to build a chat application or perhaps even a game? If so, a socket server will help you get started. Once you understand the underlying functionality of creating the server, enhancing it is just as easy.

    The way a socket server works is, it will be running continously and waiting for a client to connect to it. When a client connects, our server will add it to our list of clients and begin waiting for messages from that client.

    Without further adieu, here is the full source code:

    (more…)