Re: Getting global variables from Database in cakePHP

2008-10-07 Thread dr. Hannibal Lecter

Maybe something like this would help you:

http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-for-cakephp-apps

There is also a working (and slightly improved) example in my CMS
project (same site).

Hope that helps!

On Oct 7, 6:58 am, Jipson [EMAIL PROTECTED] wrote:
 Hi,
      Thank you Jitka and mark.
  I tried with jitka's solution but,as a new developer to cakephp I
 couldn't obtain the solutions. I searched the tutorials also but I
 didn't got it.Can you please explain it with some examples please

 Thanks,
 Jipson.
 On Oct 6, 8:09 pm, jitka (poLK) [EMAIL PROTECTED] wrote:

  For example, you can
  - load necessary settings from db when you need them
  - load all settings once and use Configure::store() (also called from
  afterSave callback of this model), Configure::load() (called from
  bootstrap) and then Configure::read() where necessary
  - same approach as 2nd one, but with Cache::write()/read()


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting global variables from Database in cakePHP

2008-10-07 Thread Jipson

Thank you all.Thanks a lot. Dr. Hannibal Lecter's suggestion
helped me. Now my problem is solved. Once again thank you all.

On Oct 7, 1:06 pm, dr. Hannibal Lecter [EMAIL PROTECTED] wrote:
 Maybe something like this would help you:

 http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-...

 There is also a working (and slightly improved) example in my CMS
 project (same site).

 Hope that helps!

 On Oct 7, 6:58 am, Jipson [EMAIL PROTECTED] wrote:

  Hi,
       Thank you Jitka and mark.
   I tried with jitka's solution but,as a new developer to cakephp I
  couldn't obtain the solutions. I searched the tutorials also but I
  didn't got it.Can you please explain it with some examples please

  Thanks,
  Jipson.
  On Oct 6, 8:09 pm, jitka (poLK) [EMAIL PROTECTED] wrote:

   For example, you can
   - load necessary settings from db when you need them
   - load all settings once and use Configure::store() (also called from
   afterSave callback of this model), Configure::load() (called from
   bootstrap) and then Configure::read() where necessary
   - same approach as 2nd one, but with Cache::write()/read()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting global variables from Database in cakePHP

2008-10-06 Thread mark_story

On Oct 6, 8:30 am, Jipson [EMAIL PROTECTED] wrote:
 Hi Friends,
Now I am facing a problem that, in my project I havesome datas
 like (admin email, site name, payapal email etc) in my settings
 table.I have to get these all values throughout in my project like
 global variables in php.What are the steps I have to do for it? Please
 help me.

 Thanks in Advance.
 Jipson

Make a model and dump out the 'settings' to globals would do the
trick.  However, using globals is wrong in almost every situation.
Whats wrong with loading the settings as needed?

-Mark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting global variables from Database in cakePHP

2008-10-06 Thread jitka (poLK)

For example, you can
- load necessary settings from db when you need them
- load all settings once and use Configure::store() (also called from
afterSave callback of this model), Configure::load() (called from
bootstrap) and then Configure::read() where necessary
- same approach as 2nd one, but with Cache::write()/read()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting global variables from Database in cakePHP

2008-10-06 Thread Jipson

Hi,
 Thank you Jitka and mark.
 I tried with jitka's solution but,as a new developer to cakephp I
couldn't obtain the solutions. I searched the tutorials also but I
didn't got it.Can you please explain it with some examples please

Thanks,
Jipson.
On Oct 6, 8:09 pm, jitka (poLK) [EMAIL PROTECTED] wrote:
 For example, you can
 - load necessary settings from db when you need them
 - load all settings once and use Configure::store() (also called from
 afterSave callback of this model), Configure::load() (called from
 bootstrap) and then Configure::read() where necessary
 - same approach as 2nd one, but with Cache::write()/read()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---