Re: PayPal Direct Payment API Component

2007-08-06 Thread r557

Remove setCertificate and replace it with $this->Paypal-
>setSignature('signature provided by paypal');.  There are 2 options
on how you process a payment, certificate and signature.  I used
signature and now it's working :).

On Aug 1, 2:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> by default, the code is something like this:
>
>  // Set up common component's parameters
>  
> $this->Paypal->setEnvironment(CAKE_COMPONENT_PAYPAL_ENVIRONMENT_SANDBOX);
>
>  $this->Paypal->setUser('ApiUser');
>  $this->Paypal->setPassword('ApiPassword');
>  $this->Paypal->setCertificate('cert_perm.txt');
>  $this->Paypal->setOrder($order)
>
> the source doesn't give instruction that this part should be change. I
> tried changing the username, password for my
> sandboxpaypalaccount but still i do get the same error message.
>
> On Aug 2, 1:48 am, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote:
>
> > On 8/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
> > > what usename, password, certificate file and environment this error
> > > referring to?
>
> > > ERROR: API Username, Password, Certificate File and Environment must
> > > all be set
>
> > I haven't used this component myself, but maybe you could search the source
> > code for this error you're getting to see where it's going to check for the
> > above details. That'll probably lead you to the answer.
>
> > - Gonzalo


--~--~-~--~~~---~--~~
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: Cake Generating Odd Session Errors

2007-07-28 Thread r557

I've followed the tutorial for the fck helper from the bakery
http://bakery.cakephp.org/articles/view/using-fckeditor-with-cakephp
and included the helper in my app_controller as several controllers
will use this helper.  It only creates the error on this one page that
is using a requestAction & renderElement, but nowhere in either is it
actually trying to load the fck editor.

this is the helper causing the issue on one page only.  for some
reason, my renderElement is generating a session warning because of
this even though it's not trying to load the fck editor into any text
areas.  every other area is functional, as well as the editor loads
properly when called.


webroot.'js/';
return<<
fckLoader_$did = function () {
var bFCKeditor_$did = new FCKeditor('$did');
bFCKeditor_$did.BasePath = '$js';
bFCKeditor_$did.ToolbarSet = '$toolbar';
bFCKeditor_$did.ReplaceTextarea();
}
fckLoader_$did();

FCK_CODE;
}
function fileBrowserInput($fieldName, $htmlAttributes = array(),
$return = false) {
$output = $this->input($fieldName, $htmlAttributes, $return);
if (!isset($htmlAttributes['id'])) {
$htmlAttributes['id'] = $this->model .
Inflector::camelize($this->field);
}
$output .= '';
$output .= "//<![CDATA[\n";
$output .= "function openFileBrowser(id){\n";
$output .= "var fck = new FCKeditor(id);\n";
$output .= "fck.BasePath = '".$this->webroot."js/'\n";
$output .= "var url = fck.BasePath + 'editor/filemanager/
browser/default/browser.html?Type=Image&Connector=connectors/php/
connector.php';\n";
$output .= "var sOptions =
'toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes';\n";
$output .= "sOptions += ',width=640';\n";
$output .= "sOptions += ',height=480';\n";
$output .= "window.SetUrl = function(fileUrl){\n";
$output .= "\$(id).value = fileUrl;\n";
$output .= "}\n";
$output .= "var oWindow = window.open( url, 'FCKBrowseWindow',
sOptions ) ;\n";
$output .= "}\n";
$output .= "//]]>\n";
$output .= '';
$output .= 'select an image...';
return $output;
}
}
?>

On Jul 28, 11:47 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 7/29/07, r557 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Yes, Aware of this.
>
> Then fix it - start with moving back the code in view - I think the errors
> will still occur if the fck helper is an issue... work forwards from that
> point...
>
> T
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =


--~--~-~--~~~---~--~~
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: Cake Generating Odd Session Errors

2007-07-28 Thread r557

Yes, Aware of this.

On Jul 28, 11:28 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 7/29/07, r557 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Warning: session_start(): Cannot send session cookie - headers already
> > sent by (output started at C:\apache2triad\htdocs\sonsofmaxwell\som\app
> > \views\helpers\fck.php:44)
>
> It means what it says - your fck helper is messing up stuff
>
> HTH
>
> Tarique
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cake Generating Odd Session Errors

2007-07-28 Thread r557

When i call a renderElement function, it is generating Session related
issues.

Code:


renderElement('store_nav');?>


Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at C:\apache2triad\htdocs\sonsofmaxwell\som\app
\views\helpers\fck.php:44) in C:\apache2triad\htdocs\sonsofmaxwell\som
\cake\libs\session.php on line 154 Warning: session_start(): Cannot
send session cache limiter - headers already sent (output started at C:
\apache2triad\htdocs\sonsofmaxwell\som\app\views\helpers\fck.php:44)
in C:\apache2triad\htdocs\sonsofmaxwell\som\cake\libs\session.php on
line 154 Warning: Cannot modify header information - headers already
sent by (output started at C:\apache2triad\htdocs\sonsofmaxwell\som\app
\views\helpers\fck.php:44) in C:\apache2triad\htdocs\sonsofmaxwell\som
\cake\libs\session.php on line 155

I didn't receive these errors until i moved the code over to an
Element:


requestAction('categories/index');?>

Categories


link($category['Category']['name'],'/products/
index/' . $category['Category']['id'])?>



Cart Links

link('View Cart', '/', array('title' => 'View
Cart')) ?>
link('My Account', '/', array('title' => 'My
Account')) ?>

Customer Service

link('Return Policy', '/', array('title' =>
'Return Policy')) ?>

Shipping Information

link('Shipping Rates', '/', array('title' =>
'Shipping Rates')) ?>




--~--~-~--~~~---~--~~
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: Get the Session Id being generated

2007-07-14 Thread r557

after debugging the session object, it outputted the following array:

SessionComponent Object
(
[__active] => 1
[valid] => 1
[error] =>
[_userAgent] => 15988584ca32783087cd2ffdbb6ba45b
[path] => /som/
[lastError] =>
[security] => high
[time] => 1184469726
[sessionTime] => 1184470926
[watchKeys] => Array
(
)

[_log] =>
[host] => *
[cookieLifeTime] => 0
[base] => /som
[webroot] => /som/
[here] => /som/shopping_carts/show/
[params] => Array
(
[pass] => Array
(
)

[controller] => shopping_carts
[action] => show
[url] => Array
(
[url] => shopping_carts/show/
)

[bare] => 0
[webservices] =>
[plugin] =>
)

[action] => show
[data] =>
[plugin] =>
)

so my question now is though, how do i get [_userAgent] =>
15988584ca32783087cd2ffdbb6ba45b to a variable from this?

On Jul 14, 11:55 pm, r557 <[EMAIL PROTECTED]> wrote:
> I'm looking for how to get the session id being generated by CakePHP.
> i have my session working fine, but would like to know how to find out
> what the session id is so i can store it in a db table.
>
> how do i do this?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Get the Session Id being generated

2007-07-14 Thread r557

I'm looking for how to get the session id being generated by CakePHP.
i have my session working fine, but would like to know how to find out
what the session id is so i can store it in a db table.

how do i do this?


--~--~-~--~~~---~--~~
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: Help with an array

2007-07-09 Thread r557

issue resolved.

On Jul 9, 8:48 pm, r557 <[EMAIL PROTECTED]> wrote:
> hey, ideally i would like to display all the fields, but it's not a
> huge deal, i just want something to output.  when i placed your code
> in my view, it didn't work properly.
>
> it generated the following HTML Table.
>
> 
>   ArrayArray
> 
>
> On Jul 9, 8:24 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > 1.  Be more specific - what do you want it to look like?
>
> > 2.
> >   > foreach($products as $key=>$value){
> > echo'';
> > foreach($value as $k => $v){
> > echo ''  . $v. '';
> > }
> > echo '';
>
> > }
>
> > ?>
>
> > use $v not $value in your loop.


--~--~-~--~~~---~--~~
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: Help with an array

2007-07-09 Thread r557

hey, ideally i would like to display all the fields, but it's not a
huge deal, i just want something to output.  when i placed your code
in my view, it didn't work properly.

it generated the following HTML Table.


  ArrayArray


On Jul 9, 8:24 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> 1.  Be more specific - what do you want it to look like?
>
> 2.
>   foreach($products as $key=>$value){
> echo'';
> foreach($value as $k => $v){
> echo ''  . $v. '';
> }
> echo '';
>
> }
>
> ?>
>
> use $v not $value in your loop.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help with an array

2007-07-09 Thread r557

I know this is a basic issue, but can't seem to get the correct
output.

function show() {
$this->set('products', array($this->Session-
>read('ShoppingCart.Product')));
}

generates the follow array currently:

Array
(
[0] => Array
(
[id] => 13
[category_id] => 7
[name] => Leaving Of Liverpool
[description] => Leaving Of Liverpool
[price] => 1.00
[virtual] => 1
[active] => 1
[sort_order] => 13
[created] => 2007-06-24 14:08:03
[modified] => 2007-06-24 14:08:03
[image] => NONE
)

[1] => Array
(
[id] => 16
[category_id] => 7
[name] => Yellow Submarine
[description] => Yellow Submarine
[price] => 1.00
[virtual] => 1
[active] => 1
[sort_order] => 16
[created] => 2007-06-24 14:10:02
[modified] => 2007-06-24 14:10:02
[image] => NONE
)
)

and this was my attempt in the view:


$value){
echo'';
foreach($value as $k => $v){
echo ''  . $value . '';
}
echo '';
}
?>


but not getting the correct output.  any ideas?  i have a case of the
stupids when it comes to arrays.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Outputting Session Data

2007-07-08 Thread r557

in my function:

function show() {
$this->set('products', $this->Session->read('Product'));
}

i take the current session data and assign it to products.  in the
show view, this is the code:















which i figure should loop through the variable i set.  but i'm
getting a wierd result.

this is the source being generated:


1
1

1
1
1
1
1
1

1


7
7
7
7

7
7
7
7
7



U
U
U
U
U
U

U
U
U


B
B

B
B
B
B
B
B

B


1
1
1
1

1
1
1
1
1



1
1
1
1
1
1

1
1
1


1
1

1
1
1
1
1
1

1


1
1
1
1

1
1
1
1
1



2
2
2
2
2
2

2
2
2


2
2

2
2
2
2
2
2

2


N
N
N
N

N
N
N
N
N



when doing a  in the view, it generates
Array ( [id] => 1 [category_id] => 7 [name] => Uphill Battle
[description] => Blah Blah Blah [price] => 1.00 [virtual] => 1
[active] => 1 [sort_order] => 1 [created] => 2007-06-24 13:59:27
[modified] => 2007-06-24 13:59:27 [image] => NONE ).

so, how is this view generating such an odd result?


--~--~-~--~~~---~--~~
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: Undefined Variable Problem

2007-07-08 Thread r557

AHH, can't believe i missed that!!!

On Jul 8, 2:12 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]>
wrote:
> change:
> $product_id = $this->$data['Product']['id'];
>
> to:
> $product_id = $this->data['Product']['id'];
>
> --
> /**
> * @author Larry E. Masters
> * @var string $userName
> * @param string $realName
> * @returns string aka PhpNut
> * @access  public
> */
>
> On 7/8/07, r557 <[EMAIL PROTECTED]> wrote:
>
>
>
> > / view */
> > 
>
> >  > method="post">
>
> > hidden('Product/id')?>
>
> > 
>
> > image('sundaymorning_cover.jpg', array('class' =>
> > 'product_img')); ?>
>
> > 
> >  - $ > $product['Product']['price']?>
> > Qty. 
> > 
> > submit('Add to Cart'); ?>
> > 
> > 
> > 
>
> > /*** stripped down controller ***/
>
> >  > class ShoppingCartsController extends AppController {
>
> > function add($id = null) {
> > if(empty($this->data)) {
> >  $this-render();
> >  }
>
> > /* Line 12 */   $product_id = $this->$data['Product']['id'];
>
> >  $product = $this->Product->find("product_id =
> > '$product_id'");
>
> >   $this->Session->write('Product', $product['Product']);
>
> >   $this->redirect('/shopping_carts/show/');
>
> >   }
>
> >   }
>
> >   i keep getting a syntax error: Notice: Undefined variable: data
> > in C:\apache2triad\htdocs\sonsofmaxwell\som\app\controllers
> > \shopping_carts_controller.php on line 12 Fatal error: Cannot access
> > empty property in C:\apache2triad\htdocs\sonsofmaxwell\som\app
> > \controllers\shopping_carts_controller.php on line 12.
>
> >  anyone know why this error is being generated or perhaps what i'm
> > doing wrong here?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Undefined Variable Problem

2007-07-08 Thread r557

/ view */




hidden('Product/id')?>



image('sundaymorning_cover.jpg', array('class' =>
'product_img')); ?>


 - $
Qty. 

submit('Add to Cart'); ?>




/*** stripped down controller ***/

data)) {
 $this-render();
 }

/* Line 12 */   $product_id = $this->$data['Product']['id'];

 $product = $this->Product->find("product_id =
'$product_id'");

  $this->Session->write('Product', $product['Product']);

  $this->redirect('/shopping_carts/show/');

  }

  }

  i keep getting a syntax error: Notice: Undefined variable: data
in C:\apache2triad\htdocs\sonsofmaxwell\som\app\controllers
\shopping_carts_controller.php on line 12 Fatal error: Cannot access
empty property in C:\apache2triad\htdocs\sonsofmaxwell\som\app
\controllers\shopping_carts_controller.php on line 12.

 anyone know why this error is being generated or perhaps what i'm
doing wrong here?


--~--~-~--~~~---~--~~
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: Newbie Sessions ?

2007-07-06 Thread r557

Well how is it done then in a shopping cart situation where you need a
collection of items?

On Jul 5, 10:06 pm, citrus <[EMAIL PROTECTED]> wrote:
> When you add values to the session, the old one will be overwritten
> (if exists)
>
> On Jul 6, 6:35 am, r557 <[EMAIL PROTECTED]> wrote:
>
> > Creating a Shopping Cart, and am wondering if when you add values to a
> > session, does it overwrite the current contents in the session?
>
> > For example:
>
> > $this->Session->write('ShoppingCart.id', $id);
> > $this->Session->write('ShoppingCart.name', $name);
> > $this->Session->write('ShoppingCart.virtual', $virtual);
> > $this->Session->write('ShoppingCart.price', $price);
>
> > Having this code, if the first time i passed an $id of 4, then next
> > time i added an $id of 6, will 6 overwrite 4 or will be added as
> > another row in the session?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Newbie Sessions ?

2007-07-05 Thread r557

Creating a Shopping Cart, and am wondering if when you add values to a
session, does it overwrite the current contents in the session?

For example:

$this->Session->write('ShoppingCart.id', $id);
$this->Session->write('ShoppingCart.name', $name);
$this->Session->write('ShoppingCart.virtual', $virtual);
$this->Session->write('ShoppingCart.price', $price);


Having this code, if the first time i passed an $id of 4, then next
time i added an $id of 6, will 6 overwrite 4 or will be added as
another row in the session?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Shopping Cart

2007-07-04 Thread r557

I'm creating a shopping cart to extend a current project completed in
CakePHP.

I'm having some issues with regards to understanding how Sessions work
around CakePHP and how to use them.  The trouble i'm having is, I am
not able to find some practical examples regarding how to store
session data around Cake.

For example, i have a controller:
layout = 'main';
if(!$id) {
$this->Session->setFlash('Invalid id for Product.');
$this->redirect('/products/index/');
}
$this->set('product', $this->Product->read(null, $id));
}
?>

/ view.thtml /


image('sundaymorning_cover.jpg', array('class' =>
'product_img')); ?>

 - $




I'm looking for a starting point to begin the process of integrating a
Shopping Cart Using Sessions.  Not looking necessarily for a complete
how-to (would be nice if possible :)) but all i'm really looking for
is some assistance on how to integrate this.  I haven't found much on
this topic as of yet, but if someone has any good resources please
share.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Check for value in findAllBy... function?

2007-06-24 Thread r557

In my function i would like to define a variable $data['Category']
['id'].  If the findAllByCategory_id($id) returns no records, i would
like $this->data['Category']['id'] to be the value of the $id passed
into the function.

function admin_index($id) {
$this->Product->recursive = 0;
$this->set('products', 
$this->Product->findAllByCategory_id($id));

if(array_key_exists('category_id',$products)) {
$this->data['Category']['id'] = $products[0]['Product']
['category_id'];
} else {
$this->data['Category']['id'] = $id;
}

}

I am getting the error: Notice: Undefined variable: products in C:
\apache2triad\htdocs\sonsofmaxwell\new\app\controllers
\products_controller.php on line 24 Warning: array_key_exists(): The
second argument should be either an array or an object in C:
\apache2triad\htdocs\sonsofmaxwell\new\app\controllers
\products_controller.php on line 24 and line 24 would be the
if(array_key...) line.

I am wondering if i should be using afterfind in this case??  but
never used it before, i only need this used within one function in my
Controller.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Parent & Child Nodes for category listing

2007-06-17 Thread r557

Issue: Trying to display nested categories, and when category has no
more child nodes, display listings of product for category.

Models:
categories ->
id
active
name
description
img
created
modified
parent_id
sort_order

products ->
id
category_id
name
img
cost
active
created
modified
description
sort_order

I'm looking for some assistance in setting up my controller & view for
the categories controller to get started.

I have a possible tree or hierarchy that looks like:

Apparel
- Mens
- Tshirts
- Hats
- Womens
   - Shirts
   - Hats

Music
- CDs

As you can see that there are nested categories.  The issue i'm having
in trying to set this up is in the category controller knowing when to
stop looking for more categories and search for products related to
the category.  I can't seem to find a good example to use as a
reference whereas this is my first time setting something like this
up.

Should i be using Model::findAllThreaded? or is there another model
function i should be using?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Pass an ID to View

2007-06-11 Thread r557

Really basic here solution here i'm having an issue with.

CONTROLLER FUNCTION

function admin_add() {
if(empty($this->data)) {
$this->render();
} else {
$this->cleanUpFields();
if($this->Category->save($this->data)) {
$this->Session->setFlash('The Category has been 
saved');
$this->redirect('/admin/categories/index');
} else {
$this->Session->setFlash('Please correct errors 
below.');
}
}
}

VIEW

New Category

hidden('Category/id')?>

labelTag('Category/active', 'Active');?>
input('Category/active', array('size' => '60'));?>
tagErrorMsg('Category/active', 'Please enter the
Active.');?>


labelTag('Category/name', 'Name');?>
input('Category/name', array('size' => '60'));?>
tagErrorMsg('Category/name', 'Please enter the
Name.');?>


labelTag( 'Category/description', 'Description' );?
>
textarea('Category/description', array('cols' =>
'60', 'rows' => '10'));?>
tagErrorMsg('Category/description', 'Please enter
the Description.');?>


labelTag('Category/img', 'Img');?>
input('Category/img', array('size' => '60'));?>
tagErrorMsg('Category/img', 'Please enter the
Img.');?>


labelTag('Category/parentid', 'Parentid');?>
input('Category/parentid', array('size' => '60'));?
>
tagErrorMsg('Category/parentid', 'Please enter the
Parentid.');?>


labelTag('Category/sort_order', 'Sort Order');?>
input('Category/sort_order', array('size' =>
'60'));?>
tagErrorMsg('Category/sort_order', 'Please enter
the Sort Order.');?>


submit('Add');?>



link('List Categories', '/admin/categories/
index')?>


I have my model set up in a way that allows parentid's (nested
categories).  I have the link set up when i click to add a
subcategory, the id is being passed, but i'm not sure how to populate
properly in the value area of Category/parentid.  I tried using a
'value' => '. $data['category']['id']' but that did not work.

how do i get that add function to pass that id to the view?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---