Re: How to use get_cfg_var() in a cakePHP app ?

2009-12-25 Thread Dr. Loboto
Set constant in bootstrap and use this constant in database.php Don't forget that mysql.default_host may _not_ be set. On Dec 26, 12:23 am, Ashu wrote: > So, we placed the app in a Sandbox server with the DB URL pointing to > the amazon cloud. Now, the client wants to move it to a production > se

i have three queries

2009-12-25 Thread engine
please help me with the following problems i often come across them 1. $form->end("submit") doesnt have "div" = false attribute that div is making my form look ugly in IE, how to get rid of that div 2. is there any way to create links and form without using those helpers that always points to th

Can do conditional validation by credit card type except for VISA

2009-12-25 Thread spheroid
I'm trying to put conditional validation in my form that validates a correct CC is used depending on what CC was selected. Using the code found at http://bakery.cakephp.org/articles/view/conditinalvalidation-behavior. Seems to work for MC and Discover but not when I select VISA. If I select VISA an

Re: How to hide/show links in view /default.ctp/ for different types of user group

2009-12-25 Thread kani
Sorry my english is not well.i am a begginer. I am using cakephp 1.2.5 i want to hide/show different links for each logged in user any way / admin ,manger ,user. / Shoud i do this in ap_controller ? And how to do this link1 \ \ link2 \ \ \

Re: Controller::redirect() issue

2009-12-25 Thread Boarder
I've been receiving some personal comments about this issue to this day. Just wanted to point out the solution I've been told (I haven't got around actually testing it). Dan wrote me this: Dan wrote: > > When you define a new component, it should extend Object: > > class MyComponent extends Ob

RE: Array Help

2009-12-25 Thread Dave
Thanks, I ended up trying a few things and ended up with: if (empty($value['year_id'])) { unset($this->data['ProfilesSkill'][$key]); } Which does what I need. Now step away from the computer and enjoy Christmas with your friends an family! Have a good holiday everyone. Dave -Or

Re: Array Help

2009-12-25 Thread kangur91
If you want to remove key from array, it's simple unset(example below): foreach($array as $key => $value) { if($value == "" || $value == " " || is_null($value)) { unset($array[$key]); You can add if($value != null) use array_reserve function. I wish, I help you. Check out the new CakePHP Quest

Re: How to hide/show links in view /default.ctp/ for different types of user group

2009-12-25 Thread John Andersen
You make sure that the needed information is provided to the view/ layout and act upon it! To provide the information to the view/layout, use the controllers set method or from the view/layout, use requestAction. In the view/layout make an if { } else { } structure or a switch statement around th

Re: Localization for Model validation messages

2009-12-25 Thread John Andersen
I can't agree, as I prefer to have the model be concerned with model things (data, retrieval, saving, validation, etc.), and the view concerned with presenting the data and the related error messages, including the localization! Usually I only have one form in which data for a specific model is en

Re: How to use get_cfg_var() in a cakePHP app ?

2009-12-25 Thread Ashu
So, we placed the app in a Sandbox server with the DB URL pointing to the amazon cloud. Now, the client wants to move it to a production server, where the URL will be different. Hence, they are asking us to use $server = get_cfg_var('mysql.default_host') On Dec 25, 3:55 am, "Dr. Loboto" wrote: >

Re: Localization for Model validation messages

2009-12-25 Thread euromark
i dont like the form-way it is quite redundant - if you add a new rule you might forget one or two views which would not be helpful having it all together in the model is in my opinion a cleaner approach :) On 25 Dez., 12:32, John Andersen wrote: > Use the form helpers option for the input fiel

Re: Multiple Model Pagination

2009-12-25 Thread foldiman
Andrew, It sounds like you want to use a join in your pagination query. If you have set up your model relationships, the joins may happen automagically. However, you can force the join using the 'joins' parameter in the pagination query. For example: $joins1 = array( 'table' => 'bug_relations', 'a

Re: Problem Prototype / jQuery

2009-12-25 Thread Dr. Loboto
jQuery.noConflict() must be called immediately after initial jQuery include. On Dec 24, 11:08 pm, thomaus wrote: > Hi there, > > I have an issue using both Prototype and jQuery in my app. > > Here is my JS includes in my head folder: > >                 echo $javascript->link('/js/scriptaculous-

Re: How to use get_cfg_var() in a cakePHP app ?

2009-12-25 Thread Dr. Loboto
If it is about using default host only, try without it at all. On Dec 25, 2:35 am, Ashu wrote: > I have a cakePHP app with my DB servers configured in the app/config/ > database.php file. However, I need to use the get_cfg_var > ('mysql.default_host') to get the host name because the client does

Re: accents in html forms

2009-12-25 Thread Dr. Loboto
"A little bit more specific", UTF-8 checklist: http://groups.google.com/group/cake-php/browse_thread/thread/2e972a09571fdbd3/926f4459a4daa8d9#926f4459a4daa8d9 On Dec 24, 10:04 pm, Lorenzo Bettini wrote: > mh... could you please be a little bit more specific? > > thanks >         Lore > > euromark

Re: Multiple Model Pagination

2009-12-25 Thread John Andersen
I would create an SQL statement using UNION to combine all the data from multiple models and ordered by the same ORDER BY. But this means probably that you have to use a custom query and I don't know if that can be paginated! Example: (SELECT a.id AS Result.id, a.name AS Result.name, a.cr

Re: Localization for Model validation messages

2009-12-25 Thread John Andersen
Use the form helpers option for the input fields! Look at: http://book.cakephp.org/view/198/options-error Thus you localize in the view - example: echo $form->input( 'email', array( 'label' => __('e-mail address',true), 'error' => array('users_email_rule' => __ ('users_email_rul