Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-14 Thread Md Bayezid Alam
i can't understand. could you please give me an example if you have?

Note: *I want to create a new record at Costs  FixedCosts against Units ID
but don't want to add a new record at UnitsTable*

Thanks in advance
Bayezid


On Sun, Dec 14, 2014 at 3:36 AM, José Lorenzo jose@gmail.com wrote:

 You either need to load the Costs and FixedCosts associations in the get()
 call or mark the entity with isNew(false) if you want them updated instead
 of created.


 On Saturday, December 13, 2014 3:39:34 PM UTC+1, Bayezid Alam wrote:

 Thanks a lot,

 but it not saving to Costs  FixedCosts Table somehow, i tried, even if
 its not executing after $this-request-is


 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a
 valid ID'));
 }

 $unitId = $this-Units-get($uId);

 *$unit = $this-Units-patchEntity($unitId,
 $this-request-data(),['associated' = ['Costs', 'FixedCosts']]);*

   *  debug($unit); // This debug result is below*

 if ($this-request-is('post')){*// tried adding patch 
 put too, found same result*
 $unit-cost-unit_id = $unit-fixed_cost-unit_id =
 $unitId-id;

 *//debug($unit); // This debug is not executing*

 if ($this-Units-save($unit)){
 $this-Flash-success(__('The unit cost has been added'));
 return $this-redirect(['controller' = 'houses',
 'action' = 'view', $unit-house_id]);
 }
 }

 $this-set(compact('unit'));
 }


 *debug($unit):*

 */src/Controller/UnitsController.php* (line *53*)

 object(Cake\ORM\Entity) {

  'new' = false,
  'accessible' = [
  '*' = true
  ],
  'properties' = [
  'id' = (int) 1,
  'name' = '1st Floor - Front',
  'house_id' = (int) 2,
  'billing_date' = object(Cake\I18n\Time) {

  'time' = '2014-12-05T00:00:00+',
  'timezone' = 'UTC',
  'fixedNowTime' = false
  
  },
  'created' = object(Cake\I18n\Time) {

  'time' = '2014-12-10T14:59:25+',
  'timezone' = 'UTC',
  'fixedNowTime' = false
  
  },
  'modified' = object(Cake\I18n\Time) {

  'time' = '2014-12-10T14:59:25+',
  'timezone' = 'UTC',
  'fixedNowTime' = false
  
  },
  'cost' = object(Cake\ORM\Entity) {

  'new' = true,
  'accessible' = [
  '*' = true
  ],
  'properties' = [
  'rental_cost' = (float) 2000
  ],
  'dirty' = [
  'rental_cost' = true
  ],
  'original' = [],
  'virtual' = [],
  'errors' = [],
  'repository' = 'Costs'
  
  },
  'fixed_cost' = object(Cake\ORM\Entity) {

  'new' = true,
  'accessible' = [
  '*' = true
  ],
  'properties' = [
  'gas_bill' = (int) 500,
  'water_bill' = (int) 300,
  'service_bill' = (int) 300
  ],
  'dirty' = [
  'gas_bill' = true,
  'water_bill' = true,
  'service_bill' = true
  ],
  'original' = [],
  'virtual' = [],
  'errors' = [],
  'repository' = 'FixedCosts'
  
  }
  ],
  'dirty' = [
  'cost' = true,
  'fixed_cost' = true
  ],
  'original' = [],
  'virtual' = [],
  'errors' = [],
  'repository' = 'Units'

 }


 Thanks
 Bayezid


 On Sat, Dec 13, 2014 at 3:45 PM, José Lorenzo jose@gmail.com wrote:

 Ah ok. I understand the question now. Instead of using newEntity() you
 should use patchEntity()

 $unitId = $this-Units-get($uId);
 $unit = $this-Units-patchEntity($unitId, 
 $this-request-data(),['associated'
 = ['Costs', 'FixedCosts']]);


 On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary
 key from units Controller.

 i did below things but its creating a new record at unit Table instead
 of using primaryKey

 Form at unitsController:

 ?php

 echo $this-Form-create($unit);
 echo 

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-13 Thread José Lorenzo
Ah ok. I understand the question now. Instead of using newEntity() you 
should use patchEntity()

$unitId = $this-Units-get($uId);
$unit = $this-Units-patchEntity($unitId, 
$this-request-data(),['associated' = ['Costs', 'FixedCosts']]);


On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary 
 key from units Controller.

 i did below things but its creating a new record at unit Table instead of 
 using primaryKey

 Form at unitsController:

 ?php

 echo $this-Form-create($unit);
 echo $this-Form-input('cost.rental_cost');
 echo $this-Form-input('fixed_cost.gas_bill');
 echo $this-Form-input('fixed_cost.water_bill');
 echo $this-Form-input('fixed_cost.service_bill');
 echo $this-Form-button('Save Costs');
 echo $this-Form-end();

 ?

 Function at UnitsController:

 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a 
 valid ID'));
 }
 
 $unitId = $this-Units-get($uId);
 
 $unit = 
 $this-Units-newEntity($this-request-data(),['associated' = ['Costs', 
 'FixedCosts']]);
 
 if ($this-request-is('post')){
 $unit-cost-unit_id = $unit-fixed_cost-unit_id = 
 $unitId-id;
 if ($this-Units-save($unit)){
 $this-Flash-success(__('The unit cost has been added'));
 return $this-redirect(['controller' = 'houses', 'action' 
 = 'view', $unit-house_id]);
 }
 }
 
 $this-set(compact('unit'));
 }

 Please suggest me on this regard.

 Thanks
 Bayezid



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-13 Thread Md Bayezid Alam
Thanks a lot,

but it not saving to Costs  FixedCosts Table somehow, i tried, even if its
not executing after $this-request-is


public function add_cost($uId){
if (!$uId){
throw new NotFoundException(__('Unit id Not found, try with a
valid ID'));
}

$unitId = $this-Units-get($uId);

*$unit = $this-Units-patchEntity($unitId,
$this-request-data(),['associated' = ['Costs', 'FixedCosts']]);*

  *  debug($unit); // This debug result is below*

if ($this-request-is('post')){*// tried adding patch 
put too, found same result*
$unit-cost-unit_id = $unit-fixed_cost-unit_id = $unitId-id;

*//debug($unit); // This debug is not executing*

if ($this-Units-save($unit)){
$this-Flash-success(__('The unit cost has been added'));
return $this-redirect(['controller' = 'houses', 'action'
= 'view', $unit-house_id]);
}
}

$this-set(compact('unit'));
}


*debug($unit):*

*/src/Controller/UnitsController.php* (line *53*)

object(Cake\ORM\Entity) {

'new' = false,
'accessible' = [
'*' = true
],
'properties' = [
'id' = (int) 1,
'name' = '1st Floor - Front',
'house_id' = (int) 2,
'billing_date' = object(Cake\I18n\Time) {

'time' = '2014-12-05T00:00:00+',
'timezone' = 'UTC',
'fixedNowTime' = false

},
'created' = object(Cake\I18n\Time) {

'time' = '2014-12-10T14:59:25+',
'timezone' = 'UTC',
'fixedNowTime' = false

},
'modified' = object(Cake\I18n\Time) {

'time' = '2014-12-10T14:59:25+',
'timezone' = 'UTC',
'fixedNowTime' = false

},
'cost' = object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'rental_cost' = (float) 2000
],
'dirty' = [
'rental_cost' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'Costs'

},
'fixed_cost' = object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'gas_bill' = (int) 500,
'water_bill' = (int) 300,
'service_bill' = (int) 300
],
'dirty' = [
'gas_bill' = true,
'water_bill' = true,
'service_bill' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'FixedCosts'

}
],
'dirty' = [
'cost' = true,
'fixed_cost' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'Units'

}


Thanks
Bayezid


On Sat, Dec 13, 2014 at 3:45 PM, José Lorenzo jose@gmail.com wrote:

 Ah ok. I understand the question now. Instead of using newEntity() you
 should use patchEntity()

 $unitId = $this-Units-get($uId);
 $unit = $this-Units-patchEntity($unitId, 
 $this-request-data(),['associated'
 = ['Costs', 'FixedCosts']]);


 On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary
 key from units Controller.

 i did below things but its creating a new record at unit Table instead of
 using primaryKey

 Form at unitsController:

 ?php

 echo $this-Form-create($unit);
 echo $this-Form-input('cost.rental_cost');
 echo $this-Form-input('fixed_cost.gas_bill');
 echo $this-Form-input('fixed_cost.water_bill');
 echo $this-Form-input('fixed_cost.service_bill');
 echo $this-Form-button('Save Costs');
 echo $this-Form-end();

 ?

 Function at UnitsController:

 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a
 valid ID'));
 }

 

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-13 Thread José Lorenzo
You either need to load the Costs and FixedCosts associations in the get() 
call or mark the entity with isNew(false) if you want them updated instead 
of created.

On Saturday, December 13, 2014 3:39:34 PM UTC+1, Bayezid Alam wrote:

 Thanks a lot,

 but it not saving to Costs  FixedCosts Table somehow, i tried, even if 
 its not executing after $this-request-is 


 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a 
 valid ID'));
 }
 
 $unitId = $this-Units-get($uId);
 
 *$unit = $this-Units-patchEntity($unitId, 
 $this-request-data(),['associated' = ['Costs', 'FixedCosts']]);*
 
   *  debug($unit); // This debug result is below*
 
 if ($this-request-is('post')){*// tried adding patch  
 put too, found same result*
 $unit-cost-unit_id = $unit-fixed_cost-unit_id = 
 $unitId-id;
 
 *//debug($unit); // This debug is not executing*
   
 if ($this-Units-save($unit)){
 $this-Flash-success(__('The unit cost has been added'));
 return $this-redirect(['controller' = 'houses', 'action' 
 = 'view', $unit-house_id]);
 }
 }
 
 $this-set(compact('unit'));
 }


 *debug($unit):*

 */src/Controller/UnitsController.php* (line *53*)

 object(Cake\ORM\Entity) {

   'new' = false,
   'accessible' = [
   '*' = true
   ],
   'properties' = [
   'id' = (int) 1,
   'name' = '1st Floor - Front',
   'house_id' = (int) 2,
   'billing_date' = object(Cake\I18n\Time) {

   'time' = '2014-12-05T00:00:00+',
   'timezone' = 'UTC',
   'fixedNowTime' = false
   
   },
   'created' = object(Cake\I18n\Time) {

   'time' = '2014-12-10T14:59:25+',
   'timezone' = 'UTC',
   'fixedNowTime' = false
   
   },
   'modified' = object(Cake\I18n\Time) {

   'time' = '2014-12-10T14:59:25+',
   'timezone' = 'UTC',
   'fixedNowTime' = false
   
   },
   'cost' = object(Cake\ORM\Entity) {

   'new' = true,
   'accessible' = [
   '*' = true
   ],
   'properties' = [
   'rental_cost' = (float) 2000
   ],
   'dirty' = [
   'rental_cost' = true
   ],
   'original' = [],
   'virtual' = [],
   'errors' = [],
   'repository' = 'Costs'
   
   },
   'fixed_cost' = object(Cake\ORM\Entity) {

   'new' = true,
   'accessible' = [
   '*' = true
   ],
   'properties' = [
   'gas_bill' = (int) 500,
   'water_bill' = (int) 300,
   'service_bill' = (int) 300
   ],
   'dirty' = [
   'gas_bill' = true,
   'water_bill' = true,
   'service_bill' = true
   ],
   'original' = [],
   'virtual' = [],
   'errors' = [],
   'repository' = 'FixedCosts'
   
   }
   ],
   'dirty' = [
   'cost' = true,
   'fixed_cost' = true
   ],
   'original' = [],
   'virtual' = [],
   'errors' = [],
   'repository' = 'Units'

 }


 Thanks
 Bayezid


 On Sat, Dec 13, 2014 at 3:45 PM, José Lorenzo jose@gmail.com wrote:

 Ah ok. I understand the question now. Instead of using newEntity() you 
 should use patchEntity()

 $unitId = $this-Units-get($uId);
 $unit = $this-Units-patchEntity($unitId, 
 $this-request-data(),['associated' 
 = ['Costs', 'FixedCosts']]);


 On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary 
 key from units Controller.

 i did below things but its creating a new record at unit Table instead 
 of using primaryKey

 Form at unitsController:

 ?php

 echo $this-Form-create($unit);
 echo $this-Form-input('cost.rental_cost');
 echo $this-Form-input('fixed_cost.gas_bill');
 echo $this-Form-input('fixed_cost.water_bill');
 echo 

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-12 Thread José Lorenzo
Can you show how your UnitsTable look like? Can you also show a 
debug($unit) before you all save() ?

On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary 
 key from units Controller.

 i did below things but its creating a new record at unit Table instead of 
 using primaryKey

 Form at unitsController:

 ?php

 echo $this-Form-create($unit);
 echo $this-Form-input('cost.rental_cost');
 echo $this-Form-input('fixed_cost.gas_bill');
 echo $this-Form-input('fixed_cost.water_bill');
 echo $this-Form-input('fixed_cost.service_bill');
 echo $this-Form-button('Save Costs');
 echo $this-Form-end();

 ?

 Function at UnitsController:

 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a 
 valid ID'));
 }
 
 $unitId = $this-Units-get($uId);
 
 $unit = 
 $this-Units-newEntity($this-request-data(),['associated' = ['Costs', 
 'FixedCosts']]);
 
 if ($this-request-is('post')){
 $unit-cost-unit_id = $unit-fixed_cost-unit_id = 
 $unitId-id;
 if ($this-Units-save($unit)){
 $this-Flash-success(__('The unit cost has been added'));
 return $this-redirect(['controller' = 'houses', 'action' 
 = 'view', $unit-house_id]);
 }
 }
 
 $this-set(compact('unit'));
 }

 Please suggest me on this regard.

 Thanks
 Bayezid



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-12 Thread Md Bayezid Alam
Hello Lerenzo,

Please find the UnitsTable and debug($unit) as follows:

*UnitsTable:*

?php
namespace App\Model\Table;

use Cake\ORM\Table;

class UnitsTable extends Table {

public function initialize(array $config) {
$this-table('units');
$this-addBehavior('Timestamp');
$this-primaryKey('id');

// association goes here
$this-belongsTo('Houses',[
'foreignKey' = 'house_id'
]);

$this-hasOne('Costs',[
'foreignKey' = 'unit_id'
]);

$this-hasOne('FixedCosts',[
'foreignKey' = 'unit_id'
]);

}
}

?

*debug($unit):*

*/src/Controller/UnitsController.php* (line *53*)

object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'cost' = object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'rental_cost' = (float) 14500
],
'dirty' = [
'rental_cost' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'Costs'

},
'fixed_cost' = object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'gas_bill' = (int) 450,
'water_bill' = (int) 600,
'service_bill' = (int) 500
],
'dirty' = [
'gas_bill' = true,
'water_bill' = true,
'service_bill' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'FixedCosts'

}
],
'dirty' = [
'cost' = true,
'fixed_cost' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'Units'

}


Thanks
Bayezid

On Fri, Dec 12, 2014 at 3:02 PM, José Lorenzo jose@gmail.com wrote:

 Can you show how your UnitsTable look like? Can you also show a
 debug($unit) before you all save() ?


 On Thursday, December 11, 2014 5:08:27 PM UTC+1, Bayezid Alam wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary
 key from units Controller.

 i did below things but its creating a new record at unit Table instead of
 using primaryKey

 Form at unitsController:

 ?php

 echo $this-Form-create($unit);
 echo $this-Form-input('cost.rental_cost');
 echo $this-Form-input('fixed_cost.gas_bill');
 echo $this-Form-input('fixed_cost.water_bill');
 echo $this-Form-input('fixed_cost.service_bill');
 echo $this-Form-button('Save Costs');
 echo $this-Form-end();

 ?

 Function at UnitsController:

 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a
 valid ID'));
 }

 $unitId = $this-Units-get($uId);

 $unit = $this-Units-newEntity($this-request-data(),['associated'
 = ['Costs', 'FixedCosts']]);

 if ($this-request-is('post')){
 $unit-cost-unit_id = $unit-fixed_cost-unit_id =
 $unitId-id;
 if ($this-Units-save($unit)){
 $this-Flash-success(__('The unit cost has been added'));
 return $this-redirect(['controller' = 'houses',
 'action' = 'view', $unit-house_id]);
 }
 }

 $this-set(compact('unit'));
 }

 Please suggest me on this regard.

 Thanks
 Bayezid

  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from 

Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-12 Thread Md Bayezid Alam
Hello Lorenzo,


please Ignore Previous debug($unit)  find the latest debug($unit) before
all save()

*/src/Controller/UnitsController.php* (line *59*)

object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'cost' = object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'rental_cost' = (float) 14500,
'unit_id' = (int) 1
],
'dirty' = [
'rental_cost' = true,
'unit_id' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'Costs'

},
'fixed_cost' = object(Cake\ORM\Entity) {

'new' = true,
'accessible' = [
'*' = true
],
'properties' = [
'gas_bill' = (int) 450,
'water_bill' = (int) 600,
'service_bill' = (int) 500,
'unit_id' = (int) 1
],
'dirty' = [
'gas_bill' = true,
'water_bill' = true,
'service_bill' = true,
'unit_id' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'FixedCosts'

}
],
'dirty' = [
'cost' = true,
'fixed_cost' = true
],
'original' = [],
'virtual' = [],
'errors' = [],
'repository' = 'Units'

}


Note: A new record is being saved in UnitsTable but i don't want to


Thanks

Bayezid



On Fri, Dec 12, 2014 at 10:35 PM, Md Bayezid Alam bayezid...@gmail.com
wrote:

 Hello Lerenzo,

 Please find the UnitsTable and debug($unit) as follows:

 *UnitsTable:*

 ?php
 namespace App\Model\Table;

 use Cake\ORM\Table;

 class UnitsTable extends Table {

 public function initialize(array $config) {
 $this-table('units');
 $this-addBehavior('Timestamp');
 $this-primaryKey('id');

 // association goes here
 $this-belongsTo('Houses',[
 'foreignKey' = 'house_id'
 ]);

 $this-hasOne('Costs',[
 'foreignKey' = 'unit_id'
 ]);

 $this-hasOne('FixedCosts',[
 'foreignKey' = 'unit_id'
 ]);

 }
 }

 ?

 *debug($unit):*

 */src/Controller/UnitsController.php* (line *53*)

 object(Cake\ORM\Entity) {

   'new' = true,
   'accessible' = [
   '*' = true
   ],
   'properties' = [
   'cost' = object(Cake\ORM\Entity) {

   'new' = true,
   'accessible' = [
   '*' = true
   ],
   'properties' = [
   'rental_cost' = (float) 14500
   ],
   'dirty' = [
   'rental_cost' = true
   ],
   'original' = [],
   'virtual' = [],
   'errors' = [],
   'repository' = 'Costs'
   
   },
   'fixed_cost' = object(Cake\ORM\Entity) {

   'new' = true,
   'accessible' = [
   '*' = true
   ],
   'properties' = [
   'gas_bill' = (int) 450,
   'water_bill' = (int) 600,
   'service_bill' = (int) 500
   ],
   'dirty' = [
   'gas_bill' = true,
   'water_bill' = true,
   'service_bill' = true
   ],
   'original' = [],
   'virtual' = [],
   'errors' = [],
   'repository' = 'FixedCosts'
   
   }
   ],
   'dirty' = [
   'cost' = true,
   'fixed_cost' = true
   ],
   'original' = [],
   'virtual' = [],
   'errors' = [],
   'repository' = 'Units'

 }


 Thanks
 Bayezid

 On Fri, Dec 12, 2014 at 

3.0 - How to add a form data using its primarykey to its associated tables

2014-12-11 Thread Md Bayezid Alam
Hi,


i have Tables :

Units hasOne costs  hasOne fixed_costs

i want to add data to costs and fixed_costs table using units's primary key
from units Controller.

i did below things but its creating a new record at unit Table instead of
using primaryKey

Form at unitsController:

?php

echo $this-Form-create($unit);
echo $this-Form-input('cost.rental_cost');
echo $this-Form-input('fixed_cost.gas_bill');
echo $this-Form-input('fixed_cost.water_bill');
echo $this-Form-input('fixed_cost.service_bill');
echo $this-Form-button('Save Costs');
echo $this-Form-end();

?

Function at UnitsController:

public function add_cost($uId){
if (!$uId){
throw new NotFoundException(__('Unit id Not found, try with a
valid ID'));
}

$unitId = $this-Units-get($uId);

$unit =
$this-Units-newEntity($this-request-data(),['associated' = ['Costs',
'FixedCosts']]);

if ($this-request-is('post')){
$unit-cost-unit_id = $unit-fixed_cost-unit_id = $unitId-id;
if ($this-Units-save($unit)){
$this-Flash-success(__('The unit cost has been added'));
return $this-redirect(['controller' = 'houses', 'action'
= 'view', $unit-house_id]);
}
}

$this-set(compact('unit'));
}

Please suggest me on this regard.

Thanks
Bayezid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0 - How to add a form data using its primarykey to its associated tables

2014-12-11 Thread Md Bayezid Alam
HI

May i get a suggestion on this?

I did google but found nothing.

Thanks
Bayezid

On Thu, Dec 11, 2014 at 10:07 PM, Md Bayezid Alam bayezid...@gmail.com
wrote:

 Hi,


 i have Tables :

 Units hasOne costs  hasOne fixed_costs

 i want to add data to costs and fixed_costs table using units's primary
 key from units Controller.

 i did below things but its creating a new record at unit Table instead of
 using primaryKey

 Form at unitsController Template:

 ?php

 echo $this-Form-create($unit);
 echo $this-Form-input('cost.rental_cost');
 echo $this-Form-input('fixed_cost.gas_bill');
 echo $this-Form-input('fixed_cost.water_bill');
 echo $this-Form-input('fixed_cost.service_bill');
 echo $this-Form-button('Save Costs');
 echo $this-Form-end();

 ?

 Function at UnitsController:

 public function add_cost($uId){
 if (!$uId){
 throw new NotFoundException(__('Unit id Not found, try with a
 valid ID'));
 }

 $unitId = $this-Units-get($uId);

 $unit =
 $this-Units-newEntity($this-request-data(),['associated' = ['Costs',
 'FixedCosts']]);

 if ($this-request-is('post')){
 $unit-cost-unit_id = $unit-fixed_cost-unit_id =
 $unitId-id;
 if ($this-Units-save($unit)){
 $this-Flash-success(__('The unit cost has been added'));
 return $this-redirect(['controller' = 'houses', 'action'
 = 'view', $unit-house_id]);
 }
 }

 $this-set(compact('unit'));
 }

 Please suggest me on this regard.

 Thanks
 Bayezid



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


htmlpurifier sanitize form data

2014-08-11 Thread vbpupil
Not sure if anyone is familiar with this plugin? i have it installed and 
can sanaitize indiviual strings ie:

$test = Purifier::clean('stronghiscript$( document ).ready(function() { 
alert(hacked!);});/script', 'general');


which is working fine but i want to sanitize my form data ie:


$this-request-data = Purifier::clean($this-request-data, 'general');

which is failing because its an array (see below). Surely there must be an 
easier way to do this?





preg_match() expects parameter 2 to be string, array given 
[*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*, 
line *316*]



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: htmlpurifier sanitize form data

2014-08-11 Thread Stephen S
You could use array_walk to do this if you know the model name it'd be
easier http://php.net/manual/en/function.array-walk.php

array_walk($this-request-data['Model'], '_purify')


On 11 August 2014 12:24, vbpupil vbpu...@gmail.com wrote:

 Not sure if anyone is familiar with this plugin? i have it installed and
 can sanaitize indiviual strings ie:

 $test = Purifier::clean('stronghiscript$( document ).ready(function()
 { alert(hacked!);});/script', 'general');


 which is working fine but i want to sanitize my form data ie:


 $this-request-data = Purifier::clean($this-request-data, 'general');

 which is failing because its an array (see below). Surely there must be an
 easier way to do this?





 preg_match() expects parameter 2 to be string, array given 
 [*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*,
  line *316*]



  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




-- 
Kind Regards
 Stephen Speakman

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: htmlpurifier sanitize form data

2014-08-11 Thread euromark
Maybe you want to use https://github.com/burzum/cakephp-html-purifier 
instead.
Its also documented

mark


Am Montag, 11. August 2014 13:24:27 UTC+2 schrieb vbpupil:

 Not sure if anyone is familiar with this plugin? i have it installed and 
 can sanaitize indiviual strings ie:

 $test = Purifier::clean('stronghiscript$( document ).ready(function() 
 { alert(hacked!);});/script', 'general');


 which is working fine but i want to sanitize my form data ie:


 $this-request-data = Purifier::clean($this-request-data, 'general');

 which is failing because its an array (see below). Surely there must be an 
 easier way to do this?



 

 preg_match() expects parameter 2 to be string, array given 
 [*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*,
  line *316*]





-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: htmlpurifier sanitize form data

2014-08-11 Thread vbpupil
Thanks Mark

I wasnt able to find the solution there, unless im completely missing 
something.


On Monday, August 11, 2014 12:43:48 PM UTC+1, euromark wrote:

 Maybe you want to use https://github.com/burzum/cakephp-html-purifier 
 instead.
 Its also documented

 mark


 Am Montag, 11. August 2014 13:24:27 UTC+2 schrieb vbpupil:

 Not sure if anyone is familiar with this plugin? i have it installed and 
 can sanaitize indiviual strings ie:

 $test = Purifier::clean('stronghiscript$( document ).ready(function() 
 { alert(hacked!);});/script', 'general');


 which is working fine but i want to sanitize my form data ie:


 $this-request-data = Purifier::clean($this-request-data, 'general');

 which is failing because its an array (see below). Surely there must be 
 an easier way to do this?



 

 preg_match() expects parameter 2 to be string, array given 
 [*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*,
  line *316*]





-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: htmlpurifier sanitize form data

2014-08-11 Thread euromark
If you used that I bet you wouldn't run into the error above.
As it handles it in a more clean way.


Am Montag, 11. August 2014 14:19:34 UTC+2 schrieb vbpupil:

 Thanks Mark

 I wasnt able to find the solution there, unless im completely missing 
 something.


 On Monday, August 11, 2014 12:43:48 PM UTC+1, euromark wrote:

 Maybe you want to use https://github.com/burzum/cakephp-html-purifier 
 instead.
 Its also documented

 mark


 Am Montag, 11. August 2014 13:24:27 UTC+2 schrieb vbpupil:

 Not sure if anyone is familiar with this plugin? i have it installed and 
 can sanaitize indiviual strings ie:

 $test = Purifier::clean('stronghiscript$( document 
 ).ready(function() { alert(hacked!);});/script', 'general');


 which is working fine but i want to sanitize my form data ie:


 $this-request-data = Purifier::clean($this-request-data, 'general');

 which is failing because its an array (see below). Surely there must be 
 an easier way to do this?



 

 preg_match() expects parameter 2 to be string, array given 
 [*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*,
  line *316*]





-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: htmlpurifier sanitize form data

2014-08-11 Thread vbpupil
thanks Stephen

ill keep playing but wasnt able to get it working using this method, ill 
keep reading the link you provided.

Im wondering if this is the right way to go or save all user data and strip 
when i come to use the data. I know this is a little off topic but would be 
interested in hearing your thoughts?

On Monday, August 11, 2014 12:31:29 PM UTC+1, Stephen S wrote:

 You could use array_walk to do this if you know the model name it'd be 
 easier http://php.net/manual/en/function.array-walk.php

 array_walk($this-request-data['Model'], '_purify')


 On 11 August 2014 12:24, vbpupil vbp...@gmail.com javascript: wrote:

 Not sure if anyone is familiar with this plugin? i have it installed and 
 can sanaitize indiviual strings ie:

 $test = Purifier::clean('stronghiscript$( document ).ready(function() 
 { alert(hacked!);});/script', 'general');


 which is working fine but i want to sanitize my form data ie:


 $this-request-data = Purifier::clean($this-request-data, 'general');

 which is failing because its an array (see below). Surely there must be 
 an easier way to do this?



 

 preg_match() expects parameter 2 to be string, array given 
 [*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*,
  line *316*]



  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.com 
 javascript:.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Kind Regards
  Stephen Speakman
  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: htmlpurifier sanitize form data

2014-08-11 Thread euromark
No, actually its not.
This approach should only be taken for HTML content going in when you are 
providing WYSIWYG editors for the form inputs etc.
Otherwise, all normal text input posted should go into the DB without any 
modification
Its a bad practice to filter those.

Simply use h() to secure the output upon display. Done.

mark


Am Montag, 11. August 2014 14:21:17 UTC+2 schrieb vbpupil:

 thanks Stephen

 ill keep playing but wasnt able to get it working using this method, ill 
 keep reading the link you provided.

 Im wondering if this is the right way to go or save all user data and 
 strip when i come to use the data. I know this is a little off topic but 
 would be interested in hearing your thoughts?

 On Monday, August 11, 2014 12:31:29 PM UTC+1, Stephen S wrote:

 You could use array_walk to do this if you know the model name it'd be 
 easier http://php.net/manual/en/function.array-walk.php

 array_walk($this-request-data['Model'], '_purify')


 On 11 August 2014 12:24, vbpupil vbp...@gmail.com wrote:

 Not sure if anyone is familiar with this plugin? i have it installed and 
 can sanaitize indiviual strings ie:

 $test = Purifier::clean('stronghiscript$( document 
 ).ready(function() { alert(hacked!);});/script', 'general');


 which is working fine but i want to sanitize my form data ie:


 $this-request-data = Purifier::clean($this-request-data, 'general');

 which is failing because its an array (see below). Surely there must be 
 an easier way to do this?



 

 preg_match() expects parameter 2 to be string, array given 
 [*APP/Plugin/HtmlPurifier/Vendor/HtmlPurifier/library/HTMLPurifier/Lexer.php*,
  line *316*]



  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 --- 
 You received this message because you are subscribed to the Google 
 Groups CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to cake-php+u...@googlegroups.com.
 To post to this group, send email to cake...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Kind Regards
  Stephen Speakman
  


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


RE: form data

2014-05-24 Thread Advantage+
Perhaps read the Cookbook on data handling and how to access and use it.

 

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
Andrew Barry
Sent: Saturday, May 24, 2014 6:02 AM
To: cake-php@googlegroups.com
Subject: form data

 

Hi,

I created a form and a submit button.
After that I want to 
1) display certain fields back to another view  and that means the posted data 
is handled by the controller?
I am really finding this hard to get a complete example on this and cakephp 
book isnt helping as yet.

echo $this-Form-create();

echo $this-Form-input('username');   //text
echo $this-Form-input('password');   //password
echo $this-Form-input('birth_dt', 
   array('label' = 'Date of birth',
  'dateFormat' = 'DMY',
  'minYear' = date('Y') - 70,
  'maxYear' = date('Y') - 18));   
 echo $this-Form-checkbox('done');
echo $this-Form-input('field', array(
'options' = array(1, 2, 3, 4, 5),
'empty' = '(choose one)'));
echo $this-Form-end('submit');

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


RE: form data

2014-05-24 Thread Advantage+
I also want to build the next best social media website can you tell me 
how. 

I just want you to do it for me and not do any of the work myself J

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
Andrew Barry
Sent: Saturday, May 24, 2014 6:02 AM
To: cake-php@googlegroups.com
Subject: form data

 

Hi,

I created a form and a submit button.
After that I want to 
1) display certain fields back to another view  and that means the posted data 
is handled by the controller?
I am really finding this hard to get a complete example on this and cakephp 
book isnt helping as yet.

echo $this-Form-create();

echo $this-Form-input('username');   //text
echo $this-Form-input('password');   //password
echo $this-Form-input('birth_dt', 
   array('label' = 'Date of birth',
  'dateFormat' = 'DMY',
  'minYear' = date('Y') - 70,
  'maxYear' = date('Y') - 18));   
 echo $this-Form-checkbox('done');
echo $this-Form-input('field', array(
'options' = array(1, 2, 3, 4, 5),
'empty' = '(choose one)'));
echo $this-Form-end('submit');

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: form data

2014-05-24 Thread Andrew Barry
Ok I was hoping I wouldnt get such a response.

I have been looking at this book and you have to admit , it just isnt 
always going to help you do a complete example.

data goes back to the controller in a 

$this-request-data['MyModel']['title']; and this means I can do what and 
where ? is there an example anywhere?


http://book.cakephp.org/2.0/en/controllers/request-response.html  //this 
doesnt help

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


RE: form data

2014-05-24 Thread Advantage+
And show your code to show you made an effort.

We cannot see what your looking at.

 

What have you tried, what was the response, your model / controllers. Your 
trying to do what and this is where your at after doing? Error logs say what?

 

We cant help if you don’t put in the effort yourself.

 

 

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of 
Andrew Barry
Sent: Saturday, May 24, 2014 6:31 AM
To: cake-php@googlegroups.com
Subject: Re: form data

 

Ok I was hoping I wouldnt get such a response.

I have been looking at this book and you have to admit , it just isnt always 
going to help you do a complete example.

data goes back to the controller in a 

$this-request-data['MyModel']['title']; and this means I can do what and 
where ? is there an example anywhere?



http://book.cakephp.org/2.0/en/controllers/request-response.html  //this doesnt 
help

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: form data

2014-05-24 Thread Andrew Barry
what happens is that the form in  myform2 displays but the id fields are 
blank dropdown.
These fields are not autoincrement.
I submit and I can get the subject field displayed in myform3 but not id or 
date fields.




controller
public  function myform3()
{
   
   if($this-request-is('post')) {
$this-set('tutorInput', $this-request-data);
}
}



myform2 view
   echo $this-Form-create(array('action' = 'myform3'));
echo $this-Form-input('teacher_id');   //text
echo $this-Form-input('student_id');   //text
 echo $this-Form-input('subject');   //text
echo $this-Form-input('sessiondate', 
   array('label' = 'Session'));  
echo $this-Form-input('sessiontime', 
   array('label' = 'time'));  
 echo $this-Form-input('available');  
  echo $this-Form-end('submit'); 
 
myform3 view

  echo 'td'. $tutorInput['Tutorsession']['subject'].'/td';
   echo 'td'. $tutorInput['Tutorsession']['sessiondate'].'/td';
 echo 'td'. $tutorInput['Tutorsession']['student_id'].'/td';
   echo 'td'. $tutorInput['Tutorsession']['sessiontime'].'/td';
 echo '/trbr/';
   

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Prefilling form data doesn't seem to work

2013-08-14 Thread David Carr
Here's what I am trying to accomplish:

A user fills out a form, saves a record.  At some later date they wish to 
clone this record, but may want to make a few tweaks.  This clone 
functionality should direct them to a form that is pre-filled with the 
previous record's data so that they can review it, edit as needed, and 
submit it as a new record.

What I'm trying:

I've modified my add() function to accept a parameters:

function add($cloneid = NULL)

Then created a Clone link that sends them to site/model/add/id

Then, I get the data from that model:

$clone_source = $this-Model-findById($cloneid);
$this-data['Model']['field1'] = $clone_source['Model']['field1'];

and so on.  Based on Google searching and other posts, this should work. 
 But what actually happens is that upon clicking the 'Clone' link, the user 
is directed and the form submits itself immediately (failing to save the 
record, since it fails validation) and the user never actually sees the 
form.

What am I doing wrong?  (Also I should note, there are relational models 
present, but I don't think this should be the cause of any problems...I 
hope).

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Prefilling form data doesn't seem to work

2013-08-14 Thread Anja Liebermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi David,


this is how I would do it:

copy your edit method and rename it to copy. Like with edit you fetch
the data which should be cloned and show then in a view copy.ctp which
has a form like for adding a new record.
Then when the user submits you call your copy method again in the hey I
have post data fork and save it as a new record by unsetting a probably
exiting id.

That should do it.

HTH!
Anja



Am 14.08.2013 20:22, schrieb David Carr:
 Here's what I am trying to accomplish:
 
 A user fills out a form, saves a record.  At some later date they wish to 
 clone this record, but may want to make a few tweaks.  This clone 
 functionality should direct them to a form that is pre-filled with the 
 previous record's data so that they can review it, edit as needed, and 
 submit it as a new record.
 
 What I'm trying:
 
 I've modified my add() function to accept a parameters:
 
 function add($cloneid = NULL)
 
 Then created a Clone link that sends them to site/model/add/id
 
 Then, I get the data from that model:
 
 $clone_source = $this-Model-findById($cloneid);
 $this-data['Model']['field1'] = $clone_source['Model']['field1'];
 
 and so on.  Based on Google searching and other posts, this should work. 
  But what actually happens is that upon clicking the 'Clone' link, the user 
 is directed and the form submits itself immediately (failing to save the 
 record, since it fails validation) and the user never actually sees the 
 form.
 
 What am I doing wrong?  (Also I should note, there are relational models 
 present, but I don't think this should be the cause of any problems...I 
 hope).
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlILzzsACgkQbOdiIJzHNKHLNQCgrshOiC1PR3d3fC5R033EBvqF
1fkAn2/8z7qSKbalW6aEdYHIQI0ymhhm
=RTV3
-END PGP SIGNATURE-

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Prefilling form data doesn't seem to work

2013-08-14 Thread Jeremy Burns : Class Outfit
$data = $this-Model-find etc...

unset($data['Model']['id'];

$this-data = $data;


On 14 Aug 2013, at 19:40, Anja Liebermann c...@anjaliebermann.de wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi David,
 
 
 this is how I would do it:
 
 copy your edit method and rename it to copy. Like with edit you fetch
 the data which should be cloned and show then in a view copy.ctp which
 has a form like for adding a new record.
 Then when the user submits you call your copy method again in the hey I
 have post data fork and save it as a new record by unsetting a probably
 exiting id.
 
 That should do it.
 
 HTH!
 Anja
 
 
 
 Am 14.08.2013 20:22, schrieb David Carr:
 Here's what I am trying to accomplish:
 
 A user fills out a form, saves a record.  At some later date they wish to 
 clone this record, but may want to make a few tweaks.  This clone 
 functionality should direct them to a form that is pre-filled with the 
 previous record's data so that they can review it, edit as needed, and 
 submit it as a new record.
 
 What I'm trying:
 
 I've modified my add() function to accept a parameters:
 
 function add($cloneid = NULL)
 
 Then created a Clone link that sends them to site/model/add/id
 
 Then, I get the data from that model:
 
 $clone_source = $this-Model-findById($cloneid);
 $this-data['Model']['field1'] = $clone_source['Model']['field1'];
 
 and so on.  Based on Google searching and other posts, this should work. 
 But what actually happens is that upon clicking the 'Clone' link, the user 
 is directed and the form submits itself immediately (failing to save the 
 record, since it fails validation) and the user never actually sees the 
 form.
 
 What am I doing wrong?  (Also I should note, there are relational models 
 present, but I don't think this should be the cause of any problems...I 
 hope).
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iEYEARECAAYFAlILzzsACgkQbOdiIJzHNKHLNQCgrshOiC1PR3d3fC5R033EBvqF
 1fkAn2/8z7qSKbalW6aEdYHIQI0ymhhm
 =RTV3
 -END PGP SIGNATURE-
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Posting form data with JSON

2011-11-14 Thread senser
Hello,

I'm working on project that is planned to heavily rely on data
exchange with JSON. Here is an exemplary ajax call that posts JSON
data to Cake's controller (code is in the view):

$.ajax({url: /project/Controller/action
   data: JSON.stringify($(this).serializeArray()),
   type: POST,
   processData: false,
   contentType: application/json,
   cache: false,
   dataType: json,
   accepts: json,
});

Data is posted and decoded in beforeFilter callback of controller
(RequestHandler makes this atuomatically). Data in controller action
looks in this way:

Array
(
[0] = Array
(
[name] = data[Status][id]
[value] = 48
)

)

I'm wondering what is the best way to convert this data to Cake'
native data array to be compatible for $this-Model-save($data),
i.e:

Array
(
[Status] =
   Array
  (
[id] = 48
  )
)

Regards,
Niki

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-11 Thread Alejandro Gómez Fernández
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Please, see your my.ini usually in xampp/mysql/bin.
There you can see here your mysql log is, searching this lines:

log_error   = C:/xampp/mysql/data/mysql.err
general_log_file= C:/xampp/mysql/data/mysql.log
slow_query_log_file = C:/xampp/mysql/data/mysql-slow.log

So, with this information you can see what sql instructions mysql
receibe and then you can see if cake is doing things right ;-)

Regards,



Alejandro Gomez.



El 11/03/2011 02:42, goluhaque escribió:
 No error was recorded in the Apache log file. Couldn't check the
 database log file as I didn't know where it was or how it could be
 accessed. I am using XAMPP(internal server) and a search could not
 reveal any results,
 
 On Mar 10, 5:27 pm, Afzalul Haque afzal...@gmail.com wrote:
 Haven't checked that one yet. Will do. Thanks.

 2011/3/10 Alejandro Gómez Fernández agom...@gmail.com








- --
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
others with their CakePHP related questions.

To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group
athttp://groups.google.com/group/cake-php

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNei/zAAoJEHQn9CmeN9DJc7QH/1RnL9lqUERooSi1auWB05DE
uqMSN1rBb1I1C9PjinGU6jURej/1cSohzgL6dT2LUQiL+qMvacSr85qkU88zN0Ct
SRpV01zldRXM5pbXykeNFjhjwfc+sbi62EFT6ZlJpmOhtCySD5MrVYljf05lFzN2
8NJsh2U5Gekjr3nAvj2ekYr7yp2vmulWNYw9mYmS3OIVVzTbh7+1Rr+xMQOyvFql
JVRYKuU9eJs9ZsjJdO5HzBZH41IGXKfW0WZC6LcbWoo6wQH+ImixszJjFKGnt++D
o7MdPBiDlTl06tAqQfYhkQUNhiLiPrPEPQK/1hKk6n/IrG6dABs3qRnvJKRbTIA=
=LaVx
-END PGP SIGNATURE-

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-11 Thread ShadowCross
goluhaque:

If I'm reading your code correctly, your Post model has a validation
rule on a fieldName 'post' that must be at least one character in
length and is required (although the rule name 'minLenght' is
misspelled).  However, the form defined in your view does not have an
input for this field, which means:

1) $this-data['Post']['post'] will never be defined by the time you
execute this-Post-save(), UNLESS you have defined a default value
for the 'post' field when you created the table.

and

2) the validation error 'Question cannot be empty' will never display
when the form is rendered again.  (Field validation errors are
automatically displayed with the corresponding input() if you create
your forms using the FormHelper).

To verify, try adding the following lines in the ELSE block (where you
execute $this-Session-setFlash(__('Post user id Could not be saved',
true));
):

  Configure::write('debug', 2);
  debug($this-Post-validationErrors);


and check the value displayed in the debug block on the rendered page.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread rethab
why not omitting the index 'Post' as well?

On 10 Mrz., 07:29, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 This line looks wrong:

 if ($this-Post-save($this-data['Post']['user_id']) == true) {

 Try:

 if ($this-Post-save($this-data['Post']) == true) {

 Jeremy Burns
 Class Outfit

 jeremybu...@classoutfit.comhttp://www.classoutfit.com

 On 10 Mar 2011, at 06:15, goluhaque wrote:

  My controller-

                     function add() {
             if (!empty($this-data)) {
                     $this-Post-create();
                     $this-data['Post']['user_id'] = $this-Auth-user('id');
                     if ($this-Post-save($this-data['Post']['user_id']) == 
  true) {
                             $this-Session-setFlash(__('The post user id 
  has been saved', true));
                     } else {
                             $this-Session-setFlash(__('Post user id Could 
  not be saved', true));
                     }
             }
       }
  My view-

        ?php echo $this-element('action_shit'); ?
      div class=posts form  
      ?php echo $this-Form-create('Post');?
     fieldset
             legend?php __('Add Post'); ?/legend
     ?php
             echo $this-Form-input('title');
             echo $this-Form-input('body');
     ?
     /fieldset
       ?php echo $this-Form-end(__('Submit', true));?
       /div
  My model-
  ?php
  class Post extends AppModel {
     var $name = 'Post';
     var $useDbConfig = 'DEFAULT';
     var $displayField = 'title';
     //The Associations below have been created with all possible keys, those 
  that are not needed can be removed

     var $belongsTo = array(
             'User' = array(
                     'className' = 'User',
                     'foreignKey' = 'user_id',
                     'conditions' = '',
                     'fields' = '',
                     'order' = ''
             )
     );
     var $validate = array(
             'post' = array(
                     'rule' = array('minLenght', 1),
                     'required' = true,
                     'allowEmpty' = false,
                     'message' = 'Question cannot be empty'
             )
     );
     var $hasMany = array(
             'Comment' = array(
                     'className' = 'Comment',
                     'foreignKey' = 'post_id',
                     'dependent' = false,
                     'conditions' = '',
                     'fields' = '',
                     'order' = '',
                     'limit' = '',
                     'offset' = '',
                     'exclusive' = '',
                     'finderQuery' = '',
                     'counterQuery' = ''
             )
     );

  }
  ?

  The save function is returning false, even if there's no beforeSave() 
  function in the AppController. The name of the database fields and the form 
  fields matches, so there's no problem there. What can be the problem 
  exactly?

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread Jeremy Burns | Class Outfit
Yup - you can do that.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 10 Mar 2011, at 12:14, rethab wrote:

 why not omitting the index 'Post' as well?
 
 On 10 Mrz., 07:29, Jeremy Burns | Class Outfit
 jeremybu...@classoutfit.com wrote:
 This line looks wrong:
 
 if ($this-Post-save($this-data['Post']['user_id']) == true) {
 
 Try:
 
 if ($this-Post-save($this-data['Post']) == true) {
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.comhttp://www.classoutfit.com
 
 On 10 Mar 2011, at 06:15, goluhaque wrote:
 
 My controller-
 
function add() {
if (!empty($this-data)) {
$this-Post-create();
$this-data['Post']['user_id'] = $this-Auth-user('id');
if ($this-Post-save($this-data['Post']['user_id']) == 
 true) {
$this-Session-setFlash(__('The post user id 
 has been saved', true));
} else {
$this-Session-setFlash(__('Post user id Could 
 not be saved', true));
}
}
  }
 My view-
 
   ?php echo $this-element('action_shit'); ?
 div class=posts form  
 ?php echo $this-Form-create('Post');?
fieldset
legend?php __('Add Post'); ?/legend
?php
echo $this-Form-input('title');
echo $this-Form-input('body');
?
/fieldset
  ?php echo $this-Form-end(__('Submit', true));?
  /div
 My model-
 ?php
 class Post extends AppModel {
var $name = 'Post';
var $useDbConfig = 'DEFAULT';
var $displayField = 'title';
//The Associations below have been created with all possible keys, those 
 that are not needed can be removed
 
var $belongsTo = array(
'User' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
);
var $validate = array(
'post' = array(
'rule' = array('minLenght', 1),
'required' = true,
'allowEmpty' = false,
'message' = 'Question cannot be empty'
)
);
var $hasMany = array(
'Comment' = array(
'className' = 'Comment',
'foreignKey' = 'post_id',
'dependent' = false,
'conditions' = '',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'exclusive' = '',
'finderQuery' = '',
'counterQuery' = ''
)
);
 
 }
 ?
 
 The save function is returning false, even if there's no beforeSave() 
 function in the AppController. The name of the database fields and the form 
 fields matches, so there's no problem there. What can be the problem 
 exactly?
 
 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
 others with their CakePHP related questions.
 
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
 
 
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread goluhaque
I know, I know, we can just do the $this-data part, but that doesn't
work too.

On Mar 10, 5:16 pm, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 Yup - you can do that.

 Jeremy Burns
 Class Outfit

 jeremybu...@classoutfit.com
 (t) +44 (0) 208 123 3822
 (m) +44 (0) 7973 481949
 Skype: jeremy_burnshttp://www.classoutfit.com

 On 10 Mar 2011, at 12:14, rethab wrote:







  why not omitting the index 'Post' as well?

  On 10 Mrz., 07:29, Jeremy Burns | Class Outfit
  jeremybu...@classoutfit.com wrote:
  This line looks wrong:

  if ($this-Post-save($this-data['Post']['user_id']) == true) {

  Try:

  if ($this-Post-save($this-data['Post']) == true) {

  Jeremy Burns
  Class Outfit

  jeremybu...@classoutfit.comhttp://www.classoutfit.com

  On 10 Mar 2011, at 06:15, goluhaque wrote:

  My controller-

                     function add() {
             if (!empty($this-data)) {
                     $this-Post-create();
                     $this-data['Post']['user_id'] = 
  $this-Auth-user('id');
                     if ($this-Post-save($this-data['Post']['user_id']) 
  == true) {
                             $this-Session-setFlash(__('The post user id 
  has been saved', true));
                     } else {
                             $this-Session-setFlash(__('Post user id 
  Could not be saved', true));
                     }
             }
       }
  My view-

        ?php echo $this-element('action_shit'); ?
      div class=posts form  
      ?php echo $this-Form-create('Post');?
     fieldset
             legend?php __('Add Post'); ?/legend
     ?php
             echo $this-Form-input('title');
             echo $this-Form-input('body');
     ?
     /fieldset
       ?php echo $this-Form-end(__('Submit', true));?
       /div
  My model-
  ?php
  class Post extends AppModel {
     var $name = 'Post';
     var $useDbConfig = 'DEFAULT';
     var $displayField = 'title';
     //The Associations below have been created with all possible keys, 
  those that are not needed can be removed

     var $belongsTo = array(
             'User' = array(
                     'className' = 'User',
                     'foreignKey' = 'user_id',
                     'conditions' = '',
                     'fields' = '',
                     'order' = ''
             )
     );
     var $validate = array(
             'post' = array(
                     'rule' = array('minLenght', 1),
                     'required' = true,
                     'allowEmpty' = false,
                     'message' = 'Question cannot be empty'
             )
     );
     var $hasMany = array(
             'Comment' = array(
                     'className' = 'Comment',
                     'foreignKey' = 'post_id',
                     'dependent' = false,
                     'conditions' = '',
                     'fields' = '',
                     'order' = '',
                     'limit' = '',
                     'offset' = '',
                     'exclusive' = '',
                     'finderQuery' = '',
                     'counterQuery' = ''
             )
     );

  }
  ?

  The save function is returning false, even if there's no beforeSave() 
  function in the AppController. The name of the database fields and the 
  form fields matches, so there's no problem there. What can be the problem 
  exactly?

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread Jeremy Burns | Class Outfit
What is the name of your Post model file?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Mar 2011, at 12:22, goluhaque wrote:

 I know, I know, we can just do the $this-data part, but that doesn't
 work too.
 
 On Mar 10, 5:16 pm, Jeremy Burns | Class Outfit
 jeremybu...@classoutfit.com wrote:
 Yup - you can do that.
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 (t) +44 (0) 208 123 3822
 (m) +44 (0) 7973 481949
 Skype: jeremy_burnshttp://www.classoutfit.com
 
 On 10 Mar 2011, at 12:14, rethab wrote:
 
 
 
 
 
 
 
 why not omitting the index 'Post' as well?
 
 On 10 Mrz., 07:29, Jeremy Burns | Class Outfit
 jeremybu...@classoutfit.com wrote:
 This line looks wrong:
 
 if ($this-Post-save($this-data['Post']['user_id']) == true) {
 
 Try:
 
 if ($this-Post-save($this-data['Post']) == true) {
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.comhttp://www.classoutfit.com
 
 On 10 Mar 2011, at 06:15, goluhaque wrote:
 
 My controller-
 
function add() {
if (!empty($this-data)) {
$this-Post-create();
$this-data['Post']['user_id'] = 
 $this-Auth-user('id');
if ($this-Post-save($this-data['Post']['user_id']) 
 == true) {
$this-Session-setFlash(__('The post user id 
 has been saved', true));
} else {
$this-Session-setFlash(__('Post user id 
 Could not be saved', true));
}
}
  }
 My view-
 
   ?php echo $this-element('action_shit'); ?
 div class=posts form  
 ?php echo $this-Form-create('Post');?
fieldset
legend?php __('Add Post'); ?/legend
?php
echo $this-Form-input('title');
echo $this-Form-input('body');
?
/fieldset
  ?php echo $this-Form-end(__('Submit', true));?
  /div
 My model-
 ?php
 class Post extends AppModel {
var $name = 'Post';
var $useDbConfig = 'DEFAULT';
var $displayField = 'title';
//The Associations below have been created with all possible keys, 
 those that are not needed can be removed
 
var $belongsTo = array(
'User' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
);
var $validate = array(
'post' = array(
'rule' = array('minLenght', 1),
'required' = true,
'allowEmpty' = false,
'message' = 'Question cannot be empty'
)
);
var $hasMany = array(
'Comment' = array(
'className' = 'Comment',
'foreignKey' = 'post_id',
'dependent' = false,
'conditions' = '',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'exclusive' = '',
'finderQuery' = '',
'counterQuery' = ''
)
);
 
 }
 ?
 
 The save function is returning false, even if there's no beforeSave() 
 function in the AppController. The name of the database fields and the 
 form fields matches, so there's no problem there. What can be the problem 
 exactly?
 
 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
 others with their CakePHP related questions.
 
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php
 
 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
 others with their CakePHP related questions.
 
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
 
 
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread Afzalul Haque
post.php

On Thu, Mar 10, 2011 at 5:54 PM, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 What is the name of your Post model file?

 Jeremy Burns
 Class Outfit

 jeremybu...@classoutfit.com
 http://www.classoutfit.com

 On 10 Mar 2011, at 12:22, goluhaque wrote:

  I know, I know, we can just do the $this-data part, but that doesn't
  work too.
 
  On Mar 10, 5:16 pm, Jeremy Burns | Class Outfit
  jeremybu...@classoutfit.com wrote:
  Yup - you can do that.
 
  Jeremy Burns
  Class Outfit
 
  jeremybu...@classoutfit.com
  (t) +44 (0) 208 123 3822
  (m) +44 (0) 7973 481949
  Skype: jeremy_burnshttp://www.classoutfit.com
 
  On 10 Mar 2011, at 12:14, rethab wrote:
 
 
 
 
 
 
 
  why not omitting the index 'Post' as well?
 
  On 10 Mrz., 07:29, Jeremy Burns | Class Outfit
  jeremybu...@classoutfit.com wrote:
  This line looks wrong:
 
  if ($this-Post-save($this-data['Post']['user_id']) == true) {
 
  Try:
 
  if ($this-Post-save($this-data['Post']) == true) {
 
  Jeremy Burns
  Class Outfit
 
  jeremybu...@classoutfit.comhttp://www.classoutfit.com
 
  On 10 Mar 2011, at 06:15, goluhaque wrote:
 
  My controller-
 
 function add() {
 if (!empty($this-data)) {
 $this-Post-create();
 $this-data['Post']['user_id'] =
 $this-Auth-user('id');
 if
 ($this-Post-save($this-data['Post']['user_id']) == true) {
 $this-Session-setFlash(__('The post user
 id has been saved', true));
 } else {
 $this-Session-setFlash(__('Post user id
 Could not be saved', true));
 }
 }
   }
  My view-
 
?php echo $this-element('action_shit'); ?
  div class=posts form
  ?php echo $this-Form-create('Post');?
 fieldset
 legend?php __('Add Post'); ?/legend
 ?php
 echo $this-Form-input('title');
 echo $this-Form-input('body');
 ?
 /fieldset
   ?php echo $this-Form-end(__('Submit', true));?
   /div
  My model-
  ?php
  class Post extends AppModel {
 var $name = 'Post';
 var $useDbConfig = 'DEFAULT';
 var $displayField = 'title';
 //The Associations below have been created with all possible keys,
 those that are not needed can be removed
 
 var $belongsTo = array(
 'User' = array(
 'className' = 'User',
 'foreignKey' = 'user_id',
 'conditions' = '',
 'fields' = '',
 'order' = ''
 )
 );
 var $validate = array(
 'post' = array(
 'rule' = array('minLenght', 1),
 'required' = true,
 'allowEmpty' = false,
 'message' = 'Question cannot be empty'
 )
 );
 var $hasMany = array(
 'Comment' = array(
 'className' = 'Comment',
 'foreignKey' = 'post_id',
 'dependent' = false,
 'conditions' = '',
 'fields' = '',
 'order' = '',
 'limit' = '',
 'offset' = '',
 'exclusive' = '',
 'finderQuery' = '',
 'counterQuery' = ''
 )
 );
 
  }
  ?
 
  The save function is returning false, even if there's no beforeSave()
 function in the AppController. The name of the database fields and the form
 fields matches, so there's no problem there. What can be the problem
 exactly?
 
  --
  Our newest site for the community: CakePHP Video Tutorialshttp://
 tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
 others with their CakePHP related questions.
 
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this
 group athttp://groups.google.com/group/cake-php
 
  --
  Our newest site for the community: CakePHP Video Tutorialshttp://
 tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
 others with their CakePHP related questions.
 
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this
 group athttp://groups.google.com/group/cake-php
 
  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.
 
 
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP 

Re: Problems in saving form data to database

2011-03-10 Thread Alejandro Gómez Fernández
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Do you read the database log? The web server log?
Sometimes this happend when there is a data type error in the database.
Regards,


Alejandro Gómez Fernández


El 10/03/2011 09:22, goluhaque escribió:
 I know, I know, we can just do the $this-data part, but that doesn't
 work too.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNeMNKAAoJEHQn9CmeN9DJrLgH/1qxD06Rq/+e8oB/Iw0Fgpwg
4weM9EXeWef0nc4zge0nAuaZYKm71YsYXLTUkXNYbc9GY3jYoytu1LWMPqb7aQZL
8k7Xg5Ke1kdPRsOXC6W61b56c6RKf7pk/rhunIOyQEWFYRAj4agzBEYxXPhwJdsr
pmXnokk11GKlqgsBf3ivGSoPg/J74w3ZveMLSl2V4kow/R69uu9DawgdUmbmXn98
zq6Le6X7wPHqyPKn6Ng0JeqPbUd33g4Iq88fFxbzM7E3n4o18EOfr6f7EnGNd/ye
YIr92TUCJrLIkormn4RbxOkXrEnAz05QVqGL0+OImAyUJx+ZjmaAgTCKMMhqtKk=
=lSgf
-END PGP SIGNATURE-

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread Afzalul Haque
Haven't checked that one yet. Will do. Thanks.

2011/3/10 Alejandro Gómez Fernández agom...@gmail.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 Do you read the database log? The web server log?
 Sometimes this happend when there is a data type error in the database.
 Regards,


 Alejandro Gómez Fernández


 El 10/03/2011 09:22, goluhaque escribió:
  I know, I know, we can just do the $this-data part, but that doesn't
  work too.

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.11 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iQEcBAEBAgAGBQJNeMNKAAoJEHQn9CmeN9DJrLgH/1qxD06Rq/+e8oB/Iw0Fgpwg
 4weM9EXeWef0nc4zge0nAuaZYKm71YsYXLTUkXNYbc9GY3jYoytu1LWMPqb7aQZL
 8k7Xg5Ke1kdPRsOXC6W61b56c6RKf7pk/rhunIOyQEWFYRAj4agzBEYxXPhwJdsr
 pmXnokk11GKlqgsBf3ivGSoPg/J74w3ZveMLSl2V4kow/R69uu9DawgdUmbmXn98
 zq6Le6X7wPHqyPKn6Ng0JeqPbUd33g4Iq88fFxbzM7E3n4o18EOfr6f7EnGNd/ye
 YIr92TUCJrLIkormn4RbxOkXrEnAz05QVqGL0+OImAyUJx+ZjmaAgTCKMMhqtKk=
 =lSgf
 -END PGP SIGNATURE-

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-10 Thread goluhaque
No error was recorded in the Apache log file. Couldn't check the
database log file as I didn't know where it was or how it could be
accessed. I am using XAMPP(internal server) and a search could not
reveal any results,

On Mar 10, 5:27 pm, Afzalul Haque afzal...@gmail.com wrote:
 Haven't checked that one yet. Will do. Thanks.

 2011/3/10 Alejandro Gómez Fernández agom...@gmail.com







  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1

  Do you read the database log? The web server log?
  Sometimes this happend when there is a data type error in the database.
  Regards,

  Alejandro Gómez Fernández

  El 10/03/2011 09:22, goluhaque escribió:
   I know, I know, we can just do the $this-data part, but that doesn't
   work too.

  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.11 (MingW32)
  Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/

  iQEcBAEBAgAGBQJNeMNKAAoJEHQn9CmeN9DJrLgH/1qxD06Rq/+e8oB/Iw0Fgpwg
  4weM9EXeWef0nc4zge0nAuaZYKm71YsYXLTUkXNYbc9GY3jYoytu1LWMPqb7aQZL
  8k7Xg5Ke1kdPRsOXC6W61b56c6RKf7pk/rhunIOyQEWFYRAj4agzBEYxXPhwJdsr
  pmXnokk11GKlqgsBf3ivGSoPg/J74w3ZveMLSl2V4kow/R69uu9DawgdUmbmXn98
  zq6Le6X7wPHqyPKn6Ng0JeqPbUd33g4Iq88fFxbzM7E3n4o18EOfr6f7EnGNd/ye
  YIr92TUCJrLIkormn4RbxOkXrEnAz05QVqGL0+OImAyUJx+ZjmaAgTCKMMhqtKk=
  =lSgf
  -END PGP SIGNATURE-

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
  athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problems in saving form data to database

2011-03-09 Thread goluhaque
My controller-

   function add() {
if (!empty($this-data)) {
$this-Post-create();
$this-data['Post']['user_id'] = $this-Auth-user('id');
if ($this-Post-save($this-data['Post']['user_id']) == true) {
$this-Session-setFlash(__('The post user id has been saved', true));
} else {
$this-Session-setFlash(__('Post user id Could not be saved', true));
}
}
  }

My view-

  ?php echo $this-element('action_shit'); ?
div class=posts form  
?php echo $this-Form-create('Post');?
  fieldset
  legend?php __('Add Post'); ?/legend
?php
echo $this-Form-input('title');
echo $this-Form-input('body');
?
/fieldset
 ?php echo $this-Form-end(__('Submit', true));? 
 /div

My model-

?php

class Post extends AppModel {

var $name = 'Post';

var $useDbConfig = 'DEFAULT';

var $displayField = 'title';

//The Associations below have been created with all possible keys, those 
that are not needed can be removed


var $belongsTo = array(

'User' = array(

'className' = 'User',

'foreignKey' = 'user_id',

'conditions' = '',

'fields' = '',

'order' = ''

)

);

var $validate = array(

'post' = array(

'rule' = array('minLenght', 1),

'required' = true,

'allowEmpty' = false,

'message' = 'Question cannot be empty'

)

);

var $hasMany = array(

'Comment' = array(

'className' = 'Comment',

'foreignKey' = 'post_id',

'dependent' = false,

'conditions' = '',

'fields' = '',

'order' = '',

'limit' = '',

'offset' = '',

'exclusive' = '',

'finderQuery' = '',

'counterQuery' = ''

)

);


}

?

 
The save function is returning false, even if there's no beforeSave() 
function in the AppController. The name of the database fields and the form 
fields matches, so there's no problem there. What can be the problem 
exactly?



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems in saving form data to database

2011-03-09 Thread Jeremy Burns | Class Outfit
This line looks wrong:

if ($this-Post-save($this-data['Post']['user_id']) == true) {

Try:

if ($this-Post-save($this-data['Post']) == true) {

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Mar 2011, at 06:15, goluhaque wrote:

 My controller-
 
function add() {
   if (!empty($this-data)) {
   $this-Post-create();
   $this-data['Post']['user_id'] = 
 $this-Auth-user('id');
   if ($this-Post-save($this-data['Post']['user_id']) 
 == true) {
   $this-Session-setFlash(__('The post user id 
 has been saved', true));
   } else {
   $this-Session-setFlash(__('Post user id Could 
 not be saved', true));
   }
   }
 }
 My view-
 
   ?php echo $this-element('action_shit'); ?
 div class=posts form  
 ?php echo $this-Form-create('Post');?
   fieldset
   legend?php __('Add Post'); ?/legend
   ?php
   echo $this-Form-input('title');
   echo $this-Form-input('body');
   ?
   /fieldset
  ?php echo $this-Form-end(__('Submit', true));? 
  /div
 My model-
 ?php
 class Post extends AppModel {
   var $name = 'Post';
   var $useDbConfig = 'DEFAULT';
   var $displayField = 'title';
   //The Associations below have been created with all possible keys, 
 those that are not needed can be removed
 
   var $belongsTo = array(
   'User' = array(
   'className' = 'User',
   'foreignKey' = 'user_id',
   'conditions' = '',
   'fields' = '',
   'order' = ''
   )
   );
   var $validate = array(
   'post' = array(
   'rule' = array('minLenght', 1),
   'required' = true,
   'allowEmpty' = false,
   'message' = 'Question cannot be empty'
   )
   );
   var $hasMany = array(
   'Comment' = array(
   'className' = 'Comment',
   'foreignKey' = 'post_id',
   'dependent' = false,
   'conditions' = '',
   'fields' = '',
   'order' = '',
   'limit' = '',
   'offset' = '',
   'exclusive' = '',
   'finderQuery' = '',
   'counterQuery' = ''
   )
   );
 
 }
 ?
  
 The save function is returning false, even if there's no beforeSave() 
 function in the AppController. The name of the database fields and the form 
 fields matches, so there's no problem there. What can be the problem exactly?
 
 
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problem with accessing form data

2011-02-22 Thread newguy
Hi
I have a simple form in my view where the user enters a 4 digit
numeral code, in the controller action am unable to access this code,
it would be great if some one could tell me how to access this code in
the action and then pass this code as a parameter to another
controller action.

***Form**
pEnter User Code/p
?php echo $form-Create('Admin',array('action'='view_specific'));
  echo $form-input('Code');
  echo $form-end('Submit');
?


*Action
function view_specific()
 {
if($this-data)
 {
// $code=get data from teh form;


//$this-redirect(array('action'='view_specific_result',
$code));


 }
 }


Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


RE: Problem with accessing form data

2011-02-22 Thread Krissy Masters
$this-data // holds form data

Use debug! Make it your best friend. Don't know what data is held? Where it
went? Even if there is any?

if(!empty($this-data)){

Configure::write('debug', 2);//only if you need it for this action 
debug($this-data);
exit();

}

My guess is it should be an array similar to 

Array(
[Admin] = array(
[Code] = 1234
));

So $this-data['Admin']['Code'] would hold 1234

HTH..

K

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of newguy
Sent: Tuesday, February 22, 2011 12:28 PM
To: CakePHP
Subject: Problem with accessing form data

Hi
I have a simple form in my view where the user enters a 4 digit
numeral code, in the controller action am unable to access this code,
it would be great if some one could tell me how to access this code in
the action and then pass this code as a parameter to another
controller action.

***Form**
pEnter User Code/p
?php echo $form-Create('Admin',array('action'='view_specific'));
  echo $form-input('Code');
  echo $form-end('Submit');
?


*Action
function view_specific()
 {
if($this-data)
 {
// $code=get data from teh form;

 
//$this-redirect(array('action'='view_specific_result',
$code));


 }
 }


Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with accessing form data

2011-02-22 Thread David Cole
$this-redirect(array('controller' = $controller, 'action' =
$action, $id, 'named' = $named, 'named2' = $named2));

On Feb 22, 9:58 am, newguy aimanparv...@gmail.com wrote:
 Hi
 I have a simple form in my view where the user enters a 4 digit
 numeral code, in the controller action am unable to access this code,
 it would be great if some one could tell me how to access this code in
 the action and then pass this code as a parameter to another
 controller action.

 ***Form**
 pEnter User Code/p
 ?php echo $form-Create('Admin',array('action'='view_specific'));
           echo $form-input('Code');
           echo $form-end('Submit');
 ?

 *Action
 function view_specific()
          {
                 if($this-data)
                  {
                         // $code=get data from teh form;

                         
 //$this-redirect(array('action'='view_specific_result',
 $code));

                  }
          }

 Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: post form data from URL

2011-01-10 Thread Ryan Schmidt
On Jan 2, 2011, at 11:29, Steve Mallett wrote:

 http://localhost/links/add?foo=http://asdfasdf/adsfe/asdf  variations
 thereof work great using
 $foo = $this-params['url']['foo'];
 echo $this-Form-input('Link.url', array('value'=$foo, 'type' = 'text'));
 
 However, when hitting http://localhost/links/add the error: Notice
 (8): Undefined index: foo [APP/views/links/add.ctp, line 12]  Should I
 be setting $foo to null somehow?

Certainly, if $this-params['url'] does not contain an element 'foo' you should 
not be attempting to access element 'foo'. This is basic PHP array usage.

if (isset($this-params['url']['foo'])) {
// do something with $this-params['url']['foo']
} else {
// do something that does not try to use $this-params['url']['foo']
}


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2011-01-02 Thread Ryan Schmidt

On Dec 31, 2010, at 14:00, Steve Mallett wrote:

 however, a properly encoded URL breaks both firefox  chrome
 resulting in a 404
 http://localhost/links/add/https%253A%252F%252Fhootsuite.com%252Flogin%253Fredirect%253Ddashboard

That surprises me; I would have expected that to work.

What is generating the 404 -- the web server or CakePHP? What does the relevant 
log file (either the web server's or CakePHP's) say about what was being sought 
and not found?


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2011-01-02 Thread Ryan Schmidt

On Jan 2, 2011, at 03:41, Ryan Schmidt wrote:

 http://localhost/links/add/https%253A%252F%252Fhootsuite.com%252Flogin%253Fredirect%253Ddashboard
 
 That surprises me; I would have expected that to work.

Actually, no I wouldn't; that looks double-encoded. I would have expected just 
single-encoding to work, i.e.:

http://localhost/links/add/https%3A%2F%2Fhootsuite.com%2Flogin%3Fredirect%3Ddashboard


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2011-01-02 Thread AD7six


On Dec 31 2010, 9:00 pm, Steve Mallett steve.mall...@gmail.com
wrote:
 Done.  Same results so it must not have been getting in the way.  

It most certainly will have.

 A
 discovery though:

 Withhttp://localhost/links/add/http://www.youtube.com/user/EpicMealTime#p...
 echo var_dump($this-params); results:
 array(8) { [controller]= string(5) links [action]= string(3)
 add [named]= array(1) { [http]= string(0)  } [pass]=
 array(3) { [0]= string(15) www.youtube.com [1]= string(4) user
 [2]= string(12) EpicMealTime } [plugin]= NULL [form]=
 array(0) { } [url]= array(1) { [url]= string(49)
 links/add/http:/www.youtube.com/user/EpicMealTime } [models]=
 array(1) { [0]= string(4) Link } }

 Notice lack of 'foo', but 'url'.

there is no foo in the link you pasted, 'url' is the var cake is using
which cricket refered to earlier.


 Also; however, a properly encoded URL breaks both firefox  chrome
 resulting in a 
 404http://localhost/links/add/https%253A%252F%252Fhootsuite.com%252Flogi...

 I think it's getting worse.  /shudder

If you're using apache, mod_rewrite decodes before rewriting - so the
following are identical as received by cake:
http://localhost/links/add/http://www.youtube.com/user...
http://localhost/links/add/https%3A%2F%2Fyoutube.com%2Fuser...

If you double encode - you'll receive it cake side singly encoded.

However, if you're getting a 404 it's most likely because of something
in your app, not cake (check your logs).

An important point which I suspect you haven't considered: You are
never, ever going to receive the anchor (#xyz) on the server. So your
example youtube link is just going to point to the user's page, no the
specific video indicated by the hash args.

If your problem is in anyway losing data decoding related - use a
different encoding/decoding method such as base64 - or just don't put
the url in the url (or use javascript to move the url argument to
populate a field in the form, or etc. etc.)

hth,

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2011-01-02 Thread Steve Mallett
I've gone back to this.

On Thu, Dec 30, 2010 at 10:15 PM, john lyles confidentia...@gmail.com wrote:
 Let me see if I get this: You have a url such as
 http://localhost/controller/action?url=http://www.example.com/page.html
 And all you need to do is populate the url into the form?
 If I understand the situation correctly then here is my simple
 solution:
 echo var_dump($this-params);
 This will return an array. What you need will be here.

http://localhost/links/add?foo=http://asdfasdf/adsfe/asdf  variations
thereof work great using
$foo = $this-params['url']['foo'];
echo $this-Form-input('Link.url', array('value'=$foo, 'type' = 'text'));

However, when hitting http://localhost/links/add the error: Notice
(8): Undefined index: foo [APP/views/links/add.ctp, line 12]  Should I
be setting $foo to null somehow?

S

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-31 Thread Steve Mallett
Sorry, I thought you were suggesting the routing wasn't needed.  I
replace it, added your debug code suggestion  this is the result:

URL address: 
http://localhost/links/add/http://www.youtube.com/watch%3Fv%3DvDVnuFxsfbE
URL passed to form currently: www.youtube.com
debug result:

array(8) { [controller]= string(5) links [action]= string(3)
add [named]= array(1) { [http]= string(0)  } [pass]=
array(2) { [0]= string(15) www.youtube.com [1]= string(5) watch
} [plugin]= NULL [form]= array(0) { } [url]= array(2) {
[url]= string(37) links/add/http:/www.youtube.com/watch [v]=
string(11) vDVnuFxsfbE } [models]= array(1) { [0]= string(4)
Link } }


Current routing code:
Router::connect(
   '/links/add/:url',
   array(
   'controller' = 'links',
   'action' = 'add'
   ),
   array(
   //Looks for http://
'url' = 
'^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
   // passes it
'pass' = array('url')
   )
);

add.ctp:
echo $this-Form-input('Link.url', array('value' = $url, 'type' = 'text'));

Thanks!
S


On Thu, Dec 30, 2010 at 11:05 PM, john lyles confidentia...@gmail.com wrote:
 You are certain you are passing data to the url correctly?

 On Dec 30, 9:27 pm, Steve Mallett steve.mall...@gmail.com wrote:
 I don't think so.  With or without echo var_dump($this-params) that results 
 in:
 Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
 Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line 121]

 S







 On Thu, Dec 30, 2010 at 10:15 PM, john lyles confidentia...@gmail.com 
 wrote:
  Let me see if I get this: You have a url such as
 http://localhost/controller/action?url=http://www.example.com/page.html
  And all you need to do is populate the url into the form?
  If I understand the situation correctly then here is my simple
  solution:
  echo var_dump($this-params);
  This will return an array. What you need will be here.

  On Dec 30, 8:39 pm, Steve Mallett steve.mall...@gmail.com wrote:
  On Thu, Dec 30, 2010 at 9:26 PM, cricket zijn.digi...@gmail.com wrote:
   On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett 
   steve.mall...@gmail.com wrote:
   More on routing, I think,  if I use an URL with a subdirectory ie.
   example.com/dir the \ appears to break the routing defaulting to
   example.com. Any suggestions on dealing with that?

   Are you escaping the URL, actually? You're going to have problems if 
   not.

  Well, if I encode example.com/dir as example.com%2fdir cake appears to
  turn it back into example.com/dir... at least in the browser address
  bar (chrome), but still can't deal with it turning it into example.com
  in $url

   Again, why not just add the URL in the form instead of first passing
   it in the request URL?

  I'm trying to prepopulate the url via a bookmarklet which just makes
  saving an URL in the form much faster  easier.

  S

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-31 Thread cricket
On Fri, Dec 31, 2010 at 8:31 AM, Steve Mallett steve.mall...@gmail.com wrote:
 Sorry, I thought you were suggesting the routing wasn't needed.  I
 replace it, added your debug code suggestion  this is the result:

 URL address: 
 http://localhost/links/add/http://www.youtube.com/watch%3Fv%3DvDVnuFxsfbE
 URL passed to form currently: www.youtube.com
 debug result:

 array(8) { [controller]= string(5) links [action]= string(3)
 add [named]= array(1) { [http]= string(0)  } [pass]=
 array(2) { [0]= string(15) www.youtube.com [1]= string(5) watch
 } [plugin]= NULL [form]= array(0) { } [url]= array(2) {
 [url]= string(37) links/add/http:/www.youtube.com/watch [v]=
 string(11) vDVnuFxsfbE } [models]= array(1) { [0]= string(4)
 Link } }


 Current routing code:
 Router::connect(
               '/links/add/:url',
               array(
                       'controller' = 'links',
                       'action' = 'add'
               ),
               array(
                       //Looks for http://
                                        'url' = 
 '^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
                       // passes it
                                        'pass' = array('url')
               )
        );
 
 add.ctp:
 echo $this-Form-input('Link.url', array('value' = $url, 'type' = 'text'));

A light bulb just clicked on. Instead of calling your param 'url', try
something like 'link', or 'foo', etc. Cake also uses 'url' for routes.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-31 Thread Steve Mallett
Done.  Same results so it must not have been getting in the way.  A
discovery though:

With 
http://localhost/links/add/http://www.youtube.com/user/EpicMealTime#p/u/1/0rUEpmbdZLw
echo var_dump($this-params); results:
array(8) { [controller]= string(5) links [action]= string(3)
add [named]= array(1) { [http]= string(0)  } [pass]=
array(3) { [0]= string(15) www.youtube.com [1]= string(4) user
[2]= string(12) EpicMealTime } [plugin]= NULL [form]=
array(0) { } [url]= array(1) { [url]= string(49)
links/add/http:/www.youtube.com/user/EpicMealTime } [models]=
array(1) { [0]= string(4) Link } }

Notice lack of 'foo', but 'url'.

Also; however, a properly encoded URL breaks both firefox  chrome
resulting in a 404
http://localhost/links/add/https%253A%252F%252Fhootsuite.com%252Flogin%253Fredirect%253Ddashboard

I think it's getting worse.  /shudder
S


On Fri, Dec 31, 2010 at 2:13 PM, cricket zijn.digi...@gmail.com wrote:
 On Fri, Dec 31, 2010 at 8:31 AM, Steve Mallett steve.mall...@gmail.com 
 wrote:
 Sorry, I thought you were suggesting the routing wasn't needed.  I
 replace it, added your debug code suggestion  this is the result:

 URL address: 
 http://localhost/links/add/http://www.youtube.com/watch%3Fv%3DvDVnuFxsfbE
 URL passed to form currently: www.youtube.com
 debug result:

 array(8) { [controller]= string(5) links [action]= string(3)
 add [named]= array(1) { [http]= string(0)  } [pass]=
 array(2) { [0]= string(15) www.youtube.com [1]= string(5) watch
 } [plugin]= NULL [form]= array(0) { } [url]= array(2) {
 [url]= string(37) links/add/http:/www.youtube.com/watch [v]=
 string(11) vDVnuFxsfbE } [models]= array(1) { [0]= string(4)
 Link } }


 Current routing code:
 Router::connect(
               '/links/add/:url',
               array(
                       'controller' = 'links',
                       'action' = 'add'
               ),
               array(
                       //Looks for http://
                                        'url' = 
 '^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
                       // passes it
                                        'pass' = array('url')
               )
        );
 
 add.ctp:
 echo $this-Form-input('Link.url', array('value' = $url, 'type' = 
 'text'));

 A light bulb just clicked on. Instead of calling your param 'url', try
 something like 'link', or 'foo', etc. Cake also uses 'url' for routes.

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
Sorry, no. I'd like to populate the form data from variables given in the url:
localhost/links/add?url=http://cakephp.or

This would be like a delicious.com bookmarklet or someone creating a
link on their own sites which would populate the form data.

Steve


On Thu, Dec 30, 2010 at 1:07 AM, Karthikeyan P pkaarthike...@gmail.com wrote:
 I guess I got your question correctly, what u want to do is Pre-Populate the
 form on loading

 I think you have to see the EDIT function in the BLOG tutorial of cakePHP.
 There we actually PRE-POPULATE the data on the EDIT page .

 Thanks
 Karthikeyan P

 On Thu, Dec 30, 2010 at 8:14 AM, Steve Mallett steve.mall...@gmail.com
 wrote:

 Hi,

 How do I pass data to a Form from the URL?

 I have add.ctp:

        ?php
                echo $this-Form-input('url', array(
                  'type' = 'text',
                  'value' = $this-params['url']
                ));
        ?

 Hitting localhost/links/add?url=http://cakephp.org produces the following
 error:

 Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
 -and-
 Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line
 121]


 Thanks.
 Steve

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Steve Mallett
inevitable.cc (the) Inevitable Corp.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
ping. sorry.
S

On Thu, Dec 30, 2010 at 9:15 AM, Steve Mallett steve.mall...@gmail.com wrote:
 Sorry, no. I'd like to populate the form data from variables given in the url:
 localhost/links/add?url=http://cakephp.or

 This would be like a delicious.com bookmarklet or someone creating a
 link on their own sites which would populate the form data.

 Steve


 On Thu, Dec 30, 2010 at 1:07 AM, Karthikeyan P pkaarthike...@gmail.com 
 wrote:
 I guess I got your question correctly, what u want to do is Pre-Populate the
 form on loading

 I think you have to see the EDIT function in the BLOG tutorial of cakePHP.
 There we actually PRE-POPULATE the data on the EDIT page .

 Thanks
 Karthikeyan P

 On Thu, Dec 30, 2010 at 8:14 AM, Steve Mallett steve.mall...@gmail.com
 wrote:

 Hi,

 How do I pass data to a Form from the URL?

 I have add.ctp:

        ?php
                echo $this-Form-input('url', array(
                  'type' = 'text',
                  'value' = $this-params['url']
                ));
        ?

 Hitting localhost/links/add?url=http://cakephp.org produces the following
 error:

 Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
 -and-
 Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line
 121]


 Thanks.
 Steve

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Karthikeyan P
It seems easy one .

?php echo Router::url($this-here, true); ?


assign the same to a variable and then send it to Form-Input

Thanks
Karthik

On Thu, Dec 30, 2010 at 10:20 PM, Steve Mallett steve.mall...@gmail.comwrote:

 ping. sorry.
 S

 On Thu, Dec 30, 2010 at 9:15 AM, Steve Mallett steve.mall...@gmail.com
 wrote:
  Sorry, no. I'd like to populate the form data from variables given in the
 url:
  localhost/links/add?url=http://cakephp.or
 
  This would be like a delicious.com bookmarklet or someone creating a
  link on their own sites which would populate the form data.
 
  Steve
 
 
  On Thu, Dec 30, 2010 at 1:07 AM, Karthikeyan P pkaarthike...@gmail.com
 wrote:
  I guess I got your question correctly, what u want to do is Pre-Populate
 the
  form on loading
 
  I think you have to see the EDIT function in the BLOG tutorial of
 cakePHP.
  There we actually PRE-POPULATE the data on the EDIT page .
 
  Thanks
  Karthikeyan P
 
  On Thu, Dec 30, 2010 at 8:14 AM, Steve Mallett steve.mall...@gmail.com
 
  wrote:
 
  Hi,
 
  How do I pass data to a Form from the URL?
 
  I have add.ctp:
 
 ?php
 echo $this-Form-input('url', array(
   'type' = 'text',
   'value' = $this-params['url']
 ));
 ?
 
  Hitting localhost/links/add?url=http://cakephp.org produces the
 following
  error:
 
  Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line
 269]
  -and-
  Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line
  121]
 
 
  Thanks.
  Steve
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group
  at http://groups.google.com/group/cake-php?hl=en
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
 others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en
 
 
 

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
Sorry, I'm still up in the air with this...

?php echo Router::url($this-here, true); ?  echos
localhost/links/add/cakephp.org if I type
localhost/links/add/cakephp.org as the URL. How do I pass just
'cakephp.org' to the form?


To confuse things I got looking more at
http://book.cakephp.org/view/945/Routes-Configuration#Passing-parameters-to-action-949...

Perhaps this is good?:
function add() {
   Router::url('links/add/:url',array('controller' = 'links',
'action' = 'add'), array('pass' = array('url')));
}

I'm still confused on how 'pass' 'url' to the form.

Thanks for the help so far.
Steve

On Thu, Dec 30, 2010 at 2:14 PM, Karthikeyan P pkaarthike...@gmail.com wrote:
 It seems easy one .

 ?php echo Router::url($this-here, true); ?


 assign the same to a variable and then send it to Form-Input

 Thanks
 Karthik

 On Thu, Dec 30, 2010 at 10:20 PM, Steve Mallett steve.mall...@gmail.com
 wrote:

 ping. sorry.
 S

 On Thu, Dec 30, 2010 at 9:15 AM, Steve Mallett steve.mall...@gmail.com
 wrote:
  Sorry, no. I'd like to populate the form data from variables given in
  the url:
  localhost/links/add?url=http://cakephp.or
 
  This would be like a delicious.com bookmarklet or someone creating a
  link on their own sites which would populate the form data.
 
  Steve
 
 
  On Thu, Dec 30, 2010 at 1:07 AM, Karthikeyan P pkaarthike...@gmail.com
  wrote:
  I guess I got your question correctly, what u want to do is
  Pre-Populate the
  form on loading
 
  I think you have to see the EDIT function in the BLOG tutorial of
  cakePHP.
  There we actually PRE-POPULATE the data on the EDIT page .
 
  Thanks
  Karthikeyan P
 
  On Thu, Dec 30, 2010 at 8:14 AM, Steve Mallett
  steve.mall...@gmail.com
  wrote:
 
  Hi,
 
  How do I pass data to a Form from the URL?
 
  I have add.ctp:
 
         ?php
                 echo $this-Form-input('url', array(
                   'type' = 'text',
                   'value' = $this-params['url']
                 ));
         ?
 
  Hitting localhost/links/add?url=http://cakephp.org produces the
  following
  error:
 
  Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line
  269]
  -and-
  Notice (8): Undefined index: controller [CORE/cake/dispatcher.php,
  line
  121]
 
 
  Thanks.
  Steve
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
  others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this
  group
  at http://groups.google.com/group/cake-php?hl=en
 
  Check out the new CakePHP Questions site http://cakeqs.org and help
  others
  with their CakePHP related questions.
 
  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this
  group at
  http://groups.google.com/group/cake-php?hl=en
 
 
 

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Steve Mallett
inevitable.cc (the) Inevitable Corp.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread cricket
On Thu, Dec 30, 2010 at 2:25 PM, Steve Mallett steve.mall...@gmail.com wrote:
 Sorry, I'm still up in the air with this...

 ?php echo Router::url($this-here, true); ?  echos
 localhost/links/add/cakephp.org if I type
 localhost/links/add/cakephp.org as the URL. How do I pass just
 'cakephp.org' to the form?

Do you really need to include that in the URL anyway? Could you just
present an empty form and have the user fill it in?


 To confuse things I got looking more at
 http://book.cakephp.org/view/945/Routes-Configuration#Passing-parameters-to-action-949...

 Perhaps this is good?:
 function add() {
   Router::url('links/add/:url',array('controller' = 'links',
 'action' = 'add'), array('pass' = array('url')));
 }

Good for what? Router::url() returns a string.You're not echoing nor
assigning the return value to anything.


 I'm still confused on how 'pass' 'url' to the form.

First, get passing it to the controller action sorted out. Then you
can assign it to a view variable and pass that to FormHelper.

Start with the route:

Router::connect(
'/links/add/:url',
array(
'controller' = 'links',
'action' = 'add'
),
array(
'url' = '^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
'pass' = array('url')
)
);

You may need to adjust the regexp to suit your requirements.


public function add($url = null)
{
if (!empty($this-data))
{
...
}

$this-set(compact('url'));
}


echo $this-Form-input('Link.url', array('value' = $url));

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
Ok, I see better what is occurring.  Thanks so much.

Is there a better way to do the regex?  parse_url?

S

On Thu, Dec 30, 2010 at 3:57 PM, cricket zijn.digi...@gmail.com wrote:
 On Thu, Dec 30, 2010 at 2:25 PM, Steve Mallett steve.mall...@gmail.com 
 wrote:
 Sorry, I'm still up in the air with this...

 ?php echo Router::url($this-here, true); ?  echos
 localhost/links/add/cakephp.org if I type
 localhost/links/add/cakephp.org as the URL. How do I pass just
 'cakephp.org' to the form?

 Do you really need to include that in the URL anyway? Could you just
 present an empty form and have the user fill it in?


 To confuse things I got looking more at
 http://book.cakephp.org/view/945/Routes-Configuration#Passing-parameters-to-action-949...

 Perhaps this is good?:
 function add() {
   Router::url('links/add/:url',array('controller' = 'links',
 'action' = 'add'), array('pass' = array('url')));
 }

 Good for what? Router::url() returns a string.You're not echoing nor
 assigning the return value to anything.


 I'm still confused on how 'pass' 'url' to the form.

 First, get passing it to the controller action sorted out. Then you
 can assign it to a view variable and pass that to FormHelper.

 Start with the route:

 Router::connect(
        '/links/add/:url',
        array(
                'controller' = 'links',
                'action' = 'add'
        ),
        array(
                'url' = '^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
                'pass' = array('url')
        )
 );

 You may need to adjust the regexp to suit your requirements.


 public function add($url = null)
 {
        if (!empty($this-data))
        {
                ...
        }

        $this-set(compact('url'));
 }


 echo $this-Form-input('Link.url', array('value' = $url));

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread cricket
On Thu, Dec 30, 2010 at 5:54 PM, Steve Mallett steve.mall...@gmail.com wrote:
 Ok, I see better what is occurring.  Thanks so much.

 Is there a better way to do the regex?  parse_url?

Cake has a few built-in vars (eg. $UUID) for routes but I don't know
if URL is one of them. I did look in the manual before posting earlier
but--surprise, surprise--I can't find the relevant page.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
anyone?

On Thu, Dec 30, 2010 at 7:11 PM, cricket zijn.digi...@gmail.com wrote:
 On Thu, Dec 30, 2010 at 5:54 PM, Steve Mallett steve.mall...@gmail.com 
 wrote:
 Ok, I see better what is occurring.  Thanks so much.

 Is there a better way to do the regex?  parse_url?

 Cake has a few built-in vars (eg. $UUID) for routes but I don't know
 if URL is one of them. I did look in the manual before posting earlier
 but--surprise, surprise--I can't find the relevant page.

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
More on routing, I think,  if I use an URL with a subdirectory ie.
example.com/dir the \ appears to break the routing defaulting to
example.com. Any suggestions on dealing with that?
S

On Thu, Dec 30, 2010 at 8:30 PM, Steve Mallett steve.mall...@gmail.com wrote:
 anyone?

 On Thu, Dec 30, 2010 at 7:11 PM, cricket zijn.digi...@gmail.com wrote:
 On Thu, Dec 30, 2010 at 5:54 PM, Steve Mallett steve.mall...@gmail.com 
 wrote:
 Ok, I see better what is occurring.  Thanks so much.

 Is there a better way to do the regex?  parse_url?

 Cake has a few built-in vars (eg. $UUID) for routes but I don't know
 if URL is one of them. I did look in the manual before posting earlier
 but--surprise, surprise--I can't find the relevant page.

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en





-- 
Steve Mallett
inevitable.cc (the) Inevitable Corp.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread cricket
On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett steve.mall...@gmail.com wrote:
 More on routing, I think,  if I use an URL with a subdirectory ie.
 example.com/dir the \ appears to break the routing defaulting to
 example.com. Any suggestions on dealing with that?

Are you escaping the URL, actually? You're going to have problems if not.

Again, why not just add the URL in the form instead of first passing
it in the request URL?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
On Thu, Dec 30, 2010 at 9:26 PM, cricket zijn.digi...@gmail.com wrote:
 On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett steve.mall...@gmail.com 
 wrote:
 More on routing, I think,  if I use an URL with a subdirectory ie.
 example.com/dir the \ appears to break the routing defaulting to
 example.com. Any suggestions on dealing with that?

 Are you escaping the URL, actually? You're going to have problems if not.

Well, if I encode example.com/dir as example.com%2fdir cake appears to
turn it back into example.com/dir... at least in the browser address
bar (chrome), but still can't deal with it turning it into example.com
in $url

 Again, why not just add the URL in the form instead of first passing
 it in the request URL?

I'm trying to prepopulate the url via a bookmarklet which just makes
saving an URL in the form much faster  easier.

S

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread john lyles
Let me see if I get this: You have a url such as
http://localhost/controller/action?url=http://www.example.com/page.html
And all you need to do is populate the url into the form?
If I understand the situation correctly then here is my simple
solution:
echo var_dump($this-params);
This will return an array. What you need will be here.

On Dec 30, 8:39 pm, Steve Mallett steve.mall...@gmail.com wrote:
 On Thu, Dec 30, 2010 at 9:26 PM, cricket zijn.digi...@gmail.com wrote:
  On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett steve.mall...@gmail.com 
  wrote:
  More on routing, I think,  if I use an URL with a subdirectory ie.
  example.com/dir the \ appears to break the routing defaulting to
  example.com. Any suggestions on dealing with that?

  Are you escaping the URL, actually? You're going to have problems if not.

 Well, if I encode example.com/dir as example.com%2fdir cake appears to
 turn it back into example.com/dir... at least in the browser address
 bar (chrome), but still can't deal with it turning it into example.com
 in $url

  Again, why not just add the URL in the form instead of first passing
  it in the request URL?

 I'm trying to prepopulate the url via a bookmarklet which just makes
 saving an URL in the form much faster  easier.

 S

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread Steve Mallett
I don't think so.  With or without echo var_dump($this-params) that results in:
Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line 121]

S

On Thu, Dec 30, 2010 at 10:15 PM, john lyles confidentia...@gmail.com wrote:
 Let me see if I get this: You have a url such as
 http://localhost/controller/action?url=http://www.example.com/page.html
 And all you need to do is populate the url into the form?
 If I understand the situation correctly then here is my simple
 solution:
 echo var_dump($this-params);
 This will return an array. What you need will be here.

 On Dec 30, 8:39 pm, Steve Mallett steve.mall...@gmail.com wrote:
 On Thu, Dec 30, 2010 at 9:26 PM, cricket zijn.digi...@gmail.com wrote:
  On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett steve.mall...@gmail.com 
  wrote:
  More on routing, I think,  if I use an URL with a subdirectory ie.
  example.com/dir the \ appears to break the routing defaulting to
  example.com. Any suggestions on dealing with that?

  Are you escaping the URL, actually? You're going to have problems if not.

 Well, if I encode example.com/dir as example.com%2fdir cake appears to
 turn it back into example.com/dir... at least in the browser address
 bar (chrome), but still can't deal with it turning it into example.com
 in $url

  Again, why not just add the URL in the form instead of first passing
  it in the request URL?

 I'm trying to prepopulate the url via a bookmarklet which just makes
 saving an URL in the form much faster  easier.

 S

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-30 Thread john lyles
You are certain you are passing data to the url correctly?

On Dec 30, 9:27 pm, Steve Mallett steve.mall...@gmail.com wrote:
 I don't think so.  With or without echo var_dump($this-params) that results 
 in:
 Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
 Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line 121]

 S







 On Thu, Dec 30, 2010 at 10:15 PM, john lyles confidentia...@gmail.com wrote:
  Let me see if I get this: You have a url such as
 http://localhost/controller/action?url=http://www.example.com/page.html
  And all you need to do is populate the url into the form?
  If I understand the situation correctly then here is my simple
  solution:
  echo var_dump($this-params);
  This will return an array. What you need will be here.

  On Dec 30, 8:39 pm, Steve Mallett steve.mall...@gmail.com wrote:
  On Thu, Dec 30, 2010 at 9:26 PM, cricket zijn.digi...@gmail.com wrote:
   On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett steve.mall...@gmail.com 
   wrote:
   More on routing, I think,  if I use an URL with a subdirectory ie.
   example.com/dir the \ appears to break the routing defaulting to
   example.com. Any suggestions on dealing with that?

   Are you escaping the URL, actually? You're going to have problems if not.

  Well, if I encode example.com/dir as example.com%2fdir cake appears to
  turn it back into example.com/dir... at least in the browser address
  bar (chrome), but still can't deal with it turning it into example.com
  in $url

   Again, why not just add the URL in the form instead of first passing
   it in the request URL?

  I'm trying to prepopulate the url via a bookmarklet which just makes
  saving an URL in the form much faster  easier.

  S

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


post form data from URL

2010-12-29 Thread Steve Mallett
Hi,

How do I pass data to a Form from the URL?

I have add.ctp:

?php
echo $this-Form-input('url', array(
  'type' = 'text',
  'value' = $this-params['url']
));
?

Hitting localhost/links/add?url=http://cakephp.org produces the following error:

Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
-and-
Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line 121]


Thanks.
Steve

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: post form data from URL

2010-12-29 Thread Karthikeyan P
I guess I got your question correctly, what u want to do is Pre-Populate the
form on loading

I think you have to see the EDIT function in the BLOG tutorial of cakePHP.
There we actually PRE-POPULATE the data on the EDIT page .

Thanks
Karthikeyan P

On Thu, Dec 30, 2010 at 8:14 AM, Steve Mallett steve.mall...@gmail.comwrote:

 Hi,

 How do I pass data to a Form from the URL?

 I have add.ctp:

?php
echo $this-Form-input('url', array(
  'type' = 'text',
  'value' = $this-params['url']
));
?

 Hitting localhost/links/add?url=http://cakephp.org produces the following
 error:

 Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
 -and-
 Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line
 121]


 Thanks.
 Steve

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: $_POST is populated with the form data, but $this-data is always empty

2010-12-01 Thread Raisen
Did you try to check for the value of the data attribute from a method
invoked after the beforeFilter method? I would guess that the data
attribute is not set when beforeFilter is being called. Also, are you
calling the parent method on your method before reading the data?

parent::beforeFilter();

On Nov 29, 10:56 am, amfriedman amfried...@gmail.com wrote:
 Hey folks

 This is a very strange issue indeed, and at its root it is NOT related
 to this post that declares a similar 
 symptom:http://groups.google.com/group/cake-php/browse_thread/thread/840eaa08...

 I have a form in /users/view/.  When I submit it and check $_POST and
 $this-data at the very beginning of AppController-beforeFilter(),
 the form data appears in the $_POST array but $this-data does not
 have any data.  In fact, $this-data is not even set by Cake!

 The Auth component is removed from the $components list, so I know
 that Auth is not the culprit.  I've also tried to test this form in
 different controllers/views, and I get the same problem.  Pretty
 scary, huh?

 --- 
 
 Here is the view code (I've also tried setting the form-create()
 first argument with a model of 'User' and used full Model.field dot
 notation for my inputs):
 --- 
 

     ?php echo $form-create(NULL,
                         array(
                                   'default' = true,
                                   'inputDefaults' = array(
                                         'label' = false,
                                         'div' = false
                                   )
                         )

                   ); // default = onsubmit true/false  ?

                          ?php echo $form-input('username', array('size'= 
 20, 'maxlength'
 = 50)); ?

                          ?php echo $form-input('pw', array('type' = 
 'password',
 'size'= 20, 'maxlength' = 50)); ?

                         ?php echo $form-submit('Log In raquo;', 
 array('class' =
 'submit', 'name' = 'submit',  'title' = 'Enter your username and
 password for access.', 'class' = 'button', 'escape' = false)); ?

         ?php echo $form-end(); ?

 --- 
 
 Here is the app_controller:
 --- 
 
         function beforeFilter() {

                 pr(__CLASS__.'::'.__FUNCTION__.'()...');

                 pr('POST data: ');
                 pr($_POST);

                 if(isset($this-data)) {
                         pr('this-data: ');
                         pr($this-data);
                 } else { pr('this-data not set!'); }
        // ...
    }

 --- 
 
 Here is the browser output:
 --- 
 
    AppController::beforeFilter()...

 POST data:

 Array
 (
     [_method] = POST
     [data] = Array
         (
             [User] = Array
                 (
                     [username] = testuser
                     [pw] = 12345
                 )

         )

     [submit] = Log In »
 )

 this-data not set!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: $_POST is populated with the form data, but $this-data is always empty

2010-12-01 Thread John Andersen
Please change your code part from:

   } else { pr('this-data not set!'); }

to

   } else {
  pr('this-data not set!');
  pr($this-data);
  }

So that we may be sure that $this-data is not set with anything
Enjoy,
   John

On 29 Nov., 22:18, amfriedman amfried...@gmail.com wrote:
 Irrelevant for two reasons:

 - I wrote that I already tried with the form model set to 'User'
 - Manual says it is fine to do this (see the first yellow 
 box):http://book.cakephp.org/view/1384/Creating-Forms

[snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


$_POST is populated with the form data, but $this-data is always empty

2010-11-29 Thread amfriedman
Hey folks

This is a very strange issue indeed, and at its root it is NOT related
to this post that declares a similar symptom:
http://groups.google.com/group/cake-php/browse_thread/thread/840eaa08732904a1/6b214b69ad0980d4?lnk=gstq=$_POST#6b214b69ad0980d4

I have a form in /users/view/.  When I submit it and check $_POST and
$this-data at the very beginning of AppController-beforeFilter(),
the form data appears in the $_POST array but $this-data does not
have any data.  In fact, $this-data is not even set by Cake!

The Auth component is removed from the $components list, so I know
that Auth is not the culprit.  I've also tried to test this form in
different controllers/views, and I get the same problem.  Pretty
scary, huh?

---
Here is the view code (I've also tried setting the form-create()
first argument with a model of 'User' and used full Model.field dot
notation for my inputs):
---

?php echo $form-create(NULL,
array(
  'default' = true,
  'inputDefaults' = array(
'label' = false,
'div' = false
  )
)

  ); // default = onsubmit true/false  ?


 ?php echo $form-input('username', array('size'= 20, 
'maxlength'
= 50)); ?

 ?php echo $form-input('pw', array('type' = 
'password',
'size'= 20, 'maxlength' = 50)); ?

?php echo $form-submit('Log In raquo;', 
array('class' =
'submit', 'name' = 'submit',  'title' = 'Enter your username and
password for access.', 'class' = 'button', 'escape' = false)); ?

?php echo $form-end(); ?

---
Here is the app_controller:
---
function beforeFilter() {

pr(__CLASS__.'::'.__FUNCTION__.'()...');

pr('POST data: ');
pr($_POST);

if(isset($this-data)) {
pr('this-data: ');
pr($this-data);
} else { pr('this-data not set!'); }
   // ...
   }

---
Here is the browser output:
---
   AppController::beforeFilter()...

POST data:

Array
(
[_method] = POST
[data] = Array
(
[User] = Array
(
[username] = testuser
[pw] = 12345
)

)

[submit] = Log In »
)

this-data not set!


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: $_POST is populated with the form data, but $this-data is always empty

2010-11-29 Thread nurvzy
Why are you setting NULL as your form model?

Try:
?php echo $form-create('User',
array(
  'default' = true,
  'inputDefaults' = array(
'label' = false,
'div' = false
  )
)
  );

Try looking in params.  I'm guessing it's being passed in as
params['form'].

HTH,
Nick

On Nov 29, 11:56 am, amfriedman amfried...@gmail.com wrote:
 Hey folks

 This is a very strange issue indeed, and at its root it is NOT related
 to this post that declares a similar 
 symptom:http://groups.google.com/group/cake-php/browse_thread/thread/840eaa08...

 I have a form in /users/view/.  When I submit it and check $_POST and
 $this-data at the very beginning of AppController-beforeFilter(),
 the form data appears in the $_POST array but $this-data does not
 have any data.  In fact, $this-data is not even set by Cake!

 The Auth component is removed from the $components list, so I know
 that Auth is not the culprit.  I've also tried to test this form in
 different controllers/views, and I get the same problem.  Pretty
 scary, huh?

 --- 
 
 Here is the view code (I've also tried setting the form-create()
 first argument with a model of 'User' and used full Model.field dot
 notation for my inputs):
 --- 
 

     ?php echo $form-create(NULL,
                         array(
                                   'default' = true,
                                   'inputDefaults' = array(
                                         'label' = false,
                                         'div' = false
                                   )
                         )

                   ); // default = onsubmit true/false  ?

                          ?php echo $form-input('username', array('size'= 
 20, 'maxlength'
 = 50)); ?

                          ?php echo $form-input('pw', array('type' = 
 'password',
 'size'= 20, 'maxlength' = 50)); ?

                         ?php echo $form-submit('Log In raquo;', 
 array('class' =
 'submit', 'name' = 'submit',  'title' = 'Enter your username and
 password for access.', 'class' = 'button', 'escape' = false)); ?

         ?php echo $form-end(); ?

 --- 
 
 Here is the app_controller:
 --- 
 
         function beforeFilter() {

                 pr(__CLASS__.'::'.__FUNCTION__.'()...');

                 pr('POST data: ');
                 pr($_POST);

                 if(isset($this-data)) {
                         pr('this-data: ');
                         pr($this-data);
                 } else { pr('this-data not set!'); }
        // ...
    }

 --- 
 
 Here is the browser output:
 --- 
 
    AppController::beforeFilter()...

 POST data:

 Array
 (
     [_method] = POST
     [data] = Array
         (
             [User] = Array
                 (
                     [username] = testuser
                     [pw] = 12345
                 )

         )

     [submit] = Log In »
 )

 this-data not set!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: $_POST is populated with the form data, but $this-data is always empty

2010-11-29 Thread amfriedman
Irrelevant for two reasons:

- I wrote that I already tried with the form model set to 'User'
- Manual says it is fine to do this (see the first yellow box):
http://book.cakephp.org/view/1384/Creating-Forms


On Nov 29, 4:04 pm, nurvzy nur...@gmail.com wrote:
 Why are you setting NULL as your form model?

 Try:
 ?php echo $form-create('User',
                         array(
                                   'default' = true,
                                   'inputDefaults' = array(
                                         'label' = false,
                                         'div' = false
                                   )
                         )
                   );

 Try looking in params.  I'm guessing it's being passed in as
 params['form'].

 HTH,
 Nick

 On Nov 29, 11:56 am, amfriedman amfried...@gmail.com wrote:







  Hey folks

  This is a very strange issue indeed, and at its root it is NOT related
  to this post that declares a similar 
  symptom:http://groups.google.com/group/cake-php/browse_thread/thread/840eaa08...

  I have a form in /users/view/.  When I submit it and check $_POST and
  $this-data at the very beginning of AppController-beforeFilter(),
  the form data appears in the $_POST array but $this-data does not
  have any data.  In fact, $this-data is not even set by Cake!

  The Auth component is removed from the $components list, so I know
  that Auth is not the culprit.  I've also tried to test this form in
  different controllers/views, and I get the same problem.  Pretty
  scary, huh?

  --- 
  
  Here is the view code (I've also tried setting the form-create()
  first argument with a model of 'User' and used full Model.field dot
  notation for my inputs):
  --- 
  

      ?php echo $form-create(NULL,
                          array(
                                    'default' = true,
                                    'inputDefaults' = array(
                                          'label' = false,
                                          'div' = false
                                    )
                          )

                    ); // default = onsubmit true/false  ?

                           ?php echo $form-input('username', array('size'= 
  20, 'maxlength'
  = 50)); ?

                           ?php echo $form-input('pw', array('type' = 
  'password',
  'size'= 20, 'maxlength' = 50)); ?

                          ?php echo $form-submit('Log In raquo;', 
  array('class' =
  'submit', 'name' = 'submit',  'title' = 'Enter your username and
  password for access.', 'class' = 'button', 'escape' = false)); ?

          ?php echo $form-end(); ?

  --- 
  
  Here is the app_controller:
  --- 
  
          function beforeFilter() {

                  pr(__CLASS__.'::'.__FUNCTION__.'()...');

                  pr('POST data: ');
                  pr($_POST);

                  if(isset($this-data)) {
                          pr('this-data: ');
                          pr($this-data);
                  } else { pr('this-data not set!'); }
         // ...
     }

  --- 
  
  Here is the browser output:
  --- 
  
     AppController::beforeFilter()...

  POST data:

  Array
  (
      [_method] = POST
      [data] = Array
          (
              [User] = Array
                  (
                      [username] = testuser
                      [pw] = 12345
                  )

          )

      [submit] = Log In »
  )

  this-data not set!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-15 Thread Tomfox Wiranata
thx dave...i appreaciate your help :)

i switched to a 100% Jquery and made it work somehowi needed to
initialize JQuery again, as soon as I reloaded a div...thats why it
did not work and i had to try the ajax thinganyway...

thank you

On 14 Sep., 17:08, Dave Maharaj m...@davemaharaj.com wrote:
 Ok if I am reading this right you would need 2 actions no?

 Say
 upload() {
 autoRender = false;
 //show nothing
 //form has been submitted
 This-data do what you need to do to get the info size, type
 $myFormData = array();
 //push the data you get from the form into the array

 $this-Model-__useMyDataFunction($myFormData);

 }

 function __useMyDataFunction($myFormData){

 //process the data how ever you need it and then render the view with all
 that you need

 }
 -Original Message-
 From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
 Sent: September-14-10 5:43 AM
 To: CakePHP
 Subject: Re: passing form data to my controller

 well i have a form with the type FILE. a user can upload files and the
 data (filename, size, type etc) should be passed to a function in my
 controller. this controller function is acutally doing the logic,
 means saving or uploading the file. then this function is rendering a
 view showing all files uploded...

 but now i cant pass the form data with AJAX..it is the only thing
 missing...

 thank you :)

 On 13 Sep., 17:44, Dave Maharaj m...@davemaharaj.com wrote:
  I try:)

  I missed your earlier posts so explain to me what your trying to do
 exactly?
  Form submit-data to controller- display what was submitted on the same
  page your on?

  -Original Message-
  From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
  Sent: September-13-10 1:04 PM
  To: CakePHP
  Subject: Re: passing form data to my controller

  dave...you have no idea how your torturing me. seriously. I am trying
  to figure this out for 2 weeks now and its makin me crazy...i've never
  been closer to givng up

  i will look into your hint, but do you mind helping me with a little
  code or specifics?

  thx a LOT

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-14 Thread Tomfox Wiranata
well i have a form with the type FILE. a user can upload files and the
data (filename, size, type etc) should be passed to a function in my
controller. this controller function is acutally doing the logic,
means saving or uploading the file. then this function is rendering a
view showing all files uploded...

but now i cant pass the form data with AJAX..it is the only thing
missing...

thank you :)

On 13 Sep., 17:44, Dave Maharaj m...@davemaharaj.com wrote:
 I try:)

 I missed your earlier posts so explain to me what your trying to do exactly?
 Form submit-data to controller- display what was submitted on the same
 page your on?

 -Original Message-
 From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
 Sent: September-13-10 1:04 PM
 To: CakePHP
 Subject: Re: passing form data to my controller

 dave...you have no idea how your torturing me. seriously. I am trying
 to figure this out for 2 weeks now and its makin me crazy...i've never
 been closer to givng up

 i will look into your hint, but do you mind helping me with a little
 code or specifics?

 thx a LOT

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-14 Thread Tomfox Wiranata
i think the problem here is that I have a file upload involved and not
just usual datai dont think there is any other way than
JQuery..right?

On 14 Sep., 10:12, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 well i have a form with the type FILE. a user can upload files and the
 data (filename, size, type etc) should be passed to a function in my
 controller. this controller function is acutally doing the logic,
 means saving or uploading the file. then this function is rendering a
 view showing all files uploded...

 but now i cant pass the form data with AJAX..it is the only thing
 missing...

 thank you :)

 On 13 Sep., 17:44, Dave Maharaj m...@davemaharaj.com wrote:

  I try:)

  I missed your earlier posts so explain to me what your trying to do exactly?
  Form submit-data to controller- display what was submitted on the same
  page your on?

  -Original Message-
  From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
  Sent: September-13-10 1:04 PM
  To: CakePHP
  Subject: Re: passing form data to my controller

  dave...you have no idea how your torturing me. seriously. I am trying
  to figure this out for 2 weeks now and its makin me crazy...i've never
  been closer to givng up

  i will look into your hint, but do you mind helping me with a little
  code or specifics?

  thx a LOT

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: passing form data to my controller

2010-09-14 Thread Dave Maharaj
Ok if I am reading this right you would need 2 actions no?

Say 
upload() {
autoRender = false;
//show nothing
//form has been submitted
This-data do what you need to do to get the info size, type
$myFormData = array();
//push the data you get from the form into the array

$this-Model-__useMyDataFunction($myFormData);

}

function __useMyDataFunction($myFormData){

//process the data how ever you need it and then render the view with all
that you need

}

-Original Message-
From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] 
Sent: September-14-10 5:43 AM
To: CakePHP
Subject: Re: passing form data to my controller

well i have a form with the type FILE. a user can upload files and the
data (filename, size, type etc) should be passed to a function in my
controller. this controller function is acutally doing the logic,
means saving or uploading the file. then this function is rendering a
view showing all files uploded...

but now i cant pass the form data with AJAX..it is the only thing
missing...

thank you :)

On 13 Sep., 17:44, Dave Maharaj m...@davemaharaj.com wrote:
 I try:)

 I missed your earlier posts so explain to me what your trying to do
exactly?
 Form submit-data to controller- display what was submitted on the same
 page your on?

 -Original Message-
 From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
 Sent: September-13-10 1:04 PM
 To: CakePHP
 Subject: Re: passing form data to my controller

 dave...you have no idea how your torturing me. seriously. I am trying
 to figure this out for 2 weeks now and its makin me crazy...i've never
 been closer to givng up

 i will look into your hint, but do you mind helping me with a little
 code or specifics?

 thx a LOT

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-13 Thread Tomfox Wiranata
so there is no way to pass the file data from my form to my controller
function???
because the controller function actually uploads the file, it just
needs the data

that would suck...

On 13 Sep., 02:00, cricket zijn.digi...@gmail.com wrote:
 Files cannot be upload with AJAX. The only way to do it without
 reloading the page is to set the target of the form to a hidden
 iframe, then fetch the response from there.

 On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata

 tomfox.wiran...@gmail.com wrote:
  Hi everyone,

  I use a form to upload files and currently i do this with jquery to
  simulate ajax, so if I want to pass the file data to my jquery
  function I do this:

  div class=submitbutton onClick=refreshattachments(this.form)
  type=buttonUpload/button/div

  But I want to switch to AJAX and I dont know how to pass the form data
  within an ajax link:

  echo $form-create('Links',
  array('name'='uploadAttachmentsForm','id'='uploadAttachmentsForm','type'='file'));
  echo $form-file('Links');

  echo $ajax-link('Upload', '/links/processattachment'.this.form,
                                  array('update' = 'attachments_content')
                                 );
  echo $form-end();

  aware that $ajax-link('Upload', '/links/
  processattachment'.this.form, is far away from right I stil gave it a
  shot.

  Can someone help me? Thank you. I appreciate it.

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
  with their CakePHP related questions.

  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
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-13 Thread Tomfox Wiranata
well I used jquery before to just reload that DIV after a file got
uploaded and it worked fine. In the end I just needed to render the
result.
but when I added an ajax link in that rendered view to delete a file,
It didnt work. AJAX just would not work. as soon as I abandoned jquery
and just used AJAX-link it worked and I just had to make the file
upload work with AJAX too.

this seems hopeless.??

On 13 Sep., 10:15, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 so there is no way to pass the file data from my form to my controller
 function???
 because the controller function actually uploads the file, it just
 needs the data

 that would suck...

 On 13 Sep., 02:00, cricket zijn.digi...@gmail.com wrote:

  Files cannot be upload with AJAX. The only way to do it without
  reloading the page is to set the target of the form to a hidden
  iframe, then fetch the response from there.

  On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata

  tomfox.wiran...@gmail.com wrote:
   Hi everyone,

   I use a form to upload files and currently i do this with jquery to
   simulate ajax, so if I want to pass the file data to my jquery
   function I do this:

   div class=submitbutton onClick=refreshattachments(this.form)
   type=buttonUpload/button/div

   But I want to switch to AJAX and I dont know how to pass the form data
   within an ajax link:

   echo $form-create('Links',
   array('name'='uploadAttachmentsForm','id'='uploadAttachmentsForm','type'='file'));
   echo $form-file('Links');

   echo $ajax-link('Upload', '/links/processattachment'.this.form,
                                   array('update' = 'attachments_content')
                                  );
   echo $form-end();

   aware that $ajax-link('Upload', '/links/
   processattachment'.this.form, is far away from right I stil gave it a
   shot.

   Can someone help me? Thank you. I appreciate it.

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
   with their CakePHP related questions.

   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
   cake-php+unsubscr...@googlegroups.com For more options, visit this group 
   athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: passing form data to my controller

2010-09-13 Thread Dave Maharaj
Well when you type in a field and you check say the username field in real
time using ajax to make sure it is unique your sending form data to the
controller. Sometimes you just have to figure it out on your own and forget
the helpers. Trust me it can be done to pass the form  data to the
controller when you submit a form using ajax -hint  google it



-Original Message-
From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] 
Sent: September-13-10 5:56 AM
To: CakePHP
Subject: Re: passing form data to my controller

well I used jquery before to just reload that DIV after a file got
uploaded and it worked fine. In the end I just needed to render the
result.
but when I added an ajax link in that rendered view to delete a file,
It didnt work. AJAX just would not work. as soon as I abandoned jquery
and just used AJAX-link it worked and I just had to make the file
upload work with AJAX too.

this seems hopeless.??

On 13 Sep., 10:15, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
 so there is no way to pass the file data from my form to my controller
 function???
 because the controller function actually uploads the file, it just
 needs the data

 that would suck...

 On 13 Sep., 02:00, cricket zijn.digi...@gmail.com wrote:

  Files cannot be upload with AJAX. The only way to do it without
  reloading the page is to set the target of the form to a hidden
  iframe, then fetch the response from there.

  On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata

  tomfox.wiran...@gmail.com wrote:
   Hi everyone,

   I use a form to upload files and currently i do this with jquery to
   simulate ajax, so if I want to pass the file data to my jquery
   function I do this:

   div class=submitbutton onClick=refreshattachments(this.form)
   type=buttonUpload/button/div

   But I want to switch to AJAX and I dont know how to pass the form data
   within an ajax link:

   echo $form-create('Links',
  
array('name'='uploadAttachmentsForm','id'='uploadAttachmentsForm','type'=
'file'));
   echo $form-file('Links');

   echo $ajax-link('Upload', '/links/processattachment'.this.form,
                                   array('update' =
'attachments_content')
                                  );
   echo $form-end();

   aware that $ajax-link('Upload', '/links/
   processattachment'.this.form, is far away from right I stil gave it a
   shot.

   Can someone help me? Thank you. I appreciate it.

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
others with their CakePHP related questions.

   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
   cake-php+unsubscr...@googlegroups.com For more options, visit this
group athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-13 Thread Tomfox Wiranata
dave...you have no idea how your torturing me. seriously. I am trying
to figure this out for 2 weeks now and its makin me crazy...i've never
been closer to givng up

i will look into your hint, but do you mind helping me with a little
code or specifics?

thx a LOT



On 13 Sep., 15:44, Dave Maharaj m...@davemaharaj.com wrote:
 Well when you type in a field and you check say the username field in real
 time using ajax to make sure it is unique your sending form data to the
 controller. Sometimes you just have to figure it out on your own and forget
 the helpers. Trust me it can be done to pass the form  data to the
 controller when you submit a form using ajax -hint  google it

 -Original Message-
 From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com]
 Sent: September-13-10 5:56 AM
 To: CakePHP
 Subject: Re: passing form data to my controller

 well I used jquery before to just reload that DIV after a file got
 uploaded and it worked fine. In the end I just needed to render the
 result.
 but when I added an ajax link in that rendered view to delete a file,
 It didnt work. AJAX just would not work. as soon as I abandoned jquery
 and just used AJAX-link it worked and I just had to make the file
 upload work with AJAX too.

 this seems hopeless.??

 On 13 Sep., 10:15, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:
  so there is no way to pass the file data from my form to my controller
  function???
  because the controller function actually uploads the file, it just
  needs the data

  that would suck...

  On 13 Sep., 02:00, cricket zijn.digi...@gmail.com wrote:

   Files cannot be upload with AJAX. The only way to do it without
   reloading the page is to set the target of the form to a hidden
   iframe, then fetch the response from there.

   On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata

   tomfox.wiran...@gmail.com wrote:
Hi everyone,

I use a form to upload files and currently i do this with jquery to
simulate ajax, so if I want to pass the file data to my jquery
function I do this:

div class=submitbutton onClick=refreshattachments(this.form)
type=buttonUpload/button/div

But I want to switch to AJAX and I dont know how to pass the form data
within an ajax link:

echo $form-create('Links',

 array('name'='uploadAttachmentsForm','id'='uploadAttachmentsForm','type'=
 'file'));
echo $form-file('Links');

echo $ajax-link('Upload', '/links/processattachment'.this.form,
                                array('update' =
 'attachments_content')
                               );
echo $form-end();

aware that $ajax-link('Upload', '/links/
processattachment'.this.form, is far away from right I stil gave it a
shot.

Can someone help me? Thank you. I appreciate it.

Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
 others with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this
 group athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: passing form data to my controller

2010-09-13 Thread Dave Maharaj
I try:)

I missed your earlier posts so explain to me what your trying to do exactly?
Form submit-data to controller- display what was submitted on the same
page your on?

-Original Message-
From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] 
Sent: September-13-10 1:04 PM
To: CakePHP
Subject: Re: passing form data to my controller

dave...you have no idea how your torturing me. seriously. I am trying
to figure this out for 2 weeks now and its makin me crazy...i've never
been closer to givng up

i will look into your hint, but do you mind helping me with a little
code or specifics?

thx a LOT



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


passing form data to my controller

2010-09-12 Thread Tomfox Wiranata
Hi everyone,

I use a form to upload files and currently i do this with jquery to
simulate ajax, so if I want to pass the file data to my jquery
function I do this:

div class=submitbutton onClick=refreshattachments(this.form)
type=buttonUpload/button/div


But I want to switch to AJAX and I dont know how to pass the form data
within an ajax link:

echo $form-create('Links',
array('name'='uploadAttachmentsForm','id'='uploadAttachmentsForm','type'='file'));
echo $form-file('Links');

echo $ajax-link('Upload', '/links/processattachment'.this.form,
 array('update' = 'attachments_content')
);
echo $form-end();


aware that $ajax-link('Upload', '/links/
processattachment'.this.form, is far away from right I stil gave it a
shot.

Can someone help me? Thank you. I appreciate it.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: passing form data to my controller

2010-09-12 Thread cricket
Files cannot be upload with AJAX. The only way to do it without
reloading the page is to set the target of the form to a hidden
iframe, then fetch the response from there.

On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata
tomfox.wiran...@gmail.com wrote:
 Hi everyone,

 I use a form to upload files and currently i do this with jquery to
 simulate ajax, so if I want to pass the file data to my jquery
 function I do this:

 div class=submitbutton onClick=refreshattachments(this.form)
 type=buttonUpload/button/div


 But I want to switch to AJAX and I dont know how to pass the form data
 within an ajax link:

 echo $form-create('Links',
 array('name'='uploadAttachmentsForm','id'='uploadAttachmentsForm','type'='file'));
 echo $form-file('Links');

 echo $ajax-link('Upload', '/links/processattachment'.this.form,
                                 array('update' = 'attachments_content')
                                );
 echo $form-end();


 aware that $ajax-link('Upload', '/links/
 processattachment'.this.form, is far away from right I stil gave it a
 shot.

 Can someone help me? Thank you. I appreciate it.

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


how to validate form data

2010-08-04 Thread xiaopang
Hello,

If I want to validate the form input, let's see if it is a email and I
don't need to store this input in to database, which means the
$validate array can't do the validation.

In this case, besides writing reg express, does cakephp provide any
validation mechanism?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to validate form data

2010-08-04 Thread grigri
You are incorrect in your assumption; you can validate a field with
the $validate array, even if it's not in the database.

This is most often used for I agree checkboxes and whatnot, but it
works with anything.

hth
grigri

On Aug 4, 9:13 am, xiaopang yve...@gmail.com wrote:
 Hello,

 If I want to validate the form input, let's see if it is a email and I
 don't need to store this input in to database, which means the
 $validate array can't do the validation.

 In this case, besides writing reg express, does cakephp provide any
 validation mechanism?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to validate form data

2010-08-04 Thread Miqdad Ali
?php
class Mark extends AppModel{
var $name = 'Mark';
 var $actsAs = array('Logable'=array(
'userModel' = 'Login',
'userKey' = 'user_id',
'description_ids' = true

   ));

var $validate = array(

  'name' = array(
  'rule' =
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' = true,
  'message' = 'Please choose
qualifying exam'

   )
);
}
?
This is My Model  An It's Working Fine
But , I want to change the color of message while it's displaying.





On Wed, Aug 4, 2010 at 1:43 PM, xiaopang yve...@gmail.com wrote:

 Hello,

 If I want to validate the form input, let's see if it is a email and I
 don't need to store this input in to database, which means the
 $validate array can't do the validation.

 In this case, besides writing reg express, does cakephp provide any
 validation mechanism?

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to validate form data

2010-08-04 Thread Miqdad Ali
?php
class Mark extends AppModel{
var $name = 'Mark';
 var $actsAs = array('Logable'=array(
'userModel' = 'Login',
'userKey' = 'user_id',
'description_ids' = true

   ));
var $hasOne= array(
 'StdDetail'=array(
 'foreignKey'=false,
 'ClassName'='StdDetail'
   )
  );
var $validate = array(

  'name' = array(
  'rule' =
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' = true,
  'message' = 'Please choose
qualifying exam'

   ),
'institute' = array(
  'rule' =
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' = true,
  'message' = 'Please enter
Alphabetic values'
   ),
 'board' = array(
  'rule' =
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' = true,
  'message' = 'Please enter
Alphabetic values'
   ),

'max' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
'total' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
 'chem' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
 'phy' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
 'math' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),


'aggregate' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
'memo' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
'rank' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   )
   /* 'max' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
'total' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 'Enter a numerica
value'
   ),
'chem' = array(
  'rule' =
array('custom','/^[0-9]{1,}$/i'),
  'required' = true,
  'message' = 

Redirect does not work after saving form data to database.

2010-06-16 Thread xpo60rj
I'm new to cakephp. I'm trying to build a newsletters subscription
field that is placed in my footer element. I can not get my page to
redirect back to home after submitting form data to the database along
with email notification. The data is saved to the database and I do
get my confirmation email. Instead of redirecting back to home I
constantly get redirected to a page I have no control over
(example.com/subscriptions/add). What am I doing wrong?

Model (subscription.php):

class Subscription extends AppModel
{
#Define the name of the Model
var $name = Subscription;
var $validate = array(
'email' = array(
'rule' = array('email', true),
'message' = 'Please supply a valid email address.'
)
);
}


Controller (subscriptions_controller.php):

class SubscriptionsController extends AppController
{
var $name = Subscriptions;
var $components = array('Email');


function index() {
$this-set('subscriptions', $this-Subscription-find('all'));
}
function add() {
if (!empty($this-data)) {
if ($this-Subscription-save($this-data)) {
$this-Email-to = $this-data['Subscription']['Email'];
$this-Email-subject = 'Subscription Request';
$this-Email-from = 't...@example.com';
$this-Email-send('TEST');
$this-redirect('/', null, true);
   }
 }
 }
}

View (Subscriptions.ctp):

echo $form-create('Subscription');
echo $form-input('Email', 'Email', array(
'type' = 'varchar'
));
echo $form-end('Submit');

I have this view inside an my footer element using this:

echo $this-element('subscriptions');

This is the contents of the subscriptions/add page i keep getting
redirected to:

To: t...@example.com
From: t...@example.com
Subject: Subscription Request
Header:

From: t...@example.com
X-Mailer: CakePHP Email Component
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bitParameters:

Message:

TEST

1

Can someone help me get this to redirect or how can i control the page
that is being rendered at subscriptions/add? I've tried making an
add.ctp inside a subscriptions folder under views, but that doesnt
seem to do anything.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Redirect does not work after saving form data to database.

2010-06-16 Thread xpo60rj
I'm new to cakephp. I'm trying to build a newsletters subscription
field that is placed in my footer element. I can not get my page to
redirect back to home after submitting form data to the database along
with email notification. The data is saved to the database and I do
get my confirmation email. Instead of redirecting back to home I
constantly get redirected to a page I have no control over
(example.com/subscriptions/add). What am I doing wrong?

Model (subscription.php):

class Subscription extends AppModel
{
#Define the name of the Model
var $name = Subscription;
var $validate = array(
'email' = array(
'rule' = array('email', true),
'message' = 'Please supply a valid email address.'
)
);
}


Controller (subscriptions_controller.php):

class SubscriptionsController extends AppController
{
var $name = Subscriptions;
var $components = array('Email');


function index() {
$this-set('subscriptions', $this-Subscription-find('all'));
}
function add() {
if (!empty($this-data)) {
if ($this-Subscription-save($this-data)) {
$this-Email-to = $this-data['Subscription']['Email'];
$this-Email-subject = 'Subscription Request';
$this-Email-from = 't...@example.com';
$this-Email-send('TEST');
$this-redirect('/', null, true);
   }
 }
 }
}

View (Subscriptions.ctp):

echo $form-create('Subscription');
echo $form-input('Email', 'Email', array(
'type' = 'varchar'
));
echo $form-end('Submit');

I have this view inside an my footer element using this:

echo $this-element('subscriptions');

This is the contents of the subscriptions/add page i keep getting
redirected to:

To: t...@example.com
From: t...@example.com
Subject: Subscription Request
Header:

From: t...@example.com
X-Mailer: CakePHP Email Component
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bitParameters:

Message:

TEST

1

Can someone help me get this to redirect or how can i control the page
that is being rendered at subscriptions/add? I've tried making an
add.ctp inside a subscriptions folder under views, but that doesnt
seem to do anything.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: No form data

2010-06-07 Thread Christoph
Thank guys, now it is working!

On 4 Jun., 17:27, calvin cal...@rottenrecords.com wrote:
 1. Controllers are plural. So it would be 'checkouts' not 'checkout'.
 2. Read the Cookbook; you're not using $form-input() correctly.

 On Jun 4, 6:47 am, Christoph christophwe...@googlemail.com wrote:

  hi,

  i have a little bit trouble because i don't get anyformdatain $this-data. 
  i only get thedatain $this-params['form']. is there a way to

  change that? that myform:

  print $form-create(Checkout, array(     url = array(controller =
  checkout, action = step2),
                                                                              
      type = post));

  print $form-input   (select, array      (       options = 
  array(Herr =
  Herr, Frau = Frau),
                                                                              
              label = Anrede:,
                                                                              
              name = anrede,
                                                                              
              id = anrede
                                                                              
      )
                                          );

  print $form-input   (input, array               (       label = 
  Name:,
                                                                              
              name = name,
                                                                              
              id = name
                                                                              
      )
                                          );

  print $form-input   (input, array               (       label = 
  Vorname:,
                                                                              
              name = vorname,
                                                                              
              id = vorname
                                                                              
      )
                                          );

  print $form-input   (input, array               (       label = 
  Straszlig;e, Nr:,
                                                                              
              name = strasse,
                                                                              
              id = strasse
                                                                              
      )
                                          );

  print $form-input   (input, array               (       label = 
  Postleitzahl:,
                                                                              
              name = plz,
                                                                              
              id = plz
                                                                              
      )
                                          );

  print $form-input   (input, array               (       label = 
  Email:,
                                                                              
              name = email,
                                                                              
              id = email
                                                                              
      )
                                          );

  print $form-input   (input, array               (       label = 
  Telefon:,
                                                                              
              name = telefon,
                                                                              
              id = telefon
                                                                              
      )
                                          );

  print $form-end(buttons/weiter.png);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


No form data

2010-06-04 Thread Christoph
hi,

i have a little bit trouble because i don't get any form data in $this-
data. i only get the data in $this-params['form']. is there a way to
change that? that my form:



print $form-create(Checkout, array(  url = array(controller =
checkout, action = step2),

type = post));

print $form-input  (select, array(   options = 
array(Herr =
Herr, Frau = Frau),

label = Anrede:,

name = anrede,

id = anrede

)
);

print $form-input  (input, array (   label = Name:,

name = name,

id = name

)
);

print $form-input  (input, array (   label = Vorname:,

name = vorname,

id = vorname

)
);

print $form-input  (input, array (   label = 
Straszlig;e, Nr:,

name = strasse,

id = strasse

)
);

print $form-input  (input, array (   label = 
Postleitzahl:,

name = plz,

id = plz

)
);

print $form-input  (input, array (   label = Email:,

name = email,

id = email

)
);

print $form-input  (input, array (   label = Telefon:,

name = telefon,

id = telefon

)
);

print $form-end(buttons/weiter.png);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: No form data

2010-06-04 Thread John Andersen
Please take your time to read the CakePHP manual at:

http://book.cakephp.org/view/1390/Automagic-Form-Elements

so that you understand how to use the Form helper input method!

There is clearly stated that the Form helper input method expects the
following parameters:
input(string $fieldName, array $options = array())

Change your code to conform to this and your data will be placed in
the correct array.
Enjoy,
   John

On Jun 4, 4:47 pm, Christoph christophwe...@googlemail.com wrote:
 hi,

 i have a little bit trouble because i don't get any form data in $this-data. 
 i only get the data in $this-params['form']. is there a way to

 change that? that my form:

 print $form-create(Checkout, array(     url = array(controller =
 checkout, action = step2),
                                                                               
   type = post));

 print $form-input   (select, array      (       options = array(Herr 
 =
 Herr, Frau = Frau),
                                                                               
           label = Anrede:,
                                                                               
           name = anrede,
                                                                               
           id = anrede
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = Name:,
                                                                               
           name = name,
                                                                               
           id = name
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Vorname:,
                                                                               
           name = vorname,
                                                                               
           id = vorname
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Straszlig;e, Nr:,
                                                                               
           name = strasse,
                                                                               
           id = strasse
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Postleitzahl:,
                                                                               
           name = plz,
                                                                               
           id = plz
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Email:,
                                                                               
           name = email,
                                                                               
           id = email
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Telefon:,
                                                                               
           name = telefon,
                                                                               
           id = telefon
                                                                               
   )
                                         );

 print $form-end(buttons/weiter.png);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: No form data

2010-06-04 Thread calvin
1. Controllers are plural. So it would be 'checkouts' not 'checkout'.
2. Read the Cookbook; you're not using $form-input() correctly.

On Jun 4, 6:47 am, Christoph christophwe...@googlemail.com wrote:
 hi,

 i have a little bit trouble because i don't get any form data in $this-data. 
 i only get the data in $this-params['form']. is there a way to

 change that? that my form:

 print $form-create(Checkout, array(     url = array(controller =
 checkout, action = step2),
                                                                               
   type = post));

 print $form-input   (select, array      (       options = array(Herr 
 =
 Herr, Frau = Frau),
                                                                               
           label = Anrede:,
                                                                               
           name = anrede,
                                                                               
           id = anrede
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = Name:,
                                                                               
           name = name,
                                                                               
           id = name
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Vorname:,
                                                                               
           name = vorname,
                                                                               
           id = vorname
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Straszlig;e, Nr:,
                                                                               
           name = strasse,
                                                                               
           id = strasse
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Postleitzahl:,
                                                                               
           name = plz,
                                                                               
           id = plz
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Email:,
                                                                               
           name = email,
                                                                               
           id = email
                                                                               
   )
                                         );

 print $form-input   (input, array               (       label = 
 Telefon:,
                                                                               
           name = telefon,
                                                                               
           id = telefon
                                                                               
   )
                                         );

 print $form-end(buttons/weiter.png);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Dynamic Form Data

2010-03-23 Thread WebbedIT
To make things easier, lets strip this back to the core requirements
then you can add in your specific formatting afterwards

$form-input('User.country_id', array('empty' = '-- Select --'));
echo $ajax-observeField('UserCountryId', array('url' =
'countrySelect', 'update' = 'countryAction'));

This should trigger an ajax call to /app/users/countrySelect which
sets a $regions array and renders /app/view/users/country_select.ctp
using the ajax layout (you've obviously managed to get this far).  /
app/view/users/country_select.ctp view could look as simple as

$form-input('User.region_id', array('empty' = '-- Select --'));
echo $ajax-observeField('UserRegionId', array('url' =
'regionSelect', 'update' = 'regionAction'));

I have switched everything back to using cake's conventions, as it's
much easier to learn cake that way.

I imagine both the country and region fields are foreign_keys linking
to tables containing the Countries and Regions which are in turn
related to allow you to know which regions to show for which country
etc.  All foreign keys should have _id after them and form-input will
automagically look for a countries array if a field is called
country_id and a regions array for the field region_id.

HTH

Paul.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-23 Thread Ed Propsner
I actually ended up creating a .js file to hold my functions and initiated
my Ajax with 'onChange' = someFunction(); I pulled the field value into the
script and passed that into the controller action as a named param. etc.
etc. etc. (the entire process seemed a bit unnecessary and long-winded) The
bottom line is that it worked (for the field that was NOT created
dynamically). I repeated the process for the newly generated form field
which in turn did not work. No matter what I try I just can't retrieve any
data from form fields that get generated dynamically and thus the query
fails.

I'll take another wack at it using the suggestions you made and see how I
make out.

Yes, there are separate tables for country, state, and city. I believe I
have the associations set up correctly but who knows, I've been managing to
make a mess of everything else ;) Region and country are my foreign keys
however they are RegionID and CountryID in the db ... I'll change them to
region_id and country_id. The naming conventions in Cake take a little
getting used to.

On Tue, Mar 23, 2010 at 6:39 AM, WebbedIT p...@webbedit.co.uk wrote:

 To make things easier, lets strip this back to the core requirements
 then you can add in your specific formatting afterwards

 $form-input('User.country_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserCountryId', array('url' =
 'countrySelect', 'update' = 'countryAction'));

 This should trigger an ajax call to /app/users/countrySelect which
 sets a $regions array and renders /app/view/users/country_select.ctp
 using the ajax layout (you've obviously managed to get this far).  /
 app/view/users/country_select.ctp view could look as simple as

 $form-input('User.region_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserRegionId', array('url' =
 'regionSelect', 'update' = 'regionAction'));

 I have switched everything back to using cake's conventions, as it's
 much easier to learn cake that way.

 I imagine both the country and region fields are foreign_keys linking
 to tables containing the Countries and Regions which are in turn
 related to allow you to know which regions to show for which country
 etc.  All foreign keys should have _id after them and form-input will
 automagically look for a countries array if a field is called
 country_id and a regions array for the field region_id.

 HTH

 Paul.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-23 Thread Ed Propsner
Okay, I managed to get things worked out. It's like anything else I suppose
... it just takes lots of experimenting, trial and error, and a whole lot of
getting used to before that little light comes on and things finally click.
Some things are finally making more sense to me now.

The documentation for Cake is a little vague in areas but that's nothing
new, it seems to be a common theme shared by anything actually worth using.
It gets better with time I suppose.

Thanks for the help. I'm sure I'll have plenty more questions as I try to
get situated with Cake.

On Tue, Mar 23, 2010 at 7:10 AM, Ed Propsner crotchf...@gmail.com wrote:

 I actually ended up creating a .js file to hold my functions and initiated
 my Ajax with 'onChange' = someFunction(); I pulled the field value into the
 script and passed that into the controller action as a named param. etc.
 etc. etc. (the entire process seemed a bit unnecessary and long-winded) The
 bottom line is that it worked (for the field that was NOT created
 dynamically). I repeated the process for the newly generated form field
 which in turn did not work. No matter what I try I just can't retrieve any
 data from form fields that get generated dynamically and thus the query
 fails.

 I'll take another wack at it using the suggestions you made and see how I
 make out.

 Yes, there are separate tables for country, state, and city. I believe I
 have the associations set up correctly but who knows, I've been managing to
 make a mess of everything else ;) Region and country are my foreign keys
 however they are RegionID and CountryID in the db ... I'll change them to
 region_id and country_id. The naming conventions in Cake take a little
 getting used to.

 On Tue, Mar 23, 2010 at 6:39 AM, WebbedIT p...@webbedit.co.uk wrote:

 To make things easier, lets strip this back to the core requirements
 then you can add in your specific formatting afterwards

 $form-input('User.country_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserCountryId', array('url' =
 'countrySelect', 'update' = 'countryAction'));

 This should trigger an ajax call to /app/users/countrySelect which
 sets a $regions array and renders /app/view/users/country_select.ctp
 using the ajax layout (you've obviously managed to get this far).  /
 app/view/users/country_select.ctp view could look as simple as

 $form-input('User.region_id', array('empty' = '-- Select --'));
 echo $ajax-observeField('UserRegionId', array('url' =
 'regionSelect', 'update' = 'regionAction'));

 I have switched everything back to using cake's conventions, as it's
 much easier to learn cake that way.

 I imagine both the country and region fields are foreign_keys linking
 to tables containing the Countries and Regions which are in turn
 related to allow you to know which regions to show for which country
 etc.  All foreign keys should have _id after them and form-input will
 automagically look for a countries array if a field is called
 country_id and a regions array for the field region_id.

 HTH

 Paul.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.




Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-22 Thread WebbedIT
This is probably a mute point as you say your other sites are ajax
heavy, but what are you using to view the source.  I would suggest
something like FireBug as it shows the full source including DOM
changes via ajax/javascript.  It will also show you the results of
your ajax requests.  You should of course already be using something
similar to FireBug if you have been working with ajax a lot in the
past.

How have you set up a javascript event for the 1st dynamic field your
form creates?  My first guess is your adding an observer for the 2nd
field before it exists in the dom. You can also add an
'onchange'='jsfunction()' to the options array of form-input to add
events to your form fields, this would attach the event to the field
as it's created.

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-22 Thread Ed Propsner
Cake and MVC can be a bit daunting for the first time around especially when
having spent years with conventional code, nothing fancy. I re-wrote my Ajax
calls and the best I can say is that I didn't have something scripted
correctly the first time around because Chrome Java Console and FireBug both
now report that the element is indeed empty.

For the first field I am (was) using $ajax-observeField for field 1. In the
event that field 1 changed, it creates field 2 accordingly and so on down
the line with fields 3,4, etc.

I can tell you right off the bat that my problem is ignorance. This all
feels so alien to me.

I initially had it set up with onchange in the options array as you
suggested. I'm trying to stick with Cake conventions but my first
inclination was go straight for the head of my default.ctp and start with
script type= . . . new Ajax.Updater ... etc. Force of habit I
suppose. I'm a tad bit thrown off with controllers, actions, views, etc.
even though the concept does make sense. Let's say I did want to use
onchange ... where would I put the actual function and what syntax should
I use? This is the part that is throwing me off.


On Mon, Mar 22, 2010 at 5:13 AM, WebbedIT p...@webbedit.co.uk wrote:

 This is probably a mute point as you say your other sites are ajax
 heavy, but what are you using to view the source.  I would suggest
 something like FireBug as it shows the full source including DOM
 changes via ajax/javascript.  It will also show you the results of
 your ajax requests.  You should of course already be using something
 similar to FireBug if you have been working with ajax a lot in the
 past.

 How have you set up a javascript event for the 1st dynamic field your
 form creates?  My first guess is your adding an observer for the 2nd
 field before it exists in the dom. You can also add an
 'onchange'='jsfunction()' to the options array of form-input to add
 events to your form fields, this would attach the event to the field
 as it's created.

 HTH

 Paul

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.




-- 
Please visit http://freecupidreport.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-22 Thread Ed Propsner
Here is one thing I don't quite understand while using $ajax-observeField :

I created a dropdown populated with a list of countries like so ...

echo $html-tableCells(array('bCountry:/b', $form-input('country',
array($countries, 'empty' = '-- Select --', 'label' = '';
$options = array('url' = 'countrySelect','update' = 'countryAction');
echo $ajax-observeField('UserCountry', $options);

When a country is selected it does what I would expect and creates another
input for Region ...

echo $html-tableCells(array('bRegion:/b, $form-input('region',
array($regions, 'label' = '', 'empty' = '-- Select --';

The part I don't understand is that when I echo debug($regions) it displays
an array of regions as I intended however it is not populating the new
dropdown with the array.

If the script is making it far enough to go ahead and create the region
field and the $region array is not empty ... why would it not populate the
dropdown with the array ??


On Mon, Mar 22, 2010 at 5:05 PM, Ed Propsner crotchf...@gmail.com wrote:

 Cake and MVC can be a bit daunting for the first time around especially
 when having spent years with conventional code, nothing fancy. I re-wrote my
 Ajax calls and the best I can say is that I didn't have something scripted
 correctly the first time around because Chrome Java Console and FireBug both
 now report that the element is indeed empty.

 For the first field I am (was) using $ajax-observeField for field 1. In
 the event that field 1 changed, it creates field 2 accordingly and so on
 down the line with fields 3,4, etc.

 I can tell you right off the bat that my problem is ignorance. This all
 feels so alien to me.

 I initially had it set up with onchange in the options array as you
 suggested. I'm trying to stick with Cake conventions but my first
 inclination was go straight for the head of my default.ctp and start with
 script type= . . . new Ajax.Updater ... etc. Force of habit I
 suppose. I'm a tad bit thrown off with controllers, actions, views, etc.
 even though the concept does make sense. Let's say I did want to use
 onchange ... where would I put the actual function and what syntax should
 I use? This is the part that is throwing me off.


 On Mon, Mar 22, 2010 at 5:13 AM, WebbedIT p...@webbedit.co.uk wrote:

 This is probably a mute point as you say your other sites are ajax
 heavy, but what are you using to view the source.  I would suggest
 something like FireBug as it shows the full source including DOM
 changes via ajax/javascript.  It will also show you the results of
 your ajax requests.  You should of course already be using something
 similar to FireBug if you have been working with ajax a lot in the
 past.

 How have you set up a javascript event for the 1st dynamic field your
 form creates?  My first guess is your adding an observer for the 2nd
 field before it exists in the dom. You can also add an
 'onchange'='jsfunction()' to the options array of form-input to add
 events to your form fields, this would attach the event to the field
 as it's created.

 HTH

 Paul

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe from this group, send email to cake-php+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.




 --
 Please visit http://freecupidreport.com


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: Dynamic Form Data

2010-03-22 Thread xochitl reyes
hola ya cambie el mod-rewrite del apache y descomente una linea del core el
index principal de cake ya me sale con colores pero tengo mi primer archivo
.ctp en mis vistas pero no me sale nada grafico ni un error ni nada. solo me
sale reescrito todo el codigo que puse en ese archivo.
llevo todo el dia intentando solucionar ese problema k no tengo ni la mas
minima idea de porque  sea. alguien me puede ayudar ya no se que mas hacer o
k mas investigar ya tambien cambien el htaccess y eso que ni se para que es

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Dynamic Form Data

2010-03-21 Thread CrotchFrog
I finally gave in and decided to give Cake a shot so please pardon my
ignorance to what may seem obvious to you. The majority of my sites
are Ajax heavy so I decided this would be as good a place as any to
start so I set to work on a (what should be simple) form that creates
itself dynamically according to user input.

1. The static part of the form was obviously a breeze to set up - no
problems there.
2. Created a Select input and populated it with data from db - seemed
easy enough, no probs.
3. My next field depended on the input of the Select I just created
and I was a little unsure of how to approach this so I ended up using
$ajax-observeField() and surprisinglyenough it generated my new
form field with seemingly no issues.

The problem I'm running into is that I need to use the data from my
newly created form field and create yet another field based on that
data. The new form field doesn't trigger the Ajax I set up for it nor
does it interact with the action I specified. When I view source on
the page all of the data that was generated dynamically with Ajax is
not showing in the source even though data is plainly visible when
physically viewing the page.

I can't quite figure this one out.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


store session data and form data to database

2010-03-16 Thread stevec
I would like store session data (e.g. login id) and form data to
database

Anyone know how to do this??

Please help me

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: store session data and form data to database

2010-03-16 Thread Jeremy Burns
I do this and it works well. Follow these instructions: 
http://book.cakephp.org/view/1310/Sessions

Jeremy Burns
jeremybu...@me.com

On 16 Mar 2010, at 07:11, stevec wrote:

 I would like store session data (e.g. login id) and form data to
 database
 
 Anyone know how to do this??
 
 Please help me
 
 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.
 
 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


  1   2   >