• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting the Home.php in Controller and Welcome_message

#1
Hi there.

I just want to bring something under your attend,  and maybe I might be at fault here.

I am trying to build my very own cms and is busy using bootstap 4 for it and your online manual for cdi4. 

And here is the problem I have the online manual.

1) I want to to get rid of the Home.php controller and replace it with a Pages.php in the  controller and replace the welcome_message in the views folder. As per the online manual. But every time I try this I get the following message "Whoops, We seemed to have hit a snag. Please try again Later..." 

I have created a pages folder and have put inside that folder a home.php and a about_us.php files.

Please could you explain to me what I did wrong ? ( As i did copy the code from the codi4 website.)

Francois
Reply

#2
Take a look and amend the ./apps/Config/Routes.php, rem out the welcome_message and add a route to the Pages Controller.
Reply

#3
(04-22-2020, 02:27 AM)John_Betong Wrote: Take a look and amend the ./apps/Config/Routes.php, rem out the welcome_message and add a route to the Pages Controller.
Hi John.


Please see the screen shot I have taken. 

I am doing my cms webpage dosing on my laptop. Do you think it could be a bit slow ?

Francois


Attached Files Thumbnail(s)
   
Reply

#4
I do not understand your comment.

Try adding echo __file__; die; to the /Controllers/Page.php, make sure it is being called then proceed slowly by revealing more script.
Reply

#5
(04-22-2020, 03:50 AM)John_Betong Wrote: I do not understand your comment.

Try adding echo __file__; die; to the /Controllers/Page.php, make sure it is being called then proceed slowly by revealing more script.
There is something not right in codeigniter.

There should be a way to get rid of the welcome_message.php in the view folder. So that you can start working on you home.php  file and etc  and I don't have a welcome message in the routes.php files.

I have also try and set the Pages.php as the default controller.

Francois
Reply

#6
@shewolf255,
> There should be a way to get rid of the welcome_message.php in the view folder. So that you can start working on you home.php file and etc and I don't have a welcome message in the routes.php files.
>
> I have also try and set the Pages.php as the default controller.

From the supplied image I noticed that Home was replaced with Pages. Did you replace the other Home::index reference further below?

Code:
/**
* --------------------------------------------------------------------
* Router Setup
* --------------------------------------------------------------------
*/
$routes->setDefaultNamespace('App\Controllers');
$routes->setDefaultController('Home');
$routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false);
$routes->set404Override();
$routes->setAutoRoute(true);

/**
* --------------------------------------------------------------------
* Route Definitions
* --------------------------------------------------------------------
*/

// We get a performance increase by specifying the default
// route since we don't have to scan directories.
$routes->get('/', 'Home::index');
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.