Jump to content

Archived

This topic is now archived and is closed to further replies.

jagguy

cant run hello world

Recommended Posts

Hi,

 

I installed cakePHH on my win 7 , apache, easyphp laptop.

php files work fine but I cant get anything to run with cakephp which is extracted where I can run html files.

I set fatabase config file, ran index.php and everything seemed fine until i tried to do something

 

my error is

Missing Controller

Error: UserController could not be found.

Error: Create the class UserController below in file: app\Controller\UserController.php

 

And I followed

 

http://www.grasphub.com/2013/01/print-hello-world-in-cakephp/

 

 

 

 

Share this post


Link to post
Share on other sites

I don't have any experience working with CakePHP, but in the example you followed: 

 

 

Create users_controller.php in your app/controllers folder with following codeset.

<?php
class UsersController extends AppController
{
var $name='Users';
function index()
{
}
}

?> 

 

 

Since the error is pretty straightforward, you should check that you have named your controller right. 

Share this post


Link to post
Share on other sites

Some personal advice....install wamp, start out with procedural type coding and then move onto more advanced stuff like oop(object oriented programming) and mvc(model–view–controller).

Share this post


Link to post
Share on other sites

Some personal advice....install wamp, start out with procedural type coding and then move onto more advanced stuff like oop(object oriented programming) and mvc(model–view–controller).

I am already doing this? strange advice.

Share this post


Link to post
Share on other sites

Let me explain better.

 

Just because it reads WAMP(windows,apache,mysql,php) does not mean it's wampserver

 

you:

easyphp uses php version 5.4.10

cakephp is oop and mvc (advanced,must use cakephp framework, have an idea about classes and objects,create a model,view,controller structure)

 

suggestion:

wampserver uses php version 5.5.12

actually learn php coding at php.net and start out using procedural style

then move onto oop

learn a framework optionally after you feel confident enough, can then decide if actually need all the bloat and to learn a framework

cakephp is not the most preferred framework, something like zend or symphony would most likely benefit you more.

 

If you still want to continue with cakephp, I suggest using from cakephp's site and not some random website and code.

These actually work, I can attest to the fact because have done them all.

http://book.cakephp.org/2.0/en/index.html

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.