Welcome Guest, Not a member yet? Register   Sign In
Completely new to CodeIgniter
#1

[eluser]Unknown[/eluser]
I've used PHP a number of years but in an effort to learn better practices/cut down development times I've gone down the route of using a framework.

I started off looking at Laravel, then Agile Toolkit, and now settled on CodeIgniter. I'm working my way through the documentation but I'd appreciate some advice on my first project from the more experienced members here..

All I am doing is making a very simple directory. The front page will be a search box with a list. User enters a search term and it automatically filters the list. This list will be populated by data from a SERVICE table.

Finding a match, user clicks on the list item, it goes to another page with a list of companies found which match the service selected. So here's data pulled in from a COMPANY table.

Now I also need a login area for my admin so they can add companies and services. Therefore I need a USER table.

Now I could just go ahead and start coding this from scratch as it's very simple but I wanted to use CI because:

- I wanted something to handle db connections, user auth in a clean way.
- I want simple CRUD functions built in.
- I want to learn how to use a framework and testing on this simple app will be great for future.

So what I'm looking for is advice on how you would go about creating this using CI.

Bear in mind I am a baby when it comes to MVC. So I was thinking that my first step is really going to be to design the whole thing and then to code it.

Should I then code my models and actions (which I'm guessing are COMPANY, SERVICE, USER and add company/edit company/delete company etc...?)

And then ....?


As you can see I'm stuck and would appreciate some pointers from those of you who do this day in/day out!
#2

[eluser]pickupman[/eluser]
If you want to create all of the code yourself to learn, that is fine. However, there a number of helpful parts out there that may you on your way.
-[url="https://github.com/benedmunds/CodeIgniter-Ion-Auth"]Ion Auth[/url] is nice user auth library for handling your logins. Very easy to use, and actively maintained.
-Use a [url="https://github.com/jamierumbelow/codeigniter-base-model"]Jamie Rumbelow's Base Model[/url] to take care of CRUD.

Just plan out your database, then start with each piece of the site. Create the login system. (easy if you use Ion Auth as the views are already provided). Then design the home page, and the search box. Once you have that, the work on the functionality to build the landing page from the search click.

CI is still PHP, it just gives alot of default functions/methods to create sites faster. It's structure can also help keep your files organized.




Theme © iAndrew 2016 - Forum software by © MyBB