Jump to content

How to convert a codeigniter website to a PW website?


Recommended Posts


My client has come to me with a website that has been developed in CodeIgniter by someone else and wants me take over it for some design changes.

The website is basically a directory listing of various of books, movies, events etc. related to a specific topic. So this is heavily database driven.

I know basic PHP, and have been using ProcessWire for a while now (though not yet an expert at the APIs). I have no knowledge of how CodeIgniter works.

What I will be needed to do is to change the design of some elements a bit, and add a couple of fields of information in the database.

My questions are-

How do I convert this website into a PW website?

How long will it take just for the conversion?

Do I need to learn CodeIgniter for it?

Link to comment
Share on other sites

26 minutes ago, GradDev said:

How do I convert this website into a PW website?

Carefully and well planed.

Parts of it could be migrated via API I guess and some parts need to changed manually. It all depends on several details we don't know, yet.

26 minutes ago, GradDev said:

How long will it take just for the conversion?

Based on the details you provided... somewhere between a few days and a year. Plus the design part.

How much books, movies, events, etc. need to be migrated? 
How many templates are needed?
How ... ?
What ... ?
Who ... ?

Hard to say actually. We don't know anything about the site, the data, the functionality. 

26 minutes ago, GradDev said:

Do I need to learn CodeIgniter for it?

You should at least understand whats happening in the code itself. As you you didn't mention any eCommerce stuff or bookmarking or recommendation features there seems to be not that much of functionality in the code and therefore I guess it will be only be common template logic and maybe some data management. The hardest part will possibly be the content and data migration. As soon as those are in ProcessWire it should be a piece of cake.

  • Like 2
Link to comment
Share on other sites

Thank you for the quick reply!

Okay, so let me make this clear that the website is not live yet. And just has been freshly developed. It is hosted on a server and I will be given the login credentials for the FTP and Database. The client had some issues with the prior developer so they left the project incomplete AFAIK.

Hence, not much content to migrate. Maximum of 100 entries might have been done. More entries will be done after I complete the redesign.

1 hour ago, wbmnfktr said:

How much books, movies, events, etc. need to be migrated? 
How many templates are needed?

The templates will be needed are as follows-

Movies list page, Individual movie page, books list page, individual book page, events list page, individual event page, home, about us, contact etc.

I think many of these designs will already be ready in the project. I just need to know where I can find them and modify them. Even if I get the directory with the HTML/CSS design files, that would be great.


Link to comment
Share on other sites

Ok... the hardest part seems to be stripping out/receiving all current database entries in order to migrate them in one way or another.

Working remote on the server might work somehow but I would try to get a local copy. That's most often way easier to handle.

The templates shouldn't be a problem either. At least it looks kind of easy and seems to be pretty normal.

I actually don't know the structure of CodeIgniter projects but I guess you should find all necessary parts (HTML, CSS, JS) pretty easy.

You might want to take a closer look into things like preprocessing (SCSS, Less, JS) and automation of some kind. Every developer uses his tools and quirks so there still might be some caveats ahead.

Link to comment
Share on other sites

I've been working with CodeIgniter for over 10 years, and although the general framework structure is predictable and documented, the custom code and database layout that has been developed with it could be... anything!

You don't really have to learn it, but being aware of how it works might be useful in extracting the bits you need. I think these two documentation pages will be most helpful at this stage:

As a rough guide, the URL patterns (/foo/bar) of a CodeIgniter app usually map directly to controllers. These should be in the application/controllers directory, and each file in here is a class. The example URL route of /foo/bar would call the bar() function in the Foo.php controller.

Within the controller, it should (might!) call some 'models' - responsible for database interaction - and pass the result data into the 'views'.

The views are responsible for transforming the data and results into HTML code that is sent to the browser, so this is likely where the main page layout should be, along with the different code for producing the different lists and detail pages. These live in the application/views folder.

By default, there's no templating language or library used (like Twig) - the views are just mixed HTML and PHP, like ProcessWire, so should hopefuly be easy enough to follow.

In terms of the database, you will need to look at how the current one is set up. With any luck, you could probably map each database table (books, movies, events) into PW templates of the same name, and set up PW fields that correspond to the columns in the database tables.

After that, you would need to address any relationships or links between the tables or records, and decide on which PW structure will be best. For example, parent/child pages, Page reference fields, or creating a tagging/categories setup.

If there's any budget for the project, I have some time over the coming weeks and would be happy to help you in the right direction if you think it would be useful 🙂


  • Like 1
Link to comment
Share on other sites

It seems that the website is very simple in its structure: lists/details structure.. maybe even with the ProcessBlog module and using categories you can make the whole site.

If I had to do it, I would do the following process without having to study another platform or make new code:

- I would use a scrapper software on the current site and export the data to a csv file with the fields and names I want.
- I would create the templates in PW for the parent listing page / child detail page for each data model or use only one for all with tags/categories, depend on your idea
- I would use the ImportPagesCSV module to create all pages in only one step

All this you can do without having the html+css design implemented. I think that having the idea of fields and templates, this would not take me more than 4 hours of work.

If you don't have access to a scrapper software, there are some extensions for chrome that can help you, or you can make a small code and use https://github.com/paquettg/php-html-parser.

The idea with this is to avoid understanding CodeIgniter or the database.

I have done this before for marketing affiliate pages = 100% Guaranteed 🙂

  • Like 2
Link to comment
Share on other sites

4 hours ago, Pixrael said:

If I had to do it, I would do the following process without having to study another platform or make new code:


I did something similar recently, which was surely easier than learning a system I was not really interested in. My trick was to inject the "old record ids" of the old system into its markup (so I only had to understand a little bit its templating), afterwards complete page contents were grabbed and were saved into PW's CKEditor fields and from then on I performed some careful planning and PW template/field works – based on the required relations – and lastly I used php-html-parser to turn the static CKEditor field markups into relations.

  • Like 2
Link to comment
Share on other sites

Thank you all for the inputs. Really appreciate it.

I will be learning the basic structure of CodeIgniter for now. In the next four days, once I get the FTP handed over, I will go ahead and decide how to go ahead with this.

If needed, I will come back to this thread for support and then also to update how I went ahead with it so it might help someone in the future.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By TheoTop
      Hello, all !
      I wanted to post this message on dev, but i can't ! 
      So, i use tu use codeigniter to develop specific projects and , i really like the philosopy of processwire ! 
      So between, the two solutions, i don't know what to do ! My problem is that , my developpmet skills are pretty low, and develop wit h codeingiter is really easy!
      I'll develop a specific application with account , events, payments ... Is it, for example easy to use a payment solution ? 
      I'm affraid to be locked with processwire dut to  my development skills, even if it doesn't seems too hard to use !
      What is your advise , for a meduim skill developper ? 
      Thank you
    • By FvG
      Hey guys,
      I want to manage some contens for a site running on CodeIgniter using PW.
      But as I try to access CI, I get this error: Unable to complete this request due to an error.
      I tried these ones, both return that error.
      <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require __DIR__.'/../../cms/index.php'; class Processwire extends CI_Controller { public function index() { echo '<pre>'; var_dump($wire->pages->get('/news/')); } } /* End of file suche.php */ /* Location: ./system/application/controllers/processwire.php */ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Processwire extends CI_Controller { private $wire = null; function __construct() { require __DIR__.'/../../cms/index.php'; $this->wire = $wire; } public function index() { echo '<pre>'; var_dump($this->wire->pages->get('/news/')); } } /* End of file suche.php */ /* Location: ./system/application/controllers/processwire.php */ Any Ideas what might cause the error? PW doesn't log anything, even with debug turned on.
      It it CI specific, as I can use the same code using a independent php file.
    • By ruzel
      I'm building my first brand new Processwire site! It's easy and looks really extensible so I'm excited. However, I have a codeigniter app that is going to eventually sit in a directory beneath Processwire and I want to store assets like css, js, and images in a top-level directory that both CI and PW will access.  Right now, I've accomplish this by using tags like
      `<img src="<?php echo $config->urls->templates ?>../../assets/images/russellbits-logo-small.png" alt="Russellbits"/>`
      Works fine, but it's messy.  Is there another way I could do this in PW without making an http call?
    • By onjegolders
      Am very happy that I have found PW for building my general client websites. It really suits the way I work perfectly.
      I have started learning Codeigniter recently also with a view to creating my first web 'application' (if I have grasped the correct meaning...)
      The idea being that it will take the form of a community website with users and that content will be created on the fly rather than through a "back-end".
      Now I am pretty sure that PW can manage something on these lines, I was just looking for some good, experienced, honest input from the great community here on the differences between building this with PW or CI.
      Differences that I can see from the start -
      PW provides an admin side
      CI provides several helper classes for things like email and forms
  • Create New...