naming convension in the action classes, files and folders

Asked by hleinan on 2009-10-31

I am looking at your framework, and it really looks clean and elegant!

However, I am trying a fairly simple thing and that is to add actions with a simple echo statement in the doGet function, just to see if the correct class gets exetuted. However, i am getting a 404 when it should (at least based on my understanding of the framework) print the simple echo statement:

Let me add a few examples:
I am adding Admin.php to the actions folder:

class Admin implements MessageAware, {
 public function doGet () {
  echo "I am in /actions/Admin.php";

This prints "I am in /actions/Admin.php" in the browser (http://localhost/admin).

However, renaming the Admin.php to _Admin.php and creating a folder named admin, and then adding Test.php to tis folder:

class AdminTest implements MessageAware {
 public function doGet () {
  echo "I am in /actions/Admin/Test.php";

Here a 404 is rendered (http://localhost/admin/test/).

What am I missing here? And what is the naming convension of the files, folders and classes for the actions? See that the php files are named with a upper case first letter, but the items folder (from the example application) is written with lower cases. Also, the classes in the items folder are named like FolderAction (like ItemsDel) in CamelCase.

One last thing; in the documentation (README) it says in chapter 3 (Actions and action mappers); appropriately named
DefaultActionMapper, as can be seen in config.php. I cannot find a config.php! Is this something that has been changed from earlier check-ins?

And I should add that I really like the way you have implemented this framework! I have been searching for a great framework for ages (looking at a large number of php, ruby, python, erlang, .net (among some) frameworks, and some of them are great (Like Django, and Yii and CodeIgniter for php, but all of them are eighter too hard to modify to fit my needs, or have too much magic going on in the back that takes years to fullly understand. And even if the ORM and the controller part are good enough, the view (template) part is always a problem (At least my experience) . Django is the one closest to what I am looking for, but not too many web service providers support Django so it is hard to use Django for a general purpose application like a cms))

Question information

English Edit question
Kolibri Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
hleinan (hleinan) said : #1

Ok, I found the error... The file name needs to be the same as the class name. Sorry, didn't see that one.

Once again; great framework. Was able to implement the H2o template engine in about 10 minutes, and that's what I call flexible!