CodeIgniter Forums
About general Style and Sintax - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: About general Style and Sintax (/showthread.php?tid=38822)



About general Style and Sintax - El Forum - 02-20-2011

[eluser]Unknown[/eluser]
Hi everyone,

I was reading about general Style in user guide and i've got two things what i don't understand:

-The first one is about the name of the tables in the database.

Why it's necessary to use two prefix rather one?

What mean then "exp_" prefix ?

For example, I have a database with a prefix for tables called "own_". Then in my database.php file I have:

$db['default']['dbprefix'] = 'own_';

Now, according to the user guide I have to change it for :

$db['default']['dbprefix'] = 'exp_'; and late to use in my query string "... FROM own_my_table;"

¿ ...????

-The second one is when it says that we must use LD and RD constants instead of {, or }. Then, Does it mean that ... :

INCORRECT : echo "hi {$_POST['name']}"
CORRECT: echo 'hi'.LD."$_POST['name']".RD; ???

I don't understand.... why have I that use LD({) and RD(})?

Looking here: http://ellislab.com/codeigniter/user-guide/general/styleguide.html --> Constans

To conclude , What mean pi, ext and mod in this example ? :

class Pre_email pi.pre_email.php
class Pre_xml ext.pre_xml.php
class Pre_import mod.pre_import.php

thanks a lot.


About general Style and Sintax - El Forum - 02-20-2011

[eluser]InsiteFX[/eluser]
For one those are just recommended ways of doing it, nothing says you have to do it that way!

Do not use $_POST use CodeIgniters input->post

InsiteFX