«« Next » « Previous
«« Next » « Previous

Link Details

Vote up, vote down. It doesn't matter which - just vote! Login and vote now.
Link 66630 thumbnail

By jmathai
via jaisenmathai.com
Published: Feb 19 2008 / 12:11

This step by step guide will help you get set up with EpiCode in under 15 minutes. EpiCode is a framework that maps URLs to static methods. It also has a few utility functions to make templating completely painless.
  • 7
  • 5
  • 2669
  • 1123

Comments

Add your comment
User 225823 avatar

c-ovidiu.tk replied ago:

0 votes Vote down Vote up Reply

Interesting. Reminds me a bit of Django. It would be very useful if you could use regular expressions as routes and pass the capture to the called method (like Django does).

User 247828 avatar

jawngee replied ago:

0 votes Vote down Vote up Reply

Meh.


What's the point of using static methods as handlers?
,

User 225823 avatar

c-ovidiu.tk replied ago:

0 votes Vote down Vote up Reply

Well, what's the point of creating an instance of a class and calling a method (like most of the frameworks do)?

User 274425 avatar

jmathai replied ago:

0 votes Vote down Vote up Reply

Here are the reasons I considered...

1) you create a namespace so you don't have to worry about collisions.
2) you don't have to invoke a constructor or store a reference to an object in memory for only calling one method
3) with classes you can have super and subclasses

User 233461 avatar

antych replied ago:

0 votes Vote down Vote up Reply

down vote for reinventing the wheel, does every php developer has to go through a phase of building his own framework? btw. I wouldn't go as far calling this a framework...

User 274425 avatar

jmathai replied ago:

0 votes Vote down Vote up Reply

I had originally use Picora which I liked. The main reason I did this one was so that I had a framework which did exactly what I needed. Some of us like to know exactly what's going on under the hood. Even though frameworks like Symphony and others are open source...it's not that realistic for have a good understanding of what happens when you call a method.

The question I'd ask is why do most php developers blindly pick a framework and use it. Especially when they only use a small subset of it's functionality.

User 233461 avatar

antych replied ago:

0 votes Vote down Vote up Reply

Use Zend Framework, you can pick any part of it you need. If something is missing, contribute. And if you want to now how it works read the code and run it in a debugger. You are suffering from "not invented here" syndrome, which surprises me considering your experience.
And you don't have to pick anything blindly, there are many to chose from, you can read about them, ask around, try them out, just don't create another one... if you need a small subset of functionality pick a modular one

User 206896 avatar

rockstar101 replied ago:

0 votes Vote down Vote up Reply

antych: If you would strip Zend down to do exactly what this small framework does, how big would it still be? I guess what I am wondering is that if you would only use the parts that this framework does, would it still be overkill for a smaller project? (Sorry that I am not very familiar with Zend. I know of it, but I've been mostly sticking with CakePHP and CodeIgniter).

User 275194 avatar

bpopp replied ago:

0 votes Vote down Vote up Reply

I second the vote for ZendFramework. It does exactly what you're doing here, but seems to have more extensive route support (regex, etc). The really nice thing about ZF is that it is designed to be extended. It's a large framework, but you can take as much or as little as you need. I've replaced the templating engine with smarty and the model with a more robust ORM model (the existing Table class sucks, IMHO). I've tried Cake and CodeIgniter (and a handful of others) and I prefer ZF by a lot. CodeIgniter was my previous favorite because of it's simplicity. Cake is too bloated and has too much Rails envy.

Personally, I don't like having to setup routes statically. What I'd really like to see (and am in the process of writing), is a more complex routing system than what you see in most frameworks today. I would like to be able to create a hierarchial controller folder:

Controllers
Core
Users
PeopleController.php
PermissionsController.php

which would be triggered when someone did a request for: (for example)

/core/users/people/add/
/core/users/permissions/edit/?id=5

With ZendFramework, you are currently limited to only one level (or two if you use modules). For big projects, this can lead to big, unorganized controller folders.

User 274425 avatar

jmathai replied ago:

0 votes Vote down Vote up Reply

@antych, I don't disagree with what you said. I'm not opposed to using something that already exists. I'm a huge fan of YUI, prototype.js, Picora and numerous other packages.

But if noone ever tried to reinvent the wheel we'd be driving around with rocks on our cars :). My theory is that the best way to learn how something works is to do it yourself. I only began to truly appreciate prototype.js once i picked it apart and started writing my own mini libraries. However, I still use prototype.js for all the projects I do.

I'm not familiar with Zend's framework. I'll check that out. Also, if anyone is interested in small frameworks then have a look at Picora: http://livepipe.net/projects/picora/.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (7)



Voters Against This Link (5)