Welcome Guest, Not a member yet? Register   Sign In
{SOLVED}Can I do this with Code Igniter?
#1

[eluser]Netixon[/eluser]
Hello,
I'm really new to CI but one of my friend suggested me to try for my project.

We are a group of 50+ people from different countries that offer different online services. Now I'm trying to explore different options to build a quite large portal. Before I really start to study hard all the Code Igniter I'd like to know if at the end I will be able to do something like this (I just want a YES or NO answer, no need to explain me how):

ADRESSES

I've seen that we can extend classes with some PHP code. What I'd like to know is:

1) Can I have a structure like this:

/intl/uk/
/intl/uk/services/translations/
/intl/uk/services/marketresearch/
/intl/uk/services/marketresearch/methodology
/intl/fr/
/intl/fr/services/traductions/

/global/services/translation/chinese/
/global/services/marketing/seo/

etc..etc..etc....



2) FROM YOUR EXPERIENCE, IF I do now a database that has got a LOGICAL error, how much does this influence Code Igniter? How long COULD it take to fix the error on the Code Igniter code?
I'm studying a lot about databases this week but still I think that since this is the first time I do one I'm very likely to make some basic error (wrong PK or wrong association table).




3) Very DIRECT and STUPID question, if in the database I have a table called PAGES (with pages in 30 laguages, some go to the "national" websites and some for the "global" website, how can I tell WHICH page is retrieved on which page? Does CI give me this possibility?


Thank you very much
#2

[eluser]Anonymous[/eluser]
1) Yes you can
/controller/method/etc

2) What do you mean ? got database problems ? Post your DB scheme.

3) You can do this on URI base. You would read out the first (or whatever) uri segment and write your query on that value.

Simplified:
Code:
http://somedomain.ltd/intl/uk/services/translations/

Code:
$this->db->get_where('language_slug', $this->uri->segment(2));
#3

[eluser]Anonymous[/eluser]
*deleted
#4

[eluser]Netixon[/eluser]
Hello, first of all thank you for your fast answer. It helps me a lot (I don't want to use too much energies to learn something that could not fit my needs....and only experienced user can tell me this).

For now I'm still "studying" the database theory and MySQL, so I have no Database scheme done (I've started to do the Members and the Pages tables). Anyhow my only last BIG doubt is something I don't understand:

Where should I specify the URL? In the database or in the Code Igniter?

In simple words should I have a table like this:

pID | pTitle | pKeywords | pDescriptio | pURI | etc.....

and then from Code Igniter call that page and somehow use pURI????


Or should I specify it in the Code Igniter only (no URI in the database)?

I know it can sound silly, but that's something I have NO IDEA how to deal with
#5

[eluser]Anonymous[/eluser]
Yes you are right.
You have to save the slug to the database and use the controller (and model) to fetch the right slug. Without saving the slug there is no relation to the database.

One thing to consider is normalizing your database scheme. Use 1 language table and 1 page table for example
#6

[eluser]Netixon[/eluser]
Perfect! Thank you for the advices. Now I can go on studying feeling much more confident Smile




Theme © iAndrew 2016 - Forum software by © MyBB