Re: 3.0: a peek into CakePHP's future

2012-12-07 Thread pete
The modeling for me as PHP programmer is much more simpler when i can 
descripe my models in PHP. You also have to decide first which RDBMS you 
want to use. I think this is a limitation so it is not so easy to switch to 
another Datastore in development process because the code first approach 
is not implemented to generate new DB schema. Also i think is it more the 
right direction to change models on PHP-side and than apply changes 
automatted to the DB. I worked with both approaches and i feel better with 
the Doctrine code first way.

greets pete

by the way i got mail from 139.com in chinese related to this topic.
it seems there is a spam bot in mailing list?

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: 3.0: a peek into CakePHP's future

2012-12-05 Thread pete
Doctrine was mentioned sometimes. I also think it would be a great idea to 
use this ORM for doing all the crazy DB things. There is no need for a self 
implementation because doctrine works very well by now. I like the code 
first approach in doctrine and i'm really missing this in cakephp to write 
the model and generate the database. Doctrine has also options to generate 
migration files for differences in database tables and models during the 
development process. I mean this features should bbe used in future.
greets pete

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Welcome Page not finding CSS/Images

2012-06-23 Thread Pete Varley
I had this same issue.  This fix worked!  Thank you.

On Wednesday, September 2, 2009 6:20:21 PM UTC-4, ajoberstar wrote:

 So I finally gave up trying to find the error and re-extracted the 
 files from the tar.bz2 I downloaded from Cakeforge.  I saw that that 
 worked before changing anything, but the only thing different between 
 my broken install and this was the database.php config file.  So I 
 added that again to see what happened and voila it broke again.  Turns 
 out I had the driver set to mysql instead of mysqli and my PHP install 
 only has the mysqli extension installed it crapped out, but wouldn't 
 tell anything was wrong.  So magic fix. 

 Thanks to everyone for their suggestions. 

 On Sep 2, 12:44 pm, Vijay Kumbhar k.vidn...@gmail.com wrote: 
  Hello ajoberstar, 
  
  Please add Document_root before webroot/ in the .htaccess in the 
  application folder, app folder. 
  
  It will help you, coz i was facing same problem on my server. 
  When i added the DOCUMENT_ROOT path in the .htaccess befor /webroot it 
  worked fine for me. 
  please do check this. 
  
  
  
  
  
  On Tue, Sep 1, 2009 at 6:34 AM, ajoberstar ajobers...@gmail.com 
 wrote: 
  
   I did an install of CakePHP on my local device (Windows XP) with an 
   Apache server.  I did the install to the letter as far as I can tell 
   (removed comment in front of mod_rewrite's load module statement), but 
   I'm getting a welcome page with no layout. And it seems like the whole 
   page isn't even showing up. 
  
   The thing that bugs me the most is that I uploaded the same exact 
   files up to my bluehost account and got the right welcome page.  So 
   it's got to be something with my server setup but I can't figure it 
   out.  Any help would be much appreciated. 
  
   This is all that showed up in the page source: 
  
   h2Release Notes for CakePHP 1.2.4.8284./h2 
   a href=https://trac.cakephp.org/wiki/changelog/1.2.x.x;Read the 
   changelog /a 
   p 
  span class=notice successYour tmp directory is 
   writable./span/ 
   p 
   p 
  span class=notice successThe emFileEngine/em is being 
 used 
   for caching. To change the config edit APP/config/core.php /span/ 
   p 
   p 
  span class=notice successYour database configuration file 
 is 
   present./span/p 
  
  -- 
  Thanks  Regards, 
  Vijayk. 
  Co-founder (www.weboniselab.com) 
  
  You Bring the Dreams, We'll Bring the Means

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


Sorting by a (second level) associated model using paginate helper

2011-01-31 Thread Pete
Dear all,

I suspect this is either really easy or very hard. I've been through
endless apparently similar questions on here but haven't been able to
figure out the answer.

I have a Quote model, which I am trying to list in a view. Quote
belongsTo Attendance which belongs to Person. I am trying to sort the
list of quotes by the first_name field in the Person model.

The array being sent to the view is

Array
(
 [0] = Array
(
[Quote] = Array
 (
[id] = 1
[attendance_id] = 15
[quote_text] = Hello

)

[Attendance] = Array
(
[id] = 15
[person_id] = 2
[trip_id] = 7
[Person] = Array
 (
  [id] = 2
  [first_name] = John
  [last_name] = Smith

   )

)
)


}
This seems to work fine, and in the view, I can echo out

foreach ($quotes as $quote) {
echo $quote['Attendance']['Person']['first_name'];
}
without any problem.

What I cannot get to work is accessing/using the same variable as a
sort field in paginate

   echo $this-Paginator-sort('Name',
'Attendance.Person.first_name');
or

echo $this-Paginator-sort('Location',
'Attendance.Trip.location');

Does not work. It appears to sort by something, but I'm not sure what.
Am I using the correct syntax?. Is there something I should be doing
in a model or controller to make this work?

Thanks in advance.

Peter

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


HABTM Relationships Problem

2009-03-18 Thread Pete Bekisz
Hi all,

I'm having some problems with saving HABTM relationships, and I was hoping
you could help me.  The two models in question are Registrant and Product.

In my Registrant model, I have a method that builds an array that looks like
this:

Array
(
[Registrant] = Array
(
[id] = 133
)

[Product] = Array
(
[0] = Array
(
[product_id] = 1
[quantity] = 5
[cost] = 25.00
)

[1] = Array
(
[product_id] = 2
[quantity] = 1
[cost] = 8.50
[option_id] = 13
)

[2] = Array
(
[product_id] = 2
[quantity] = 9
[cost] = 76.50
[option_id] = 14
)

[3] = Array
(
[product_id] = 2
[quantity] = 3
[cost] = 25.50
[option_id] = 15
)

)

)

When I try using $this-saveAll($array) it does nothing, and when I
try using $this-Product-saveAll($array), this is the SQL it runs:

44START TRANSACTION0045SELECT `ProductsRegistrant`.`registrant_id`
FROM `products_registrants` AS `ProductsRegistrant` WHERE
`ProductsRegistrant`.`product_id` = ''11046DELETE `ProductsRegistrant`
FROM `products_registrants` AS `ProductsRegistrant` WHERE
`ProductsRegistrant`.`product_id` = '' AND
`ProductsRegistrant`.`registrant_id` = (130)1047INSERT INTO
`products_registrants` (`product_id`,`registrant_id`) VALUES
('','133')1048COMMIT

I've been playing with this for quite a while and I can't figure out
what's wrong. Could someone offer some guidance, please?

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



form helper dateTime (cake 1.2)

2007-07-12 Thread pete

hi,
is there a way to set the minYear, maxYear for dateTime?

?php echo $form-dateTime('dateTime','DMY',24,null,null); ?

i want to reduce the number of years within the form

thanks

pete


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



Re: cakex html inside controller

2007-06-19 Thread pete

thanks for all your hints.
as i really like xajax i have already installed Cakex.

the reason why i create this html-code inside the controller is, that
i have a Navigation with Add User which is available on each page.
As soon as i click on it, i render the html code inside div
id=addUser/div

- i want to have only ONE code logic for addUser, thats why i use
innerHTML to add the html code within the addUser-div only if its
necessary.

 Should be available for each view:
  div id=addUserform.../form/div

 - i dont wanna add this div with the form logic inside each view.


- Do you consider using the requestAction and creating a addUser.thml
inside /views/elements?
- Or is it better to create addUser plugin (like the cakex examples)

thanks

pete



On Jun 19, 1:29 am, jitka (poLK) [EMAIL PROTECTED] wrote:
 Well, not everything what is possible is automatically right.

 My propose is NOT keep any html content in controller - it is work for
 view. You're imho looking for

 ?php echo $cakex-link('Add new item', '/phases/formAdd/',
 array('update' = 'add')); ?

 BTW: xajax is a great library, but it is aiming to people without php
 framework, as it does dispatching, basic sanitize etc. One of reasons
 why was CakeX written and published is: take some people from xajax
 community to CakePHP world ;)


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



cakex html inside controller

2007-06-18 Thread pete

hi,
im using cakex (xajax) for my project. i'm just curious if its a good
idea to put html code inside the controller
for example i have a ajax addForm.
Do you think this is a good idea to do it or is it better to have all
html code inside a view.thtml ?

thanks

pete



VIEW
?php echo $cakex-link('Add new item', '/phases/formAdd/'); ?
div id=add/div

CONTROLLER

 function formAdd(){
   $this-autoRender = false;
   $objResponse = $this-Cakex-response;
   $objResponse = new xajaxResponse();

   $html = '
form method=post name=myform id=myform
table border=1 width=100% class=adminlist
tr
td nowrap align=leftLast Name*/td
td align=leftinput type=text 
id=lastname name=lastname
size=25fff/td
/tr

tr
td colspan=2 align=centerbutton 
id=submitButton onClick=
\'...\'Continue/button/td
/tr
/table
/form '
  $objResponse-assign('add', 'innerHTML',$html);
}
}


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



Re: cakex html inside controller

2007-06-18 Thread pete

hm..you are right, the thing is i want to have the add-form on the
same page as where i show the data.
is there a way to assign('add') the view.html code?

something like
  $objResponse-assign('add', 'innerHTML',$??view.thtml??);

thanks pete


On Jun 18, 8:40 pm, Geoff Ford [EMAIL PROTECTED] wrote:
 I wouldn't be doing it

  - Breaks MVC putting html in the controller.
  - Mixing presentation with business logic is never good
  - Harder to update
  - DOes not allow for multiple presentation types

 On Jun 19, 12:52 pm, pete [EMAIL PROTECTED] wrote:

  hi,
  im using cakex (xajax) for my project. i'm just curious if its a good
  idea to put html code inside the controller
  for example i have a ajax addForm.
  Do you think this is a good idea to do it or is it better to have all
  html code inside a view.thtml ?

  thanks

  pete

  VIEW
  ?php echo $cakex-link('Add new item', '/phases/formAdd/'); ?
  div id=add/div

  CONTROLLER

   function formAdd(){
 $this-autoRender = false;
 $objResponse = $this-Cakex-response;
 $objResponse = new xajaxResponse();

 $html = '
  form method=post name=myform id=myform
  table border=1 width=100% class=adminlist
  tr
  td nowrap align=leftLast Name*/td
  td align=leftinput type=text 
  id=lastname name=lastname
  size=25fff/td
  /tr

  tr
  td colspan=2 align=centerbutton 
  id=submitButton onClick=
  \'...\'Continue/button/td
  /tr
  /table
  /form   '
$objResponse-assign('add', 'innerHTML',$html);

  }
  }


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



Recursion for my own custom query?

2007-06-17 Thread Pete

I have a function in my model, to get a list of the months that I have
blog entries in:

function getMonths($limit = null)
{

$sql = SELECT DISTINCT month(Entry.date) number,
monthname(Entry.date) title, year(Entry.date) year FROM entries as
Entry ORDER BY date DESC;
if ($limit): $sql .=  LIMIT  . $limit; endif;

$result = $this-query($sql);
return $result;

}

What would be the best way to then get the Entries that are in those
months. Could I attach the Entries to those month results?

Basically, I'm trying a pretty typical archive by month, and I'm
trying to get an array like:

[0] = Array
(
[Month] = Array
(
[number] = 5
[title] = May
[year] = 2007
)
[Entry] = Array
(
[0] = Array
(
[title] = Blog Post
[date] = May 06, 2007
)
[1] = Array
(
[title] = Blog Post
[date] = May 06, 2007
)
)
)

Any ideas?


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



ajax multiple tables, row delete

2007-06-07 Thread pete

hi,
i have a very simple ajax example of deleting a row in a table.
everything works fine.
my problem is, what happens if i have more than 1 table (that means i
have for example
 TABLE1 with tbody id=user1, TABLE2 with tbody id=user2. the
problem is the user.thtml, i dont know how many tables i have so i
cant create a user.thtml file for each table.
thanks for helping

pete



VIEW

table
  thead
tr
  thFirstName/th
/tr
 /thead
 tbody id=user
   ?php foreach ($users as $user): ?
 tr
   td?php echo $user['User']['FirstName']; ?/td
   td
  form onSubmit=return false;
   input type=submit value=delete id=remove?php echo
$user['User']['ID']; ? /
  /form

  script type=text/javascript
Event.observe(remove?php echo $user['User']['ID']; ?,
'click', function(event){ new Ajax.Updater('user','remove/?php echo
$user
  ['User']['ID']; ?', {asynchronous:true,
evalScripts:true,
parameters:Form.serialize(Event.element(event).form),
  requestHeaders:['X-Update', 'user']}) },
false);
   /script


 /td
 /tr

?php endforeach; ?
 /tbody
/table




CONTROLLER

function remove($id)
{
 $this-set('users', $this-User-findAll());
 $this-render('user', 'ajax');
}


USER.thtml

?php foreach ($users as $user): ?
  tr
td?php echo $user['User']['FirstName']; ?/td
td
  form onSubmit=return false;
input type=submit value=delete id=remove?php echo
$user['User']['ID']; ? /
  /form

  script type=text/javascript
Event.observe(remove?php echo $user['User']['ID']; ?,
'click', function(event){ new Ajax.Updater('user','remove/?php echo
$user
 ['User']['ID']; ?', {asynchronous:true, evalScripts:true,
parameters:Form.serialize(Event.element(event).form),
 requestHeaders:['X-Update', 'user']}) }, false);
  /script
 /td
 /tr

?php endforeach; ?



==
2 or more tables
==

?php for($i=0;$i3;$i++) { ?
table
  thead
tr
  thFirstName/th
/tr
 /thead
 tbody id=user
   ?php foreach ($users as $user): ?
 tr
   td?php echo $user['User']['FirstName']; ?/td
   td
  form onSubmit=return false;
   input type=submit value=delete id=remove?php echo
$user['User']['ID']; ? /
  /form

  script type=text/javascript
Event.observe(remove?php echo $user['User']['ID']; ?,
'click', function(event){ new Ajax.Updater('user','remove/?php echo
$user
  ['User']['ID']; ?', {asynchronous:true,
evalScripts:true,
parameters:Form.serialize(Event.element(event).form),
  requestHeaders:['X-Update', 'user']}) },
false);
   /script


 /td
 /tr

?php endforeach; ?
 /tbody
/table
? } ?


CONTROLLER

function remove($id)
{
 $this-set('users', $this-User-findAll());
 $this-render('user???', 'ajax');
}


user.thtml ?

?php foreach ($users as $user): ?
  tr
td?php echo $user['User']['FirstName']; ?/td
td
  form onSubmit=return false;
input type=submit value=delete id=remove?php echo
$user['User']['ID']; ? /
  /form

  script type=text/javascript
Event.observe(remove?php echo $user['User']['ID']; ?,
'click', function(event){ new Ajax.Updater('user','remove/?php echo
$user
 ['User']['ID']; ?', {asynchronous:true, evalScripts:true,
parameters:Form.serialize(Event.element(event).form),
 requestHeaders:['X-Update', 'user']}) }, false);
  /script
 /td
 /tr

?php endforeach; ?


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



Re: selectTag

2007-06-01 Thread pete

thanks for your reply, not as a default value, i just couldnt find out
how it works to set a value as selected
thanks

On May 31, 7:52 pm, metasan [EMAIL PROTECTED] wrote:
 hi,

 1. i think this error is due to this line :

 ?php echo $html-selectTag('status_id', $status, null, array(),
 null, false, false); ?

 try to replace  fieldname with Modelname/fieldname.

 2. do you want to select delivered as a default value ?

 On Jun 1, 10:32 am,pete[EMAIL PROTECTED] wrote:

  hi,
  im trying to add the selectTag. the select field shows up but i get
  the following warning:

  Notice: Undefined offset: 1 in C:\Apache\xampp\htdocs\cake\cake\libs
  \view\helpers\html.php on line 950

   ?php echo $html-selectTag('status_id', $status, null, array(),
  null, false, false); ?

  select name=data[status_id][]  id=status_id
  option value=3 Declined/option
  option value=6 Deleted/option
  option value=4 Delivered/option
  option value=1 Inquiring/option
  option value=5 Invoiced/option
  option value=7 Open/option
  option value=2 Qualifying/option
  /select

  1. has anyone an idea why i get the notice?
  2. how can i set Delivered as SELECTED ?

  thank you

 pete


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



selectTag

2007-05-31 Thread pete

hi,
im trying to add the selectTag. the select field shows up but i get
the following warning:

Notice: Undefined offset: 1 in C:\Apache\xampp\htdocs\cake\cake\libs
\view\helpers\html.php on line 950

 ?php echo $html-selectTag('status_id', $status, null, array(),
null, false, false); ?

select name=data[status_id][]  id=status_id
option value=3 Declined/option
option value=6 Deleted/option
option value=4 Delivered/option
option value=1 Inquiring/option
option value=5 Invoiced/option
option value=7 Open/option
option value=2 Qualifying/option
/select

1. has anyone an idea why i get the notice?
2. how can i set Delivered as SELECTED ?

thank you

pete


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



simple relation

2007-05-24 Thread pete

hi,
i still play around with creating a simple relation, and i don't get
it to run.
thanks
pete

TABLES:
status
  id
  description

project
  id
  status_id
  project_title

CONTROLLER
  $this-set('projects', $this-Project-findAll());


every project has one status.
how do i create a relation between these 2 tables so i can print the
status.description and not only the status.id

VIEW
project_title: Test
status: Open ??


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



hasOne Problem

2007-05-23 Thread pete

hi,
i have problems using hasOne
basically i want to achieve: a project hasOne status

TABLES
projects
  id
  title
  status_id

statuses
  id
  title


class Project extends AppModel
{
  var $name='Project';

  var $hasOne = array('Status' =
 array('className' = 'Status',
 'conditions' = '',
 'order' = '',
 'foreignKey' = 'status_id'));

}


CONTROLLER
$this-('projects', $this-Project-findAll());

VIEW
when i print out the array
...[Status]=Array([id]=[title]))
}

the array is empty and i dont get the status title

anyone has a hint how that could work correctly?

thanks

pete

Status is empty.


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



Re: hasOne Problem

2007-05-23 Thread pete

hm..
i want to print out all projects and instead of the project.status_id,
i want to show the status.title

how could i do that?

thanks

pete

On May 23, 5:29 pm, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
 On May 23, 2007, at 3:21 PM, pete wrote:



  hi,
  i have problems using hasOne
  basically i want to achieve: a project hasOne status

  TABLES
  projects
id
title
status_id

  statuses
id
title

 The way you have things keyed here, its actually

 Status hasOne Project (and Project belongsTo Status).

 -- John


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



ajax inline edit

2007-05-21 Thread pete

hi,
i already tested the Ajax cakephp ToDo example and it works great. now
try to do the same thing in my own project
the problem is, it works fine for one resource, i created a view
called resource_1 and the ajax works,
how do i do that i have more than one div? i cant create for each
resource_X div a view...

thanks for helping

Pete

VIEW (view.thtml)
div id=resource_? echo $i; ??php echo $resource; ?/div
? print $ajax-editor('resource_'.$i,'/projects/update/'.$i); ?

UPDATE (view update.thtml)
? echo new text; ?

CONTROLLER; //
function update()
{
   $this-render('resource_1', 'ajax');
}


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



ajax div update

2007-05-21 Thread pete

hi,
can anyone tell me why updating 2 divs with ajax-link works, but not
with ajax-editor.
basically i want to enter a value for resource_8 and then calculate a
new value for resource_9

thanks

pete

View
?=$ajax-div(resource_8); ??=$ajax-divEnd(resource_8); ?
?=$ajax-div(resource_9); ??=$ajax-divEnd(resource_9); ?

?
//WORKING
php echo $ajax-link('Link', '/myproject/update/8', array('update' =
array('resource_8', 'resource_9'))); ?

?php
//NOT WORKING
echo $ajax-editor('resource_8', '/myproject/update/8', array('update'
= array('resource_8', 'resource_9')));  ?

CONTROLLER
function update()
{
   $this-set('value8', $_POST['value']);
   $this-set('value9', $_POST['value']+1);
   $this-layout = ajax;
}

UPDATE VIEW
?php echo $ajax-div('resource_8'); ?
?php echo $value8; ?
?php echo $ajax-divEnd('resource_8'); ?

?php echo $ajax-div('resource_9); ?
?php echo $value9; ?
?php echo $ajax-divEnd('resource_9'); ?


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



ajax adding table row

2007-05-16 Thread pete

hi,
i downloaded and tested the ajax example from http://demo.grahambird.co.uk/tasks
everything works fine. now im trying to do the same with a table.
after clicking on 'Add task' a new row should be added to the table.
could anyone help me out? it works fine with divs but not with a table

thanks

pete

CONTROLLER
var $helpers = array('Html','Javascript','Ajax','Form');
function add()
{
$this-Project-saveProject();
$this-set('data', $this-Project-findAll());
$this-render('todo', 'ajax');
}

VIEW
div id=add_task
  form onSubmit=return false;
?php
print $html-input('Task/title', array('id' = 'add_input'));
print $ajax-submit('Add task', array('url' = 'add',
'update'='tasks_todo'));
?
  /form
/div


table border=1 width=100%
?
foreach ($data as $row)
{
  $item = $row['Project'];
?
  tr
td? echo $item['ProjectTitle']; ?/td
  /tr
?
}
?
/table


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



phpThumb caching

2007-01-15 Thread Pete


I was able to get phpThumb working from the Bakery script here:
http://bakery.cakephp.org/articles/view/82, but caching doesn't work.
Permissions are 777 for the /cache/thumbs folder.

I can't seem to get a decent error message from this line:
$phpThumb-RenderToFile($phpThumb-cache_filename); Does anyone else
have any insight into either why it's not working, or how to debug it?


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