• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Application Design (new to CI)

#11
[eluser]trippc[/eluser]
I had a lot of the same problems as you when first learning basics. check out the code from Bamboo-invoice and from Linkstser. Both can be found with links in this forum. The example code will answer most of your questions on structure.

tripp c

#12
[eluser]gstjohn[/eluser]
Richard Rowe - I agree with trippc that digging into BambooInvoice is a great idea. It can provide a lot of insight. There are several ways to have other pages that are static or don't use your models.

1. One controller per page
2. One controller (ie - 'static') and pages are then located at http://somedomain.com/static/about/
3. Rewrite the URL with mod_rewrite to a directory outside of the control of CI

I think you need to do a little more investigation on authentication. You will need to use some means of checking every time to see that they are logged in. You have the right idea, you just need some direction with implementation. Try Bamboo Invoice source code for some ideas (http://www.bambooinvoice.com).

#13
[eluser]crumpet[/eluser]
the last application i did I made a controller called pages which served up general things like faq and the main welcome page. I made a function called StaticPage () (static is a keyword so had to add page). Anyways this function would just look in views/pages/static/ for the argument it was passed and if that view was there display it. Its working really nicely so far because I can just add static pages in the views file and not have to change anythign else. Some of the more popular ones (like contact) i used routes to make it so people could go www.example.com/contact instead of /pages/staticpage/contact

#14
[eluser]jaswinder_rana[/eluser]
[quote author="crumpet" date="1229302156"]the last application i did I made a controller called pages which served up general things like faq and the main welcome page. I made a function called StaticPage () (static is a keyword so had to add page). Anyways this function would just look in views/pages/static/ for the argument it was passed and if that view was there display it. Its working really nicely so far because I can just add static pages in the views file and not have to change anythign else. Some of the more popular ones (like contact) i used routes to make it so people could go www.example.com/contact instead of /pages/staticpage/contact[/quote]

By static page I am assuming that those pages are just text and don't need any variables like title etc. Is that correct?

I like the idea. Useful for things like TOS or Privacy Statement etc.



Thanks

#15
[eluser]crumpet[/eluser]
yeah no variables allowed
TOU, Contact, Privacy etc

#16
[eluser]MEM[/eluser]
Sorry for the intrusion but, at least contact page should have variables no? I suppose static pages are those that are not feed in by database, either then, not having variables in it ?
Is this a wrong assumption?

Regards,
Márcio


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.