Re: default.thml not rendering add, edit, view, or index

2007-08-06 Thread Daghe9193


I was able to figure out what was wrong with my default.thtml be
looking at an older project of mine.   I left the $content_for_layout
out of the file.


  
 check('Message.flash'))
   $session->flash();
   echo $content_for_layout;
 ?>
  


If someone can followup with a link to the manual, a tutorial, or an
example of a well done default.thtml, it might be helpful for future
newbies using CakePHP.

Thank you for this great Forum.


On Aug 6, 9:54 am, Daghe9193 <[EMAIL PROTECTED]> wrote:
> Without a default.thml, cakePHP renders the view, index, add, edit
> screens. When I add a default.thml file,  the Query information
> displays, but the view, index, add, and edit screens do not.
>
> My default page is a header with menus and a search box.   It contains
> its own css, a form, and javascript.All tags are all appropriately
> closed.
>
> I've also noticed that a blank default.thtml prevents the view, index,
> add, and edit screens from rendering.
>
> I'm using  cake_1.1.16.5421.
>
> Any suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



default.thml not rendering add, edit, view, or index

2007-08-06 Thread Daghe9193


Without a default.thml, cakePHP renders the view, index, add, edit
screens. When I add a default.thml file,  the Query information
displays, but the view, index, add, and edit screens do not.

My default page is a header with menus and a search box.   It contains
its own css, a form, and javascript.All tags are all appropriately
closed.

I've also noticed that a blank default.thtml prevents the view, index,
add, and edit screens from rendering.

I'm using  cake_1.1.16.5421.

Any suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Passing non-model variables from controller to view to setting and retreiving HTML form tags

2007-02-08 Thread Daghe9193

Grant,

Thanks for the tip.I must be doing something subtly wrong with
your suggestion.   I set the $this->data['Display']['currency'] in my
index controller method.   When adding the echo $html-
>checkbox( 'Display/currency' ); I get "Cannot instantiate non-
existent class: display ".Initially my index view did not contain
a form.   I added the following form, but I still get the "non-
existent class: display"   notification



I've get the currency toggle working, but my method appears to be a
bit cumbersome.

1. Place a Ajax observer field on a standard HTML checkbox

echo $ajax->observeField('currency', array(
'update' => 'proposalCurrency',
'url' => '/proposals/ajaxCurrency',
'frequency' => '1'))

>


2. Move the table containing the Price column which will be either EUR
or USD into a separate  table.thtml file
   this table is embedded with the 

3. In the index method of the proposal controller set the "currency"
variable
 $this->set('currency', $whichCurrency);   //
whichCurrency will be either the string "EUR" or "USD"

4. In the  proposal controller ajaxController, the currency from the
form is retrieved with the   $this->params['form']['currency']

  if (isset($this->params['form']['currency']) &&
strcmp ($this->params['form']['currency'],"EUR") == 0)
$whichCurrency = "EUR";
else
{
   $whichCurrency = $this->Session->read
("Proposal.whichCurrency");
   $whichCurrency = (strcmp($whichCurrency, "USD") == 0) ?
"EUD" : "USD";
}

5.  Session variables were used to maintain the users currency
selection preference.

My solution does work, but it does not seem to be efficient or
elegant.   Any suggestions on why I can't use ['Display']['currency']
in the view with the $html->checkbox helper would be appreciated.



On Feb 7, 10:02 pm, "Grant Cox" <[EMAIL PROTECTED]> wrote:
> I personally find the best way is still using the html / form helpers,
> but to use a model or field name that doesn't exist.  Of course, if
> you want the value to persist then you'll need to store the value
> somewhere - perhaps in the session.
>
> ie, in your controller:
>
> function edit($id = null) {
> if(empty($this->data)) {
> ...
> $this->data['Display']['currency'] = 
> $this->Session->read('Display.currency');
>
> } else {
> $this->cleanUpFields();
> // save the currency they selected back to the session
> $this->Session->write('Display.currency', 
> $this->data['Display']
> ['currency']);
>
> ...
> }
>
> }
>
> and your view can just use
> echo $html->checkbox( 'Display/currency' );


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Passing non-model variables from controller to view to setting and retreiving HTML form tags

2007-02-07 Thread Daghe9193

Hello I am new to Cake and MVC, so please excuse my terminology.

What is the easiest way to pass non-model variables back and forth
from the view and the controller for setting and retrieving HTML
control values, such as the checkbox?   I need to add a currency
checkbox to the index view which will determine whether a price column
is displayed in Euro's or U.S. Dollars.   The checkbox method of the
html helper class appears to be model specific.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---