Please Help with routing |
reading the docs will explain everything thats true, but a little guidance to get you in the right direction .We all need a little help :^)
At some point there will be updates and probably updates for additional software you don't know of yet and don't think you need when you do its going to be easier with composer. So i would say give https://getcomposer.org/ a good read first. There are options for CI4 , my preference is for appstarter which you can install using composer. I have a core appstarter called basic to play with some concepts i'm learning. When you use a command terminal and cd say to Desktop and use this command: Code: composer create-project codeigniter4/appstarter --no-dev Code: php composer.phar create-project codeigniter4/appstarter --no-dev Code: basic your controllers go in contollers, views go in views and then for css, images such as logo that won't change , go to public and make directories called " images", "css" "js", "sounds", . Then put your assetts such as your css in css directory..sound clips in sounds.. yep you got the idea. I'm using sqlite database and i put those 2 in writable, because yep its writable and a database needs to be written too . Last bit to display appropriate page for domain.com/cities you create a route in Config/Routes.php lets say: $routes->get('/', 'Home::index'); //above is home route it uses Controller Hone and method index $routes->get('cities', 'City::index'); "cities" tells system that when it gets a get request with domain.com/cities it should use a controller called City.php and its method index() { } inside the method index you tell system what to do . read docs on getting started. |
Messages In This Thread |
Please Help with routing - by jnar - 11-03-2020, 02:46 PM
RE: Please Help with routing - by InsiteFX - 11-04-2020, 12:07 AM
RE: Please Help with routing - by captain-sensible - 11-04-2020, 02:02 AM
RE: Please Help with routing - by jnar - 11-04-2020, 06:19 AM
RE: Please Help with routing - by jnar - 11-04-2020, 08:12 AM
|