Welcome Guest, Not a member yet? Register   Sign In
Attention Expert users: What are the things you wish you knew about CI when you started?
#11

[eluser]myerman[/eluser]
Wow, what a great question. Here are my half-baked thoughts....

1) Put the power of the MVC framework to work for you by doing the right work in the right places.
* Make sure that your models are where you muck around with data. Muck data once in the model, hand it off to controller(s).
* Make sure that its the views that handle display issues. Don't make your views muck data.
* Make the controller(s) the center of your universe.

2) Don't be afraid to have multiple controllers, such that you create a logical "API" for your web app. In the early days, I used to cram as much as I could into one controller, when all I really needed was 2-3 controllers for a more generalized and better organized approach.

3. Leverage every single library and helper you can find. Use the anchor() and form stuff. Learn how to use the HTML helpers, and the security helpers, and validation. A lot of stuff is waiting for you to use and cut time off your daily grind.

4. Don't be afraid to ask silly and/or dumb questions. I burned a lot of daylight trying to macho my way through, when just 2-3 well-placed questions could have saved me a lot of grief.
#12

[eluser]ngkong[/eluser]
5. read all code in libraries and helpers you want to use if possible. 100% understand the code, you will 100% understand how to use , exploit and hack those libraries/helpers. and of course, it depend on your php skill.
#13

[eluser]John_Betong[/eluser]
 
6. create a controller function debug() to test code snippets before cluttering existing code.
 
 
#14

[eluser]Crimp[/eluser]
7. Write a debug helper to assist you in the early stages of development. Mine contains formatted output for strings, arrays, query results and last query.
#15

[eluser]Taff[/eluser]
[quote author="Crimp" date="1210247928"]7. Write a debug helper to assist you in the early stages of development. Mine contains formatted output for strings, arrays, query results and last query.[/quote]

These are some great tips...is there a debug helper that already exists that anyone would recommend?

Cheers,
Taff
#16

[eluser]GSV Sleeper Service[/eluser]
I wish I knew about the poisonous snakes hidden in the system folder...

And Derek, you seem to be having some character set issues on your blog, lots of black rhombuses (rhombi?) with with question marks inside showing up
#17

[eluser]pgsjoe[/eluser]
How to actually USE a model. I was just dumping everything my controller. Didn't understand that model is just suppose to be a collaboration of functions.
#18

[eluser]llbbl[/eluser]
a better understanding of design patterns.
http://en.wikipedia.org/wiki/Design_patt...r_science)
#19

[eluser]webroasters[/eluser]
Quote:* Make sure that your models are where you muck around with data. Muck data once in the model, hand it off to controller(s).
* Make sure that its the views that handle display issues. Don't make your views muck data.

I couldn't agree more. This is essential. I've wasted a bit of time figuring this out, but he is spot on.
#20

[eluser]al042077[/eluser]
I see the comments about "muck with data in the model."

How do you handle dynamic items such as search parameters? Do you put:
Code:
if(!empty($this->input->post('myname'))
{
    $this->db->where('name', $this->input->post('myname'))
}
in the controller or in the model? On one hand, I'd say model as it's dealing with data. On the other hand, I'd say controller because it's receiving input from post and processing it appropriately.




Theme © iAndrew 2016 - Forum software by © MyBB