A few months ago, we jumped into Teeorama, a PHP based online tee-shirt store front end for Spreadshirt. We finally completed the project and we’re planning on opening it to the public tomorrow. By the way, if you feel you could use a new Geek shirt, please head over to teeorama.com before reading on…
- It’s always interesting to play with new code. You get to see how other people/framework solved common problems, how some libraries make this or that easier to use for the developer. You also sometimes realize some other things are carried out better in the framework you are used to. Either way, it is a good learning experience.
- Also, I wanted to stay away from the stack we use at work to not be tempted and not be able to just copy over bits of our blueKiwi framework into my code
So, I picked CodeIgniter and jQuery to build my website. In the end, I am very pleased with the experience of working with these two tools. CodeIgniter is exactly what it claims to be: a very light but powerful framework that does not try to command the way you work. Of course, jQuery is just as powerful as its reputation. It’s incredibly easy to get used to and I haven’t found anything it couldn’t do.
This is also possible though it does involve some minor tweaking of CodeIgniter base code.
First, here is my chosen folder layout
Second, as I said, I made the web folder the target of my Apache virtual host.
Here is my virtual host for this application
RewriteCond $1 !^/?(index\.php|test|images|web|js|css)
RewriteRule ^(.*)$ /index.php/$1 [L]
Finally, in order for all this to work, you need to tweak a couple of CodeIgniter files
define the system and application folders paths as follow in index.php:
$docRootPath = dirname($_SERVER['DOCUMENT_ROOT']);
$system_folder = $docRootPath."/application/libraries/codeigniter";
$application_folder = $docRootPath."/application";
Also, modify the CodeIgniter.php file at the bottom of index.php to:
Finally, edit CodeIgniter.php in order to replace all occurrences of “codeigniter/” by “” (nothing)
You should be setup. Happy coding!