Create embedded link for other websites to use

2009-11-09 Thread Jas

Wondering how would one supply a link for someone to use on their
website to display some information in a Flash object. Just like
Youtube gives you an embedded link so you can display the video on
your website/blog.

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



cake-php@googlegroups.com

2009-11-09 Thread ashok.b

Thanks for the reply Graham, I'm actually a newbie to cakephp, can you
kindly give some guidance code to how to do either 1 or 2?

On Nov 10, 6:30 am, Graham Weldon  wrote:
> You might need to do:
>
> 1) URL encode your category names
> Or
> 2) refactor to allow category name slugs for URL access to avoid use  
> of special characters
>
> Cheers
> Graham
>
> On 10/11/2009, at 11:56 AM, "ashok.b"  wrote:
>
>
>
> > Hi, I'm trying to pass values having an ampersand... like
> >http://localhost/cake/cat/TV&; Music where "TV & Music" is the
> > category name and the /cat is actually passed to /Categories/display/
> > TV & Music.
>
> > I added the following in routes.php to achieve the above:
> >    Router::connect('/cat/*', array('controller' => 'Categories',
> > 'action' => 'display'));
>
> > For all category names without &, this works fine. But categories
> > having & fails. In the above example, query happens only for "TV" and
> > not for "TV & Music". Can some one help me with this?
>
>
--~--~-~--~~~---~--~~
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: Save() multiple times not working?

2009-11-09 Thread GoalTribe

Excellent! $this->Event->create()  worked perfectly.

Thanks Miles & hunny!


On Nov 4, 10:53 pm, Miles J  wrote:
> Or call $this->Event->create() before the nextsave.
>
> On Nov 4, 10:41 pm, hunny  wrote:
>
> > After the call $this->Event->save($new_event_data2);
> > Write the following line
>
> > $this->Event->id = null;
>
> > It should work fine.
>
> > On Nov 5, 4:21 am, GoalTribe  wrote:
>
> > > Why doesn'tsave() workmultipletimesin the same action?
>
> > > I have an action that my cron job calls to see which members need
> > > reminders.
>
> > > It loops through all members to check. I would like to add an entry
> > > into my event log table for each member that gets a reminder. However,
> > > only the first call tosave() seems to work.
>
> > > What am I doing wrong?
>
> > > Here is my code:
>
> > >                                $new_event_data2 = array(
> > >                                                 'Event' =>   array(
> > >                                                                           
> > >       'user_id'       =>   $fbid,
> > >                                                                           
> > >       'event' =>   "email",
> > >                                                                           
> > >       )
> > >                                                                         );
>
> > >                                                 
> > > $this->Event->save($new_event_data2);
>
> > > Thanks so much for your help!
>
> > > This is for a Facebook App called "The 30 Day Fitness Challenge"
> > > running on CakePHP. See it live 
> > > here:http://www.facebook.com/apps/application.php?id=143111604747
--~--~-~--~~~---~--~~
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 get weekdays in drop down, with a default day selected.

2009-11-09 Thread Kyle Decot

echo $form->input('Weekday', array('options' => array
('Monday'=>'Monday','Tuesday'=>'Tuesday','Wednesday'=>'Wednesday','Thursday'=>'Thursday',
'Friday'=>'Friday','Saturday'=>'Saturday',
'Sunday'=>'Sunday')));

On Nov 10, 1:04 am, cake  wrote:
> Hi all,
>
> I want  the weekdays to be displayed in a drop down, with a default
> day selected.
> My code is as follows
> echo $form->input('Weekday', array('options' => array
> ('Monday','Tuesday','Wednesday','Thursday', 'Friday','Saturday',
> 'Sunday')));
> When I do like this it stores 0 value in database instead of day name.
> Also I want to set a default selected weekday .
> Please help!!!
>
> Thanking you..
--~--~-~--~~~---~--~~
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 get weekdays in drop down, with a default day selected.

2009-11-09 Thread cake

Hi all,

I want  the weekdays to be displayed in a drop down, with a default
day selected.
My code is as follows
echo $form->input('Weekday', array('options' => array
('Monday','Tuesday','Wednesday','Thursday', 'Friday','Saturday',
'Sunday')));
When I do like this it stores 0 value in database instead of day name.
Also I want to set a default selected weekday .
Please help!!!

Thanking you..
--~--~-~--~~~---~--~~
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: Helpers and AJAX request

2009-11-09 Thread Amit

Thanks! That makes sense.

On Nov 9, 7:46 pm, "Dr. Loboto"  wrote:
> You should not return from controller but use view to render AJAX
> response.
>
> On Nov 9, 9:51 pm, Amit  wrote:
>
>
>
> > The general question is - Is there a way to access Helpers during an
> > AJAX response?
>
> > I have a form that contains a dropdown and a group of radio buttons.
> > When a new item is selected from the dropdown, an XMLHTTPRequest is
> > sent to the server to get the new collection of radio buttons.
>
> > Right now, my controller determines if its an AJAX request, queries
> > for the list of items, manually generates the HTML for the radio
> > buttons, and sends the response. I know that the View layer offers a
> > FormHelper to "automagically" create the form element ($form->radio
> > ()), is there anything similar available when creating an AJAX
> > response?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Share hosting experience

2009-11-09 Thread gabrielr

Hi everyone,

Do you have some experience deploying CakePHP application with this
web hosting:

- ipage.com
- fatcow.com
- justhost.com

this because im planed to deploy an app, but I wanna know your
experience  and if you recomended someone of that or wich recommended

Thanks for your answers 



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



htaccess

2009-11-09 Thread dtirer

I thought I had this all figured out until now.
Put together a new app.  the structure is as follows

/Users/dtirer/Sites/new_site
   /cake (core cake)
   /admin
   /app
   /index.php
   /vendors
   /form
  /app
 /index.php
 /vendors

The 'Form' and 'Admin' directories are more or less 2 separate apps
using the core '/cake' library.

Everything works fine until I put in the .htaccess for the /admin
folder or the /form folder.  These look like this:

RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]

If it take that out, I get the welcome screen, but with no styling.

When it's in, I get this error:

The requested URL /Users/dtirer/Sites/new_site/admin/app/webroot/ was
not found on this server.

The wierd part is, that path should be correct.  any ideas?


--~--~-~--~~~---~--~~
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: not getting belongsTo objects

2009-11-09 Thread mlecho

coolthanks

On Oct 30, 12:45 pm, John Andersen  wrote:
> Try to set recursive to 2 in your find statement.
>
> Better yet, use the Containable behaviour, it will save a lot of time
> in the future.
> Seehttp://book.cakephp.org/view/474/Containable
>
> Enjoy,
>    John
>
> On Oct 30, 3:54 pm, mlecho  wrote:
>
>
>
> > hi- i am so close on this one
>
> > Imagine three models...Event , Venue, and EventType. Currently, Event
> > belongsTo Venue. Each event has a specific venue at which it will
> > occur. If i nav to events/view/2, i get the expected Event object and
> > it's Venue object. Great.
>
> > It makes since in my mind that each EventType hasMany Event(s). If i
> > nav to types/view/2, again, i get the correct Event(s) associated to
> > that EventType.
>
> > My problem is, when i pull a specific EventType, i don't get the venue
> > object associated to the Event object. I get the related events, but i
> > had hoped the Venue for which that Event occurs would also be bound to
> > that specific Event. I am not sure what code you will need, but i can
> > give anything...we can start with the Model for Type, and Event
>
> > //Type Model
> > 
> > class Type extends AppModel {
> >     var $name = 'Type';
> >         var $hasMany = array(
> >                 "Event"=>array(
> >                         "foreignKey"=>"event_type",
> >                         "order"=>array("date"=>"asc","start_time"=>"asc")
> >                         )
> >                 );
>
> > }
>
> > ?>
>
> > //EVENT model
> > 
> > class Event extends AppModel {
> >     var $name = 'Event';
>
> >         var $belongsTo=array(
> >                 "Venue"=>array(
> >                         "foreignKey"=>"venue"
> >                         ),
> >                 "Type"=>array(
> >                         "foreignKey"=>"event_type"
> >                         )
> >                 );
>
> > }
>
> > ?>
--~--~-~--~~~---~--~~
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: Strange Error

2009-11-09 Thread dtirer

O.J. Tibi, you win! haha
thanks for your help!

On Nov 9, 9:13 pm, dtirer  wrote:
> OK have some new information, maybe this will help narrow it down.
>
> Firstly, the way I originally transferred my files form my local
> machine to the live one, was by dragging and dropping them via Fetch.
>
> Thinking now, that maybe files got missed or something in the
> transfer, I transferred the Live files, directly to ANOTHER separate
> live server.  The interesting thing is, I still had the same error
> message.
>
> So that makes me think that some file got misplaced in the original
> transfer
>
> On Nov 9, 8:38 pm, dtirer  wrote:
>
> > I'm actually editing on a mac.  Tried eliminating white space, still
> > the same problem.
> > Unfortunately, its not my server so I can't update the Php version
> > really.
>
> > On Nov 9, 8:27 pm, Graham Weldon  wrote:
>
> > > If this fails, I'll get you to tar up your files and and them to me to  
> > > check...
>
> > > Are you editing on a windows machine? It's possible that some line  
> > > endings are being screwed up.
>
> > > Remove all unnecessary whitespace just to eliminate any issues there.
>
> > > Gentoo's latest Php is 5.2.11-p0. So I mightbe a good opportunity to  
> > > upgrade also.
>
> > > Cheers
> > > Graham
>
> > > On 10/11/2009, at 11:05 AM, dtirer  wrote:
>
> > > > Note:  Outside of Cake, this server has no problem deal with OOP and
> > > > classes
>
> > > > On Nov 9, 6:53 pm, dtirer  wrote:
> > > >> So I've been toying with Cake apps on my local server for a little
> > > >> while now.  Now, Im working with developing one on live server.  The
> > > >> install/setup went fine.
>
> > > >> As a test, I create a simple table called 'cases' with just an 'id'
> > > >> field in it (primary key, auto_increment)
>
> > > >> I then created a cases_controller.php file and put it in the
> > > >> Controllers folder.  The content of that file is:
>
> > > >> 
> > > >>         class CasesController extends AppController
> > > >>         {
>
> > > >>         }
>
> > > >> ?>
>
> > > >> I then created a case.php file and put it in the Models folder.  The
> > > >> content of that file is:
>
> > > >> 
> > > >>         class Case extends AppModel
> > > >>         {
>
> > > >>         }
>
> > > >> ?>
>
> > > >> When I try to navigate to the /cases controller in the browser, I get
> > > >> the following error:
>
> > > >> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
> > > >> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3
>
> > > >> There is no problem on line 3 of the case.php file that i can see.
> > > >> This same system works fine locally on my machine.
>
> > > >> The live server is running PHP Version 5.2.10-pl0-gentoo
>
> > > >> Any ideas?
--~--~-~--~~~---~--~~
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: Strange Error

2009-11-09 Thread dtirer

OK have some new information, maybe this will help narrow it down.

Firstly, the way I originally transferred my files form my local
machine to the live one, was by dragging and dropping them via Fetch.

Thinking now, that maybe files got missed or something in the
transfer, I transferred the Live files, directly to ANOTHER separate
live server.  The interesting thing is, I still had the same error
message.

So that makes me think that some file got misplaced in the original
transfer

On Nov 9, 8:38 pm, dtirer  wrote:
> I'm actually editing on a mac.  Tried eliminating white space, still
> the same problem.
> Unfortunately, its not my server so I can't update the Php version
> really.
>
> On Nov 9, 8:27 pm, Graham Weldon  wrote:
>
> > If this fails, I'll get you to tar up your files and and them to me to  
> > check...
>
> > Are you editing on a windows machine? It's possible that some line  
> > endings are being screwed up.
>
> > Remove all unnecessary whitespace just to eliminate any issues there.
>
> > Gentoo's latest Php is 5.2.11-p0. So I mightbe a good opportunity to  
> > upgrade also.
>
> > Cheers
> > Graham
>
> > On 10/11/2009, at 11:05 AM, dtirer  wrote:
>
> > > Note:  Outside of Cake, this server has no problem deal with OOP and
> > > classes
>
> > > On Nov 9, 6:53 pm, dtirer  wrote:
> > >> So I've been toying with Cake apps on my local server for a little
> > >> while now.  Now, Im working with developing one on live server.  The
> > >> install/setup went fine.
>
> > >> As a test, I create a simple table called 'cases' with just an 'id'
> > >> field in it (primary key, auto_increment)
>
> > >> I then created a cases_controller.php file and put it in the
> > >> Controllers folder.  The content of that file is:
>
> > >> 
> > >>         class CasesController extends AppController
> > >>         {
>
> > >>         }
>
> > >> ?>
>
> > >> I then created a case.php file and put it in the Models folder.  The
> > >> content of that file is:
>
> > >> 
> > >>         class Case extends AppModel
> > >>         {
>
> > >>         }
>
> > >> ?>
>
> > >> When I try to navigate to the /cases controller in the browser, I get
> > >> the following error:
>
> > >> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
> > >> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3
>
> > >> There is no problem on line 3 of the case.php file that i can see.
> > >> This same system works fine locally on my machine.
>
> > >> The live server is running PHP Version 5.2.10-pl0-gentoo
>
> > >> Any ideas?
--~--~-~--~~~---~--~~
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: Strange Error

2009-11-09 Thread O.J. Tibi

@dtirer,

The PHP compiler just saw a keyword, maybe you should try using a
different model name for your Case model? (case is a reserved word
after all)

Cheers,
OJ

On Nov 10, 9:38 am, dtirer  wrote:
> I'm actually editing on a mac.  Tried eliminating white space, still
> the same problem.
> Unfortunately, its not my server so I can't update the Php version
> really.
>
> On Nov 9, 8:27 pm, Graham Weldon  wrote:
>
> > If this fails, I'll get you to tar up your files and and them to me to  
> > check...
>
> > Are you editing on a windows machine? It's possible that some line  
> > endings are being screwed up.
>
> > Remove all unnecessary whitespace just to eliminate any issues there.
>
> > Gentoo's latest Php is 5.2.11-p0. So I mightbe a good opportunity to  
> > upgrade also.
>
> > Cheers
> > Graham
>
> > On 10/11/2009, at 11:05 AM, dtirer  wrote:
>
> > > Note:  Outside of Cake, this server has no problem deal with OOP and
> > > classes
>
> > > On Nov 9, 6:53 pm, dtirer  wrote:
> > >> So I've been toying with Cake apps on my local server for a little
> > >> while now.  Now, Im working with developing one on live server.  The
> > >> install/setup went fine.
>
> > >> As a test, I create a simple table called 'cases' with just an 'id'
> > >> field in it (primary key, auto_increment)
>
> > >> I then created a cases_controller.php file and put it in the
> > >> Controllers folder.  The content of that file is:
>
> > >> 
> > >>         class CasesController extends AppController
> > >>         {
>
> > >>         }
>
> > >> ?>
>
> > >> I then created a case.php file and put it in the Models folder.  The
> > >> content of that file is:
>
> > >> 
> > >>         class Case extends AppModel
> > >>         {
>
> > >>         }
>
> > >> ?>
>
> > >> When I try to navigate to the /cases controller in the browser, I get
> > >> the following error:
>
> > >> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
> > >> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3
>
> > >> There is no problem on line 3 of the case.php file that i can see.
> > >> This same system works fine locally on my machine.
>
> > >> The live server is running PHP Version 5.2.10-pl0-gentoo
>
> > >> Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



buildacl fatal error. tutorial

2009-11-09 Thread Maxx Sid

when a run this action (http://localhost/groups/build_acl)  in
browser, i have a fatal error:
Fatal error: Call to a member function node() on a non-object
in /./././.1/app/controllers/groups_controller.php

function build_acl() {
if (!Configure::read('debug')) {
return $this->_stop();
}
$log = array();

$aco =& $this->Acl->Aco;
$root = $aco->node('controllers');  // This line
if (!$root) {
$aco->create(array('parent_id' => null, 'model' => 
null, 'alias' =>
'controllers'));
$root = $aco->save();
$root['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for controllers';
} else {
$root = $root[0];
}

How can i fix this?

--~--~-~--~~~---~--~~
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: time out while uploading to database

2009-11-09 Thread Dr. Loboto

http://php.net/manual/en/function.set-time-limit.php

On Nov 9, 5:10 pm, hunny  wrote:
> Hi Guys,
>
> While uploading database with records from a very large file, I am
> getting the following timeout error:
>
> Maximum execution time of 30 seconds exceeded in cake/libs/model/
> model.php on line 776.
>
> Could anyone please guide me on where to set this time out variable?
>
> Thanks in Advance,
> Hunny.
--~--~-~--~~~---~--~~
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: I think I've got a routing problem - welcome page is perfect but app is broken

2009-11-09 Thread Dr. Loboto


RewriteEngine on
RewriteBase   /myproject
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

And don't forget to restart Apache after change of httpd.conf Also
make sure that you edit right httpd.conf (at least with php.ini on Win
XAMP it is common mistake).

On Nov 10, 3:54 am, Peter Bowen  wrote:
> Thanks but it didn't help. I'm desperate enough to start looking at
> Code Igniter :(
>
> On Nov 9, 3:21 pm, "Dr. Loboto"  wrote:
>
>
>
> > Try add rewrite base to your webroot .htacces:
> > RewriteBase /myproject
>
> > On Nov 9, 3:43 am, Peter Bowen  wrote:
>
> > > Hi,
>
> > > I'm sure the routing is messed up somewhere and I'd appreciate some
> > > help (8 hours of googling and experimenting and I'd be about ready to
> > > tear my hair out if I wasn't already bald).
>
> > > --setup--
> > > I'm using Mac OSX with XAMPP for development. I've got the project in
> > > a subdirectory on Xampp's webroot:
> > > httpdocs/myproject/
>
> > > I've enabled rewrite in httpd.conf:
> > > LoadModule rewrite_module modules/mod_rewrite.so
>
> > > I've set up an alias in httpd.conf:
> > > Alias /quote-reminder /Applications/xampp/xamppfiles/htdocs/myproject/
> > > app/webroot
> > > 
> > > AllowOverride All
> > > Options All
> > > Order allow,deny
> > > Allow from all
> > > 
>
> > > I've got 3 .htaccess files each with:
> > > 
> > >     RewriteEngine on
> > >     RewriteRule    ^$    webroot/    [L]
> > >     RewriteRule    (.*) webroot/$1    [L]
> > >  
>
> > > I've baked my app and have model, controller and view files
>
> > > --the problem--
> > > I can see the pretty welcome screen (with the css) when I go to
> > > localhost/myproject/
>
> > > If I type in localhost/myproject/user or localhost/myproject/user
> > > expecting to see something to do with my user model I get a 404
> > > error.
>
> > > If I type inhttp://localhost/myproject/index.php/usersgivesmea
> > > list of users but without any css
>
> > > --thanks--
> > > I'd really appreciate some pointers. Even better would be someone who
> > > lives near Portsmouth or on the Isle of Wight who would give me an
> > > hour of their expertise in exchange for lunch
--~--~-~--~~~---~--~~
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: Helpers and AJAX request

2009-11-09 Thread Dr. Loboto

You should not return from controller but use view to render AJAX
response.

On Nov 9, 9:51 pm, Amit  wrote:
> The general question is - Is there a way to access Helpers during an
> AJAX response?
>
> I have a form that contains a dropdown and a group of radio buttons.
> When a new item is selected from the dropdown, an XMLHTTPRequest is
> sent to the server to get the new collection of radio buttons.
>
> Right now, my controller determines if its an AJAX request, queries
> for the list of items, manually generates the HTML for the radio
> buttons, and sends the response. I know that the View layer offers a
> FormHelper to "automagically" create the form element ($form->radio
> ()), is there anything similar available when creating an AJAX
> response?
--~--~-~--~~~---~--~~
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: exit() function

2009-11-09 Thread Dr. Loboto

If you do not want action to render response, just set
$this->autoRender = false;
$this->autoLayout = false; // may not be nessecary

On Nov 10, 1:11 am, lee  wrote:
> Hello,
>
> I am trying to test some actions in controller with CakePHP test
> framework. But some actions contain exit() function not to render. If
> you call that action from framework. It will kill the process, and
> test cannot go further. Is there any work around for this problem?
>
> thank ahead,
> J.J
--~--~-~--~~~---~--~~
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: Strange Error

2009-11-09 Thread dtirer

I'm actually editing on a mac.  Tried eliminating white space, still
the same problem.
Unfortunately, its not my server so I can't update the Php version
really.

On Nov 9, 8:27 pm, Graham Weldon  wrote:
> If this fails, I'll get you to tar up your files and and them to me to  
> check...
>
> Are you editing on a windows machine? It's possible that some line  
> endings are being screwed up.
>
> Remove all unnecessary whitespace just to eliminate any issues there.
>
> Gentoo's latest Php is 5.2.11-p0. So I mightbe a good opportunity to  
> upgrade also.
>
> Cheers
> Graham
>
> On 10/11/2009, at 11:05 AM, dtirer  wrote:
>
>
>
> > Note:  Outside of Cake, this server has no problem deal with OOP and
> > classes
>
> > On Nov 9, 6:53 pm, dtirer  wrote:
> >> So I've been toying with Cake apps on my local server for a little
> >> while now.  Now, Im working with developing one on live server.  The
> >> install/setup went fine.
>
> >> As a test, I create a simple table called 'cases' with just an 'id'
> >> field in it (primary key, auto_increment)
>
> >> I then created a cases_controller.php file and put it in the
> >> Controllers folder.  The content of that file is:
>
> >> 
> >>         class CasesController extends AppController
> >>         {
>
> >>         }
>
> >> ?>
>
> >> I then created a case.php file and put it in the Models folder.  The
> >> content of that file is:
>
> >> 
> >>         class Case extends AppModel
> >>         {
>
> >>         }
>
> >> ?>
>
> >> When I try to navigate to the /cases controller in the browser, I get
> >> the following error:
>
> >> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
> >> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3
>
> >> There is no problem on line 3 of the case.php file that i can see.
> >> This same system works fine locally on my machine.
>
> >> The live server is running PHP Version 5.2.10-pl0-gentoo
>
> >> Any ideas?
--~--~-~--~~~---~--~~
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: Edit form attempting INSERT INTO statement and fails

2009-11-09 Thread O.J. Tibi

Hi,

I'm guessing your primary key field is misspelled? You could try
replacing ID with id (lower case).

Cheers,
OJ

On Nov 10, 2:26 am, dpinion  wrote:
> Greetings,
> I am a bit new to cake, and am diving in via the cookbook. I have a
> simple app I am trying to develop, and am modifying the cookbook
> example to fit it. So far everything has worked great with one
> exception. I have an edit form that when I go to it it fills in with
> the DB data from the record previously selected (on the index page).
> However, once I change any information and try to submit it, I receive
> the following:
>
> SQL Error: 1062: Duplicate entry '1' for key 1 [CORE/cake/libs/model/
> datasources/dbo_source.php
>
> The query string tells me that the form is attempting to perform an
> INSERT Into instead of an UPDATE command on the database, causing the
> failure. I am not sure why it is doing this... Here is my edit.ctp
> content:
>
> Edit Comment
>
>        echo $form->create('Comment', array('action' => 'edit'));
>    echo $form->input('name'); //text
>    echo $form->input('com_date'); //day, month, year, hour, minute,
> meridian
>    echo $form->input('comment', array('rows' => '3'));
>    echo $form->input('ID', array('type' => 'hidden'));
>    echo $form->end('Update Information');
>    ?>
>
> and here is the edit section from the controller:
>
> function edit($id = null) {
> $this->Comment->id = $id;
>    if (empty($this->data))
>    {
>        $this->data = $this->Comment->read();
>    }
>    else
>    {
>        if($this->Comment->save($this->data))
>        {
>             $this->Session->setFlash('Your comment has been updated.
> ','/comments/');
>        }
>    }
>
> }
>
> any suggestions as to what I am doing wrong?
>
> Thanks!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



cake-php@googlegroups.com

2009-11-09 Thread Graham Weldon

You might need to do:

1) URL encode your category names
Or
2) refactor to allow category name slugs for URL access to avoid use  
of special characters

Cheers
Graham

On 10/11/2009, at 11:56 AM, "ashok.b"  wrote:

>
> Hi, I'm trying to pass values having an ampersand... like
> http://localhost/cake/cat/TV & Music where "TV & Music" is the
> category name and the /cat is actually passed to /Categories/display/
> TV & Music.
>
> I added the following in routes.php to achieve the above:
>Router::connect('/cat/*', array('controller' => 'Categories',
> 'action' => 'display'));
>
> For all category names without &, this works fine. But categories
> having & fails. In the above example, query happens only for "TV" and
> not for "TV & Music". Can some one help me with this?
> >

--~--~-~--~~~---~--~~
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: javascript alert after auth login

2009-11-09 Thread O.J. Tibi

Hi Marcelo,

Since you were saying "Javascript alert box", I guess this wouldn't be
a CakePHP specific question.

Anyway, let me answer (using jQuery, of course)

1.) Set aside a div (or any container you deem fit) on your layout to
contain the $session->flash('auth') message. Place an ID for this div.
2.) Style this div like display: hidden
3.) On jQuery document.ready, get the contents of this div, and put it
in an alert box as you would in normal Javascript.

Cheers,
OJ

On Nov 9, 4:47 am, Marcelo Andrade  wrote:
> Hi there,
>
> Maybe it's a newbie question, but what's the proper way to
> show a javascript alert after a successfull auth login?
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
--~--~-~--~~~---~--~~
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: Strange Error

2009-11-09 Thread Graham Weldon

If this fails, I'll get you to tar up your files and and them to me to  
check...

Are you editing on a windows machine? It's possible that some line  
endings are being screwed up.

Remove all unnecessary whitespace just to eliminate any issues there.

Gentoo's latest Php is 5.2.11-p0. So I mightbe a good opportunity to  
upgrade also.

Cheers
Graham

On 10/11/2009, at 11:05 AM, dtirer  wrote:

>
> Note:  Outside of Cake, this server has no problem deal with OOP and
> classes
>
> On Nov 9, 6:53 pm, dtirer  wrote:
>> So I've been toying with Cake apps on my local server for a little
>> while now.  Now, Im working with developing one on live server.  The
>> install/setup went fine.
>>
>> As a test, I create a simple table called 'cases' with just an 'id'
>> field in it (primary key, auto_increment)
>>
>> I then created a cases_controller.php file and put it in the
>> Controllers folder.  The content of that file is:
>>
>> >
>> class CasesController extends AppController
>> {
>>
>> }
>>
>> ?>
>>
>> I then created a case.php file and put it in the Models folder.  The
>> content of that file is:
>>
>> >
>> class Case extends AppModel
>> {
>>
>> }
>>
>> ?>
>>
>> When I try to navigate to the /cases controller in the browser, I get
>> the following error:
>>
>> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
>> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3
>>
>> There is no problem on line 3 of the case.php file that i can see.
>> This same system works fine locally on my machine.
>>
>> The live server is running PHP Version 5.2.10-pl0-gentoo
>>
>> Any ideas?
> >

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



cake-php@googlegroups.com

2009-11-09 Thread ashok.b

Hi, I'm trying to pass values having an ampersand... like
http://localhost/cake/cat/TV & Music where "TV & Music" is the
category name and the /cat is actually passed to /Categories/display/
TV & Music.

I added the following in routes.php to achieve the above:
Router::connect('/cat/*', array('controller' => 'Categories',
'action' => 'display'));

For all category names without &, this works fine. But categories
having & fails. In the above example, query happens only for "TV" and
not for "TV & Music". Can some one help me with this?
--~--~-~--~~~---~--~~
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: Format for data in a HABTM save

2009-11-09 Thread carl67lp

For those struggling with the same problem, I've found a solution.
The array should be formatted as in the last comment on this page:

http://teknoid.wordpress.com/2009/03/30/revisiting-saveall-and-habtm/

Also note that you need saveAll(), not just save() ... it would seem.

--Carl

On Nov 8, 8:53 pm, carl67lp  wrote:
> Apologies if this has been answered elsewhere; a reasonably thorough
> search of this group and of the CakePHP docs yielded no useful
> results.
>
> I've got an app that categorizes board games; it pulls data via XML
> feed from an external site.  My models are such that Game is the
> "master" model, and it goes thusly:
>
> Game HABTM Artist
> Game HABTM Category
> Game HABTM Designer
>
> ...and so on.
>
> For a particular game, there can exist multiple artists, multiple
> categories, and so on.  For example, the game "Die Macher" has only
> one designer, but three publishers and several categories.
>
> I'm able to put the artist/category/designer data into the appropriate
> tables as needed.  What I can't seem to figure out is how to properly
> construct my $this->data array so that I can save the artists_games
> HABTM linkages.
>
> Am I close with something like this?
>
> $this->data['Game'] = array
> (
> 'Artist' => array('Artist.id' => $artist_id, 'Game.id' => $game_id),
> 'Category' => array('Category.id' => $category_id, 'Game.id' =>
> $game_id),
> ...
> );
>
> The documentation has everything coming in from a form; my app has
> everything coming in from XML--thus, I need to manually create $this-
>
> >data.
>
> Incidentally: my baked view for /game/add/ have what look like multi-
> select boxes for Artist/Category/etc., but no data inside.  Did I miss
> something somewhere?
>
> Many thanks for any assistance you can provide.
--~--~-~--~~~---~--~~
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: Strange Error

2009-11-09 Thread dtirer

Note:  Outside of Cake, this server has no problem deal with OOP and
classes

On Nov 9, 6:53 pm, dtirer  wrote:
> So I've been toying with Cake apps on my local server for a little
> while now.  Now, Im working with developing one on live server.  The
> install/setup went fine.
>
> As a test, I create a simple table called 'cases' with just an 'id'
> field in it (primary key, auto_increment)
>
> I then created a cases_controller.php file and put it in the
> Controllers folder.  The content of that file is:
>
> 
>         class CasesController extends AppController
>         {
>
>         }
>
> ?>
>
> I then created a case.php file and put it in the Models folder.  The
> content of that file is:
>
> 
>         class Case extends AppModel
>         {
>
>         }
>
> ?>
>
> When I try to navigate to the /cases controller in the browser, I get
> the following error:
>
> Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
> data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3
>
> There is no problem on line 3 of the case.php file that i can see.
> This same system works fine locally on my machine.
>
> The live server is running PHP Version 5.2.10-pl0-gentoo
>
> Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Strange Error

2009-11-09 Thread dtirer

So I've been toying with Cake apps on my local server for a little
while now.  Now, Im working with developing one on live server.  The
install/setup went fine.

As a test, I create a simple table called 'cases' with just an 'id'
field in it (primary key, auto_increment)

I then created a cases_controller.php file and put it in the
Controllers folder.  The content of that file is:



I then created a case.php file and put it in the Models folder.  The
content of that file is:



When I try to navigate to the /cases controller in the browser, I get
the following error:

Parse error: syntax error, unexpected T_CASE, expecting T_STRING in /
data/www/safepassagenm.com/htdocs/admin/app/models/case.php on line 3

There is no problem on line 3 of the case.php file that i can see.
This same system works fine locally on my machine.

The live server is running PHP Version 5.2.10-pl0-gentoo

Any ideas?
--~--~-~--~~~---~--~~
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: Upload a file using cakePHP

2009-11-09 Thread Miles J

You cannot do that if you do the upload model behavior, but you can
manually do it with the upload component.

On Nov 9, 2:31 pm, Ashu  wrote:
> Miles thanks for the link.
>
> Will I be able to upload a File(Bookmarks.xml) and parse the data as
> "Title","Url", from the file before I can upload my Bookmarks Model.
>
> On Nov 9, 9:34 am, Miles J  wrote:
>
> > My uploader plugin allows you to attach uploads to a model, so its
> > automatically done through a behavior.
>
> >http://www.milesj.me/resources/script/uploader-plugin#Attaching-Files...
>
> > On Nov 9, 9:03 am, Ashu  wrote:
>
> > > Hello guys,
>
> > > I have a model for Bookmarks, that a user can add/edit/delete from the
> > > web UI. Now, I want to add the functionality to be able to upload a
> > > file(bookmarks from FF, Chrome) that is in html format. I have see a
> > > couple of implementations/examples online for uploading a file.
>
> > > In my case, I would like to upload, parse and then populate my
> > > existing Bookmark model. What do you guys suggest ? Create a new
> > > upload model, or . i am looking for suggestion 
>
> > > Thanks
--~--~-~--~~~---~--~~
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: Upload a file using cakePHP

2009-11-09 Thread Ashu

Miles thanks for the link.

Will I be able to upload a File(Bookmarks.xml) and parse the data as
"Title","Url", from the file before I can upload my Bookmarks Model.

On Nov 9, 9:34 am, Miles J  wrote:
> My uploader plugin allows you to attach uploads to a model, so its
> automatically done through a behavior.
>
> http://www.milesj.me/resources/script/uploader-plugin#Attaching-Files...
>
> On Nov 9, 9:03 am, Ashu  wrote:
>
>
>
> > Hello guys,
>
> > I have a model for Bookmarks, that a user can add/edit/delete from the
> > web UI. Now, I want to add the functionality to be able to upload a
> > file(bookmarks from FF, Chrome) that is in html format. I have see a
> > couple of implementations/examples online for uploading a file.
>
> > In my case, I would like to upload, parse and then populate my
> > existing Bookmark model. What do you guys suggest ? Create a new
> > upload model, or . i am looking for suggestion 
>
> > Thanks
--~--~-~--~~~---~--~~
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: I think I've got a routing problem - welcome page is perfect but app is broken

2009-11-09 Thread Peter Bowen

Thanks but it didn't help. I'm desperate enough to start looking at
Code Igniter :(

On Nov 9, 3:21 pm, "Dr. Loboto"  wrote:
> Try add rewrite base to your webroot .htacces:
> RewriteBase /myproject
>
> On Nov 9, 3:43 am, Peter Bowen  wrote:
>
> > Hi,
>
> > I'm sure the routing is messed up somewhere and I'd appreciate some
> > help (8 hours of googling and experimenting and I'd be about ready to
> > tear my hair out if I wasn't already bald).
>
> > --setup--
> > I'm using Mac OSX with XAMPP for development. I've got the project in
> > a subdirectory on Xampp's webroot:
> > httpdocs/myproject/
>
> > I've enabled rewrite in httpd.conf:
> > LoadModule rewrite_module modules/mod_rewrite.so
>
> > I've set up an alias in httpd.conf:
> > Alias /quote-reminder /Applications/xampp/xamppfiles/htdocs/myproject/
> > app/webroot
> > 
> > AllowOverride All
> > Options All
> > Order allow,deny
> > Allow from all
> > 
>
> > I've got 3 .htaccess files each with:
> > 
> >     RewriteEngine on
> >     RewriteRule    ^$    webroot/    [L]
> >     RewriteRule    (.*) webroot/$1    [L]
> >  
>
> > I've baked my app and have model, controller and view files
>
> > --the problem--
> > I can see the pretty welcome screen (with the css) when I go to
> > localhost/myproject/
>
> > If I type in localhost/myproject/user or localhost/myproject/user
> > expecting to see something to do with my user model I get a 404
> > error.
>
> > If I type inhttp://localhost/myproject/index.php/usersgivesme a
> > list of users but without any css
>
> > --thanks--
> > I'd really appreciate some pointers. Even better would be someone who
> > lives near Portsmouth or on the Isle of Wight who would give me an
> > hour of their expertise in exchange for lunch
--~--~-~--~~~---~--~~
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: Creating own component

2009-11-09 Thread paulos nikolo
Ty you for your advice!!

2009/11/9 Miles J 

>
> Yes its fine, however I would just place all that code in one
> component.
>
> class ServiceCompositionEngineComponent extends Object {
>function startup();
>function getRespType($responseType,$text,$model,$mappings =
> array());
>function jsonParse($response,$model,$mappings = array());
>function xmlParse($response,$model,$mappings = array());
> }
>
> And it should be $xmlpsr, not var xmlpsr.
>
> On Nov 9, 12:07 pm, paulos nikolo  wrote:
> > I consider of that but i have built services which have some parameters
> and
> > mappings so i use a more effective way with paths.For example for a Xml
> data
> > type i use XPath to access children and for Json i use JPath.Of course
> there
> > are many ways to parse xml,json but i would like to ask if my approach is
> > ok.
> >
> > 2009/11/9 Miles J 
> >
> >
> >
> > > Why dont you just use json_encode/json_decode and the built in XML
> > > utility class?
> >
> > > On Nov 9, 2:08 am, Paulos23  wrote:
> > > > Hi people,
> > > > I am building my own component for my app needs and i am wondering if
> > > > my idea is right.My app consist of web services where the data may be
> > > > in XML or JSON format.So, i started creating a Component to parse
> > > > Xml,Json returned data using XPath (for Xml) and JPath (for Json).My
> > > > philosophy is that there is an astract class ResponseParser for
> > > > general types of returned data and then 2 sub-classes extends the
> > > > astract class using inheritance.These classes are XmlParser and
> > > > JsonParser.If the data is in Xml format a new object of XmlParser
> > > > class is created and so on.now i am wondering if my approach is
> > > > good.Here is my code:
> >
> > > >  > > > class ResponseParser {
> > > > function modelParse($text,$modelName,$mappings = array(),
> > > > $responseType) {
> >
> > > > }
> >
> > > > }
> >
> > > > //Using X-Path to implement XML parsing
> > > > class XmlParser extends ResponseParser {
> > > > var modelFields = array(array());
> >
> > > > function xmlParse($response,$model,$mappings = array()){
> > > > $xml = new SimpleXMLElement($response);
> > > > for ($j = 0; $j <
> > > sizeof($xml->xpath('/geonames/'.$model.''); $j +=
> > > > 1) {  // Loop to access all children
> > > > for ($i = 0; $i < sizeof($mappings); $i += 1)
> {
> > >  // Loop to
> > > > map each child
> > > > $modelField[$j][$i] =
> > > $xml->xpath(''.$mappings[0]['Composition']
> > > > [$i]['map'].'');
> > > > }
> > > > }
> > > > return($modelField);
> > > > }
> >
> > > > }
> >
> > > > //Using J-Path to implement JSON parsing
> > > > class JsonParser extends ResponseParser{
> > > > var modelFields = array(array());
> >
> > > > function jsonParse($response,$model,$mappings = array()){
> > > > var jp = new JPath($response);
> > > > for ($j = 0; $j <
> > > sizeof(jp.$('/geonames/'.$model.'').json); $j +=
> > > > 1) {// Loop to access all children
> > > > for ($i = 0; $i < sizeof($mappings); $i += 1)
> {
> > >   // Loop to
> > > > map each child
> > > > $modelField[$j][$i] =
> > > jp.$(''.$mappings[0]['Composition'][$i]
> > > > ['map'].'').json;
> > > > }
> > > > }
> > > > return($modelField);
> > > > }
> >
> > > > }
> >
> > > > class ServiceCompositionEngineComponent extends Object {
> >
> > > > function startup(&$controller) {
> > > > $this->controller =& $controller;
> > > > }
> >
> > > > function getRespType($responseType,$text,$model,$mappings =
> > > array()){
> > > > if ($responseType == 'XML'){
> > > > var xmlpsr = new
> xmlParse($text,$model,$mappings
> > > = array())
> > > > } else if($responseType == 'JSON'){
> > > > var jsonpsr = new
> > > jsonParse($text,$model,$mappings = array())
> > > > }
> >
> > > > }
> >
> > > > }
> >
> > > > ?>
> >
> > > > Any help would be nice!!
> >
>

--~--~-~--~~~---~--~~
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: Creating own component

2009-11-09 Thread Miles J

Yes its fine, however I would just place all that code in one
component.

class ServiceCompositionEngineComponent extends Object {
function startup();
function getRespType($responseType,$text,$model,$mappings = array());
function jsonParse($response,$model,$mappings = array());
function xmlParse($response,$model,$mappings = array());
}

And it should be $xmlpsr, not var xmlpsr.

On Nov 9, 12:07 pm, paulos nikolo  wrote:
> I consider of that but i have built services which have some parameters and
> mappings so i use a more effective way with paths.For example for a Xml data
> type i use XPath to access children and for Json i use JPath.Of course there
> are many ways to parse xml,json but i would like to ask if my approach is
> ok.
>
> 2009/11/9 Miles J 
>
>
>
> > Why dont you just use json_encode/json_decode and the built in XML
> > utility class?
>
> > On Nov 9, 2:08 am, Paulos23  wrote:
> > > Hi people,
> > > I am building my own component for my app needs and i am wondering if
> > > my idea is right.My app consist of web services where the data may be
> > > in XML or JSON format.So, i started creating a Component to parse
> > > Xml,Json returned data using XPath (for Xml) and JPath (for Json).My
> > > philosophy is that there is an astract class ResponseParser for
> > > general types of returned data and then 2 sub-classes extends the
> > > astract class using inheritance.These classes are XmlParser and
> > > JsonParser.If the data is in Xml format a new object of XmlParser
> > > class is created and so on.now i am wondering if my approach is
> > > good.Here is my code:
>
> > >  > > class ResponseParser {
> > >         function modelParse($text,$modelName,$mappings = array(),
> > > $responseType) {
>
> > >         }
>
> > > }
>
> > > //Using X-Path to implement XML parsing
> > > class XmlParser extends ResponseParser {
> > >         var modelFields = array(array());
>
> > >         function xmlParse($response,$model,$mappings = array()){
> > >                 $xml = new SimpleXMLElement($response);
> > >                 for ($j = 0; $j <
> > sizeof($xml->xpath('/geonames/'.$model.''); $j +=
> > > 1) {  // Loop to access all children
> > >                         for ($i = 0; $i < sizeof($mappings); $i += 1) {
> >                                              // Loop to
> > > map each child
> > >                                 $modelField[$j][$i] =
> > $xml->xpath(''.$mappings[0]['Composition']
> > > [$i]['map'].'');
> > >                         }
> > >                 }
> > >                 return($modelField);
> > >         }
>
> > > }
>
> > > //Using J-Path to implement JSON parsing
> > > class JsonParser extends ResponseParser{
> > >         var modelFields = array(array());
>
> > >         function jsonParse($response,$model,$mappings = array()){
> > >                 var jp = new JPath($response);
> > >                 for ($j = 0; $j <
> > sizeof(jp.$('/geonames/'.$model.'').json); $j +=
> > > 1) {    // Loop to access all children
> > >                         for ($i = 0; $i < sizeof($mappings); $i += 1) {
> >                                               // Loop to
> > > map each child
> > >                                 $modelField[$j][$i] =
> > jp.$(''.$mappings[0]['Composition'][$i]
> > > ['map'].'').json;
> > >                         }
> > >                 }
> > >                 return($modelField);
> > >         }
>
> > > }
>
> > > class ServiceCompositionEngineComponent extends Object {
>
> > >         function startup(&$controller) {
> > >                 $this->controller =& $controller;
> > >         }
>
> > >         function getRespType($responseType,$text,$model,$mappings =
> > array()){
> > >                 if ($responseType == 'XML'){
> > >                         var xmlpsr = new xmlParse($text,$model,$mappings
> > = array())
> > >                 } else if($responseType == 'JSON'){
> > >                         var jsonpsr = new
> > jsonParse($text,$model,$mappings = array())
> > >                 }
>
> > >         }
>
> > > }
>
> > > ?>
>
> > > Any help would be nice!!
--~--~-~--~~~---~--~~
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: Creating own component

2009-11-09 Thread paulos nikolo
I consider of that but i have built services which have some parameters and
mappings so i use a more effective way with paths.For example for a Xml data
type i use XPath to access children and for Json i use JPath.Of course there
are many ways to parse xml,json but i would like to ask if my approach is
ok.

2009/11/9 Miles J 

>
> Why dont you just use json_encode/json_decode and the built in XML
> utility class?
>
> On Nov 9, 2:08 am, Paulos23  wrote:
> > Hi people,
> > I am building my own component for my app needs and i am wondering if
> > my idea is right.My app consist of web services where the data may be
> > in XML or JSON format.So, i started creating a Component to parse
> > Xml,Json returned data using XPath (for Xml) and JPath (for Json).My
> > philosophy is that there is an astract class ResponseParser for
> > general types of returned data and then 2 sub-classes extends the
> > astract class using inheritance.These classes are XmlParser and
> > JsonParser.If the data is in Xml format a new object of XmlParser
> > class is created and so on.now i am wondering if my approach is
> > good.Here is my code:
> >
> >  > class ResponseParser {
> > function modelParse($text,$modelName,$mappings = array(),
> > $responseType) {
> >
> > }
> >
> > }
> >
> > //Using X-Path to implement XML parsing
> > class XmlParser extends ResponseParser {
> > var modelFields = array(array());
> >
> > function xmlParse($response,$model,$mappings = array()){
> > $xml = new SimpleXMLElement($response);
> > for ($j = 0; $j <
> sizeof($xml->xpath('/geonames/'.$model.''); $j +=
> > 1) {  // Loop to access all children
> > for ($i = 0; $i < sizeof($mappings); $i += 1) {
>  // Loop to
> > map each child
> > $modelField[$j][$i] =
> $xml->xpath(''.$mappings[0]['Composition']
> > [$i]['map'].'');
> > }
> > }
> > return($modelField);
> > }
> >
> > }
> >
> > //Using J-Path to implement JSON parsing
> > class JsonParser extends ResponseParser{
> > var modelFields = array(array());
> >
> > function jsonParse($response,$model,$mappings = array()){
> > var jp = new JPath($response);
> > for ($j = 0; $j <
> sizeof(jp.$('/geonames/'.$model.'').json); $j +=
> > 1) {// Loop to access all children
> > for ($i = 0; $i < sizeof($mappings); $i += 1) {
>   // Loop to
> > map each child
> > $modelField[$j][$i] =
> jp.$(''.$mappings[0]['Composition'][$i]
> > ['map'].'').json;
> > }
> > }
> > return($modelField);
> > }
> >
> > }
> >
> > class ServiceCompositionEngineComponent extends Object {
> >
> > function startup(&$controller) {
> > $this->controller =& $controller;
> > }
> >
> > function getRespType($responseType,$text,$model,$mappings =
> array()){
> > if ($responseType == 'XML'){
> > var xmlpsr = new xmlParse($text,$model,$mappings
> = array())
> > } else if($responseType == 'JSON'){
> > var jsonpsr = new
> jsonParse($text,$model,$mappings = array())
> > }
> >
> > }
> >
> > }
> >
> > ?>
> >
> > Any help would be nice!!
> >
>

--~--~-~--~~~---~--~~
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: cake and jpGraph

2009-11-09 Thread BrendonKoz

Here's how I included my ezComponent ezGraph class, so the same idea
should relate:

$found = App::import('Vendor', 'ezComponents', array('file' =>
'Base'.DS.'src'.DS.'ezc_bootstrap.php'));
$found = $found ? 'true' : 'false';
if(!$found) die('Unable to load required ezComponent bootstrap
file.');

I ended up having to use the array parameter to get my class included,
and then used the Directory Separate constant instead of a forward
slash.
Note: "ezComponents" is still the first directory found in the vendors
folder...so it would be ".../app/vendors/ezcomponents/Base/src/
ezc_bootstrap.php"

Hopefully that'll give you a head start, and a nice supplement to the
Cookbook examples.

On Nov 9, 2:18 am, jktress  wrote:
> Hi everyone,
>
> I'm building a simple graphing tool that pulls data from my database
> and creates a line chart. I'm trying to use the jgraph library,
> however after putting it in my vendors folder and calling it from the
> view, I get Fatal Error: Class Graph not found.
>
> I am accessing the jpgraph folder this way
>  App::import('Vendors', 'jpgraph/jpgraph');
>  App::import('Vendors', 'jpgraph/jpgraph_line');
>
> and I've tried several variations on that, thinking that the library
> isn't loading. Can you point me in the right direction as to what's
> going on?
>
> Thanks!
--~--~-~--~~~---~--~~
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: exit() function

2009-11-09 Thread Miles J

No, you will have to remove the exit, or place a return in the action.

On Nov 9, 11:11 am, lee  wrote:
> Hello,
>
> I am trying to test some actions in controller with CakePHP test
> framework. But some actions contain exit() function not to render. If
> you call that action from framework. It will kill the process, and
> test cannot go further. Is there any work around for this problem?
>
> thank ahead,
> J.J
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



exit() function

2009-11-09 Thread lee

Hello,

I am trying to test some actions in controller with CakePHP test
framework. But some actions contain exit() function not to render. If
you call that action from framework. It will kill the process, and
test cannot go further. Is there any work around for this problem?

thank ahead,
J.J

--~--~-~--~~~---~--~~
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: cake bake error

2009-11-09 Thread rymo

While you're in a console make sure you're in main cake directory. Not
cake/cake. It was my problem...going one step up solved it.

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



Edit form attempting INSERT INTO statement and fails

2009-11-09 Thread dpinion

Greetings,
I am a bit new to cake, and am diving in via the cookbook. I have a
simple app I am trying to develop, and am modifying the cookbook
example to fit it. So far everything has worked great with one
exception. I have an edit form that when I go to it it fills in with
the DB data from the record previously selected (on the index page).
However, once I change any information and try to submit it, I receive
the following:

SQL Error: 1062: Duplicate entry '1' for key 1 [CORE/cake/libs/model/
datasources/dbo_source.php

The query string tells me that the form is attempting to perform an
INSERT Into instead of an UPDATE command on the database, causing the
failure. I am not sure why it is doing this... Here is my edit.ctp
content:

Edit Comment

   create('Comment', array('action' => 'edit'));
   echo $form->input('name'); //text
   echo $form->input('com_date'); //day, month, year, hour, minute,
meridian
   echo $form->input('comment', array('rows' => '3'));
   echo $form->input('ID', array('type' => 'hidden'));
   echo $form->end('Update Information');
   ?>

and here is the edit section from the controller:

function edit($id = null) {
$this->Comment->id = $id;
   if (empty($this->data))
   {
   $this->data = $this->Comment->read();
   }
   else
   {
   if($this->Comment->save($this->data))
   {
$this->Session->setFlash('Your comment has been updated.
','/comments/');
   }
   }
}

any suggestions as to what I am doing wrong?

Thanks!

--~--~-~--~~~---~--~~
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: Drop down assocations

2009-11-09 Thread supergee...@gmail.com

Thanks! That worked like a charm.

On Nov 7, 11:31 am, Robert P  wrote:
> Have another review of the concept of normalising, then 
> readhttp://book.cakephp.org/view/81/belongsTo
>
> You have normalised your tables to a HABTM relationship, when what you
> seem to be after is a hasMany/belongsTo relationship.
>     Post belongsTo Category
>     Category hasMany Post
>
> When that is done, the dropdown can be automatically generated for you
> in your Post views using:
>     input('Category'); ?>
>
> On Nov 7, 6:52 am, "supergee...@gmail.com" 
> wrote:
>
>
>
> > I'm new to cakePhp (and database design...I've been lazy over the
> > years and want to learn the "right" way to do things) and have a
> > question about saving the contents of a form that has a drop down
> > field.
>
> > Here are the tables that I have setup in my database:
>
> > Table 1: posts (contains id,title,description)
>
> > Table 2: categories (contains id,category_name)
>
> > Table 3: categories_posts (contains 2 foreign keys:
> > category_id,post_id)
>
> > I have 3 fields in the form I'm building
>
> > Field 1 (Category): Drop down field containing a list of categories.
> > The category id is the value and the category name is shown on the
> > drop down.
>
> > Field 2 (Title): text field
>
> > Field 3 (Description): textarea field
>
> > I'm having trouble figuring out how to save the Title and Description
> > fields to one database table, and save the category id and post id to
> > an assocation table, called categories_posts.
>
> > I have tried everything I can find an example of, and nothing has
> > seemed to work. I'm also not really sure if I need to use the save or
> > saveAll method.
>
> > In the past, I would have just saved the category name to the post
> > data table and been done with it, but I would like to at least attempt
> > to normalize my database (which is really foreign to me at this
> > point...I understand the basic idea but that's about it at this
> > point).
>
> > Can someone please point me in the right direction? If I need to
> > further explain myself, please let me know. Thank you.
--~--~-~--~~~---~--~~
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: Creating own component

2009-11-09 Thread Miles J

Why dont you just use json_encode/json_decode and the built in XML
utility class?

On Nov 9, 2:08 am, Paulos23  wrote:
> Hi people,
> I am building my own component for my app needs and i am wondering if
> my idea is right.My app consist of web services where the data may be
> in XML or JSON format.So, i started creating a Component to parse
> Xml,Json returned data using XPath (for Xml) and JPath (for Json).My
> philosophy is that there is an astract class ResponseParser for
> general types of returned data and then 2 sub-classes extends the
> astract class using inheritance.These classes are XmlParser and
> JsonParser.If the data is in Xml format a new object of XmlParser
> class is created and so on.now i am wondering if my approach is
> good.Here is my code:
>
>  class ResponseParser {
>         function modelParse($text,$modelName,$mappings = array(),
> $responseType) {
>
>         }
>
> }
>
> //Using X-Path to implement XML parsing
> class XmlParser extends ResponseParser {
>         var modelFields = array(array());
>
>         function xmlParse($response,$model,$mappings = array()){
>                 $xml = new SimpleXMLElement($response);
>                 for ($j = 0; $j < sizeof($xml->xpath('/geonames/'.$model.''); 
> $j +=
> 1) {  // Loop to access all children
>                         for ($i = 0; $i < sizeof($mappings); $i += 1) {       
>                                          // Loop to
> map each child
>                                 $modelField[$j][$i] = 
> $xml->xpath(''.$mappings[0]['Composition']
> [$i]['map'].'');
>                         }
>                 }
>                 return($modelField);
>         }
>
> }
>
> //Using J-Path to implement JSON parsing
> class JsonParser extends ResponseParser{
>         var modelFields = array(array());
>
>         function jsonParse($response,$model,$mappings = array()){
>                 var jp = new JPath($response);
>                 for ($j = 0; $j < sizeof(jp.$('/geonames/'.$model.'').json); 
> $j +=
> 1) {    // Loop to access all children
>                         for ($i = 0; $i < sizeof($mappings); $i += 1) {       
>                                           // Loop to
> map each child
>                                 $modelField[$j][$i] = 
> jp.$(''.$mappings[0]['Composition'][$i]
> ['map'].'').json;
>                         }
>                 }
>                 return($modelField);
>         }
>
> }
>
> class ServiceCompositionEngineComponent extends Object {
>
>         function startup(&$controller) {
>                 $this->controller =& $controller;
>         }
>
>         function getRespType($responseType,$text,$model,$mappings = array()){
>                 if ($responseType == 'XML'){
>                         var xmlpsr = new xmlParse($text,$model,$mappings = 
> array())
>                 } else if($responseType == 'JSON'){
>                         var jsonpsr = new jsonParse($text,$model,$mappings = 
> array())
>                 }
>
>         }
>
> }
>
> ?>
>
> Any help would be nice!!
--~--~-~--~~~---~--~~
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: Upload a file using cakePHP

2009-11-09 Thread Miles J

My uploader plugin allows you to attach uploads to a model, so its
automatically done through a behavior.

http://www.milesj.me/resources/script/uploader-plugin#Attaching-Files-To-Models-Auto-Upload

On Nov 9, 9:03 am, Ashu  wrote:
> Hello guys,
>
> I have a model for Bookmarks, that a user can add/edit/delete from the
> web UI. Now, I want to add the functionality to be able to upload a
> file(bookmarks from FF, Chrome) that is in html format. I have see a
> couple of implementations/examples online for uploading a file.
>
> In my case, I would like to upload, parse and then populate my
> existing Bookmark model. What do you guys suggest ? Create a new
> upload model, or . i am looking for suggestion 
>
> Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Upload a file using cakePHP

2009-11-09 Thread Ashu

Hello guys,

I have a model for Bookmarks, that a user can add/edit/delete from the
web UI. Now, I want to add the functionality to be able to upload a
file(bookmarks from FF, Chrome) that is in html format. I have see a
couple of implementations/examples online for uploading a file.

In my case, I would like to upload, parse and then populate my
existing Bookmark model. What do you guys suggest ? Create a new
upload model, or . i am looking for suggestion 


Thanks
--~--~-~--~~~---~--~~
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: Drop down assocations

2009-11-09 Thread supergee...@gmail.com

Thanks. I'll try that.

On Nov 7, 11:31 am, Robert P  wrote:
> Have another review of the concept of normalising, then 
> readhttp://book.cakephp.org/view/81/belongsTo
>
> You have normalised your tables to a HABTM relationship, when what you
> seem to be after is a hasMany/belongsTo relationship.
>     Post belongsTo Category
>     Category hasMany Post
>
> When that is done, the dropdown can be automatically generated for you
> in your Post views using:
>     input('Category'); ?>
>
> On Nov 7, 6:52 am, "supergee...@gmail.com" 
> wrote:
>
>
>
> > I'm new to cakePhp (and database design...I've been lazy over the
> > years and want to learn the "right" way to do things) and have a
> > question about saving the contents of a form that has a drop down
> > field.
>
> > Here are the tables that I have setup in my database:
>
> > Table 1: posts (contains id,title,description)
>
> > Table 2: categories (contains id,category_name)
>
> > Table 3: categories_posts (contains 2 foreign keys:
> > category_id,post_id)
>
> > I have 3 fields in the form I'm building
>
> > Field 1 (Category): Drop down field containing a list of categories.
> > The category id is the value and the category name is shown on the
> > drop down.
>
> > Field 2 (Title): text field
>
> > Field 3 (Description): textarea field
>
> > I'm having trouble figuring out how to save the Title and Description
> > fields to one database table, and save the category id and post id to
> > an assocation table, called categories_posts.
>
> > I have tried everything I can find an example of, and nothing has
> > seemed to work. I'm also not really sure if I need to use the save or
> > saveAll method.
>
> > In the past, I would have just saved the category name to the post
> > data table and been done with it, but I would like to at least attempt
> > to normalize my database (which is really foreign to me at this
> > point...I understand the basic idea but that's about it at this
> > point).
>
> > Can someone please point me in the right direction? If I need to
> > further explain myself, please let me know. Thank you.
--~--~-~--~~~---~--~~
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: Tree reorder tweaking

2009-11-09 Thread MonkeyGirl

OK, so using $this->Category->reorder(); reorders all the children of
a given category (in this example), and their children, and so on, but
is there any way to reorder _all_ the categories, including the top
level ones?

I see now the point about my code not doing anything more than the
original CakePHP code, as either way, nothing's reorganising the top
level categories.  Either I'm missing something or that functionality
simply isn't available, is that right?

It's good to know that it's recursive though, that's great.

Thanks,
Zoe.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Router for files (eg.pdf_

2009-11-09 Thread kicaj

How build router for i18n files?

I try:
Router::connect('/:files/*', '/files', array('files'=>'files|pliki'));
but doesn't work:/
/files/product_name.pdf for english
/pliki/product_name.pdf for polish

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



Helpers and AJAX request

2009-11-09 Thread Amit

The general question is - Is there a way to access Helpers during an
AJAX response?

I have a form that contains a dropdown and a group of radio buttons.
When a new item is selected from the dropdown, an XMLHTTPRequest is
sent to the server to get the new collection of radio buttons.

Right now, my controller determines if its an AJAX request, queries
for the list of items, manually generates the HTML for the radio
buttons, and sends the response. I know that the View layer offers a
FormHelper to "automagically" create the form element ($form->radio
()), is there anything similar available when creating an AJAX
response?
--~--~-~--~~~---~--~~
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: I think I've got a routing problem - welcome page is perfect but app is broken

2009-11-09 Thread Dr. Loboto

Try add rewrite base to your webroot .htacces:
RewriteBase /myproject

On Nov 9, 3:43 am, Peter Bowen  wrote:
> Hi,
>
> I'm sure the routing is messed up somewhere and I'd appreciate some
> help (8 hours of googling and experimenting and I'd be about ready to
> tear my hair out if I wasn't already bald).
>
> --setup--
> I'm using Mac OSX with XAMPP for development. I've got the project in
> a subdirectory on Xampp's webroot:
> httpdocs/myproject/
>
> I've enabled rewrite in httpd.conf:
> LoadModule rewrite_module modules/mod_rewrite.so
>
> I've set up an alias in httpd.conf:
> Alias /quote-reminder /Applications/xampp/xamppfiles/htdocs/myproject/
> app/webroot
> 
> AllowOverride All
> Options All
> Order allow,deny
> Allow from all
> 
>
> I've got 3 .htaccess files each with:
> 
>     RewriteEngine on
>     RewriteRule    ^$    webroot/    [L]
>     RewriteRule    (.*) webroot/$1    [L]
>  
>
> I've baked my app and have model, controller and view files
>
> --the problem--
> I can see the pretty welcome screen (with the css) when I go to
> localhost/myproject/
>
> If I type in localhost/myproject/user or localhost/myproject/user
> expecting to see something to do with my user model I get a 404
> error.
>
> If I type inhttp://localhost/myproject/index.php/usersgives me a
> list of users but without any css
>
> --thanks--
> I'd really appreciate some pointers. Even better would be someone who
> lives near Portsmouth or on the Isle of Wight who would give me an
> hour of their expertise in exchange for lunch
--~--~-~--~~~---~--~~
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 and when to use the root vendor folder

2009-11-09 Thread jsundquist

I'm seeking some advice. I have three sites that are with in one root
folder that share some css, javascript, and images. I would like to be
able to maintain all three items with in the root vendor folder but I
am not exactly sure on how to go about doing it. Do I just drop each
item into their respected folder instead of in the webroot folder and
they will be found? There isn't much documentation on how this works
with in the cakephp documents so I am hoping someone here might have a
good idea.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Bug on my AROS... :(

2009-11-09 Thread Xanax

Hello,

I don't understand my bug.

I've created a "parent_node" function on my user model that return a
role_id.
Every user have a role. When i create a new user, it create also an
ARO associated with the proper role.

The problem is that EVERY user is registred as ADMIN role. Whereas
when i verify what return "parent_node" , it returns the good value
i.e. the actual role that i've given to the user...

Do you know what can be the problem please ?

Thanks in advande for any help because i really don't figured out
what's the point with that.

--~--~-~--~~~---~--~~
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: Send model data to Saleforce using API

2009-11-09 Thread vinod_una_HP

Hey LL2,
Have you got solution to your problem. I have my problem similar to
this. Please let me know if you find any solution to this.
cheers
vinod

On Sep 18, 3:15 pm, LL2  wrote:
> Hi All,
>
> A beginners question I think but hopefully someone can help me and
> confirm my thoughts.
>
> We have 2 models, user and org, which map very nicely on to the 2
> salesforce objects contact and account respectively.
>
> All org data is sent to salesforce (uploaded) to an account object, to
> note this is only one way, only ever upload, not download. So I store
> the salesforce id on the org object and our own org id on the
> salesforce account object, both as unique foreign keys. Its near
> enough the same for users except not all users get sync'd - only those
> that meet certain criteria or are selected by admin users in the
> application.
>
> So the question I have really is how do I implement this in CakePHP?
>
> My inclination is to do something with the Model classes so that the
> data sending is always done? Question is whether to just add it as a
> postSave function?? or whether to create some sort of behaviour that I
> can add to each Model class??
>
> Also should I set up Salesforce as another datasource? Seems to me a
> bit like one bit cant figure out how this fits in
>
> What do people think?? Any best practice advice much appreciated
>
> Cheers
>
> LL2

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



cake and jpGraph

2009-11-09 Thread jktress

Hi everyone,

I'm building a simple graphing tool that pulls data from my database
and creates a line chart. I'm trying to use the jgraph library,
however after putting it in my vendors folder and calling it from the
view, I get Fatal Error: Class Graph not found.

I am accessing the jpgraph folder this way
 App::import('Vendors', 'jpgraph/jpgraph');
 App::import('Vendors', 'jpgraph/jpgraph_line');

and I've tried several variations on that, thinking that the library
isn't loading. Can you point me in the right direction as to what's
going on?

Thanks!


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



404 error on remote server

2009-11-09 Thread Naresh Kumar

Hi,

I've been playing with Cake on my local machine and wanted to check
that it works on my host's servers.  When I uploaded Cake and tried to
view the main page, I got an Apache index page listing the directories
(app/ and cake/).  The hosts insist that mod_rewrite is enabled.  When
I try to access any controller function I get a 404 not found error.

Can anyone help me?

Thanks a lot

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



building cakephp via online

2009-11-09 Thread ancurit

where I'am run command line "cake bake" via online or webhosting?
I'm use xtreemhost.com
please help me.. thx

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

2009-11-09 Thread Amit Rawat
How are you calculating your current time by database query or by php date
function?

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



time out while uploading to database

2009-11-09 Thread hunny

Hi Guys,

While uploading database with records from a very large file, I am
getting the following timeout error:

Maximum execution time of 30 seconds exceeded in cake/libs/model/
model.php on line 776.

Could anyone please guide me on where to set this time out variable?

Thanks in Advance,
Hunny.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



date

2009-11-09 Thread Simon

hii,
In my project date is in dropdownlist. It shows current date. And in
next dropdownlist it should be display as +15days from current date.
Please give me a solution .

regards,
   simon
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Creating own component

2009-11-09 Thread Paulos23

Hi people,
I am building my own component for my app needs and i am wondering if
my idea is right.My app consist of web services where the data may be
in XML or JSON format.So, i started creating a Component to parse
Xml,Json returned data using XPath (for Xml) and JPath (for Json).My
philosophy is that there is an astract class ResponseParser for
general types of returned data and then 2 sub-classes extends the
astract class using inheritance.These classes are XmlParser and
JsonParser.If the data is in Xml format a new object of XmlParser
class is created and so on.now i am wondering if my approach is
good.Here is my code:

xpath('/geonames/'.$model.''); 
$j +=
1) {  // Loop to access all children
for ($i = 0; $i < sizeof($mappings); $i += 1) { 
  // Loop to
map each child
$modelField[$j][$i] = 
$xml->xpath(''.$mappings[0]['Composition']
[$i]['map'].'');
}
}
return($modelField);
}
}

//Using J-Path to implement JSON parsing
class JsonParser extends ResponseParser{
var modelFields = array(array());

function jsonParse($response,$model,$mappings = array()){
var jp = new JPath($response);
for ($j = 0; $j < sizeof(jp.$('/geonames/'.$model.'').json); $j 
+=
1) {// Loop to access all children
for ($i = 0; $i < sizeof($mappings); $i += 1) { 
   // Loop to
map each child
$modelField[$j][$i] = 
jp.$(''.$mappings[0]['Composition'][$i]
['map'].'').json;
}
}
return($modelField);
}
}

class ServiceCompositionEngineComponent extends Object {

function startup(&$controller) {
$this->controller =& $controller;
}

function getRespType($responseType,$text,$model,$mappings = array()){
if ($responseType == 'XML'){
var xmlpsr = new xmlParse($text,$model,$mappings = 
array())
} else if($responseType == 'JSON'){
var jsonpsr = new jsonParse($text,$model,$mappings = 
array())
}

}


}

?>


Any help would be nice!!
--~--~-~--~~~---~--~~
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: setting displayField to a custom field

2009-11-09 Thread Grzegorz Pawlik

Shouldn't be in afterFind? When data grabbed from DB, You iterate
throug them and add do sth like this
$this->data[$n]['User']['whole_name'] = $this->data[$n]['User']
['name'] . " " . $this->data[$n]['User']['last_name'];

right?


On Nov 6, 7:12 pm, David Roda  wrote:
> Thanks euromark.
>
> what type of logic would I be performing in beforeFind() to accomplish this
> goal?
>
> On Fri, Nov 6, 2009 at 6:01 AM, euromark (munich) <
>
> dereurom...@googlemail.com> wrote:
>
> > there are behaviours for that (multiple_display_field)
> > or you do it manually by using "beforeFind()" in your model
>
> > On 5 Nov., 23:22, Dave  wrote:
> > > Hi fellow CakePHP enthusiasts.
>
> > > I have a problem which I'm sure is probably pretty simple but I am not
> > > sure how to do it.
>
> > > I have a standard Users table with first name, last name, etc.
>
> > > What I would like to do is set the displayField of the Users model to
> > > a concatenation of first_name . " " . last_name
>
> > > Now I am thinking that I can accomplish this by creating a custom
> > > field in my model which concatenates these two fields, and set the
> > > displayField to this, but I am not sure how to go about creating the
> > > custom field.
>
> > > Thanks in advance for any help!  I really appreciate it.
>
> > > David Roda
--~--~-~--~~~---~--~~
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: Install / Update huge application.

2009-11-09 Thread Walther

Database Schemas would be a good start to read up on (In the book
somewhere).

Online updating of files is dangerous and requires your users to lower
their security settings (Never a good idea). It would be better giving
them a link to download a zip file and detailed instructions on how to
upload it to their website.

On Nov 8, 7:54 am, adaa  wrote:
> I'm gonna make a huge application using CakePHP. This application will
> have an automated installation page (users won't setup the database
> tables manually). On the installation page user(admin) will provide
> database info and click install, the application will setup the
> database on server and required settings in a config file.
>
> Also after some days when I update the application I'll provide an
> update page and user (admin) can update the application. The update
> process will be online. The script will search online for update and
> notify admin that an update is available (like wordpress). The admin
> will then simply click update and the application will get updated..
>
> Now my question is what is the "conversion" in CakaPHP for such
> purposes ? Is there any short-cut "cakephp way" to do this ? I'm a
> novice in cakePHP. So pls help me.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---