Re: How to pass variables via GET method?

2007-02-17 Thread Sergei

"url"  => "/books/lister/?id=1&display=" . $mydisplay,

see the difference?


On 18 фев, 04:53, "skyblueink" <[EMAIL PROTECTED]> wrote:
> 'url'  => '/books/lister/?id=1&display=$mydisplay',


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



1.2 validation - This field cannot be left blank

2007-02-17 Thread gobblez

Hello, in the latest 1.2 SVN,  I can't get validation to work.  Well,
it is working, the empty fields are being flagged as they should be
for not meeting cake's regex constants, but my tagErrorMsg definitions
aren't spitting out their messages.

I did a search, and found it on line 1685 of model.php  What I did, is
changed 'This field cannot be left blank' to '1'.  It works now, but
I'm thinking maybe tagErrorMsg is used differently now.

Here is an example of how I've been using it, and it works when a
flagged field is set to '1' instead of that 'this field cannot..."
sentence.

echo $html->tagErrorMsg('User/username', 'Please
enter a username.');


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



Re: Bake closes too fast to read error.

2007-02-17 Thread gobblez

Thanks for the help guys.  This helped!

On Feb 6, 3:21 pm, "NOSLOW" <[EMAIL PROTECTED]> wrote:
> I've setup a couple of command files on my WinXP machine so that I can
> click on a Cake icon in my Quicklaunch toolbar and have a bake window
> display that runs in an endless loop. This makes it real easy to bake
> several files in succession. Here's what I did:
>
> 1. Create first file, C:\GoBake.cmd with just one line of code:
>
> cmd /k c:\bake.cmd
>
> 2. Create second file, C:\bake.cmd with the following lines of code:
>
> C:
> cd C:\[path_to_cake]
> echo on
> :bake
> php cake\scripts\bake.php -app app
> GOTO :bake
>
> 3. Create a shortcut to the first file, then change it's icon (via
> it's properties window) to be the favicon.ico distributed with Cake.
> 4. Copy shortcut to Quicklaunch bar, desktop or where ever.
> 5. Bake away!
>
> When you're done baking, just close the window.  Hope this helps!
>
> NOSLOW


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



Jake 1.0.3b Released (Joomla-CakePHP bridge)

2007-02-17 Thread Mariano Iglesias

I'm very pleased to announce that the first beta version of Jake 1.0.3 has
been released. It is the first package released to the public, and allows
you to run any number of CakePHP applications inside your Joomla website,
without having to touch your existing code. 

A lot has been covered and added since the alpha versions, so the best thing
you can do is read the documentation to find out more about this release.
Enjoy!

Project home page: http://dev.sypad.com/projects/jake

Documentation: http://dev.sypad.com/projects/jake/documentation/

Download: http://cakeforge.org/frs/?group_id=131

-MI


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



Re: Association Problem

2007-02-17 Thread strykstaguy

sweet, THANK YOU! :)

On Feb 17, 6:59 pm, "Grant Cox" <[EMAIL PROTECTED]> wrote:
> Change your Intinerary's Event association to
>
> var $hasMany = array('Event' => array('className'=> 'Event') );
>
> in your itineraries/view action, have something like
>
> function view($id) {
> $this->Itinerary->recursive = 1;
> $itinerary = $this->Itinerary->read(null, $id);
> $this->set('itinerary', $itinerary);
>
> }
>
> and in your view, do a print_r($itinerary) to see how the associations
> come through in your data array.
>
> Or, just bake the whole lot - it can make all your models, controllers
> and views, just make sure you tell it the right associations.
>
> On Feb 17, 11:26 am, "strykstaguy" <[EMAIL PROTECTED]> wrote:
>
>
>
> > I have tried to read the manual and look at examples but I am having a
> > hard time with associations.
>
> > For one, I have a three tables. Trips, Itineraries, Events
>
> > Each has one Itinerary, Each Itinerary has many events.
>
> > What i really want right now is to connect my Itineraries to Events,
> > Currently when i display my itineraries it repeats them 6 times
> > instead of twice (the number of itineraries i have right now). I want
> > once i select an itinerary is to view the events that match that
> > itinerary.
>
> > itinerary.php
> > ***
> > 
> > class Itinerary extends AppModel
> > {
> > Var $name = 'Itinerary';
> > var $hasOne = array('Event' =>
> > array('className'=> 'Event',
> >   'conditions'   => '',
> >   'order'=> '',
> >   'dependent'=>  false,
> >   'foreignKey'   => 'itinerary_id'
> > )
> > );
> > var $validate = array(
>
> > 'title'  => VALID_NOT_EMPTY,
> > 'creator'   => VALID_NOT_EMPTY,
> > 'when'   => VALID_NOT_EMPTY
>
> > );
>
> > }
>
> > ?>
> > ***
> > events.php
>
> > **
> > 
> > class Event extends AppModel
> > {
> > Var $name = 'Event';
> > var $belongsTo = array('Itinerary' =>
> >array('className'  => 'Itinerary',
> >  'conditions' => '',
> >  'order'  => '',
> >  'foreignKey' => 'itinerary_id'
> >)
> > );
> > var $validate = array(
>
> > 'what'  => VALID_NOT_EMPTY,
> > 'where'   => VALID_NOT_EMPTY,
> > 'andwhen'   => VALID_NOT_EMPTY
>
> > );
>
> > }
>
> > ?>
>
> > *
>
> > What it all comes down to is I know how to connect them with HasMany
> > and BelongsTo but i don't know how to actually display the events info
> > in the 'View' of my itineraries.
>
> > Any Help?- Hide quoted text -
>
> - Show quoted text -


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



SOLVED. Re: Validation problem with multiple select boxes

2007-02-17 Thread Norman

Well, I got it. Mea maxima culpa.
In the controller, I was setting the select[Model] array with only one
index. Instead of:

if(empty($this->data['Model']['Model'])) { $this->data['Model']
['Model'] = null; }
$this->set('selectedModels', $this->data['Model']['Model']);

I was trying:

if(empty($this->data['Model'])) { $this->data['Model'] = null; }
$this->set('selectedAreas', $this->data['Model']);

This was bombing out at the _selectedArray method of the controller
class. After some hours scattering var_dumps here and there, the
problem became obvious. Hope with time and experience I start to get
these kind of stupid mistakes faster. Or avoid them.
Norman

On 16 fev, 20:36, "Norman" <[EMAIL PROTECTED]> wrote:
> Forget about my previous post, and my sincere apologies to Evan Sagge,
> his fine piece of code have no connection with my misery. I "baked"
> from ground up the models, controllers and views for the tables
> involved and the vanilla CakePHP validation is presenting the same
> behavior with multiple select listboxes. If any field does not
> validate, the multiple selects loose their selected options.
>
> Norman
>
> On 16 fev, 20:06, "Norman" <[EMAIL PROTECTED]> wrote:
>
> > One thing I am sure about: This problem is not related with the
> > "vanilla" CakePHP 1.1 validation. Im using "Evan's CakePHP Validation
> > Technique 2.0" (http://blog.evansagge.com/2006/12/28/evans-cakephp-
> > validation-technique-20/) and Im pretty sure theres a bug at the
> > validation class causing this behavior with multiple select boxes. But
> > I was not able to find it.
>
> > Norman
>
> > On 16 fev, 12:34, "Norman" <[EMAIL PROTECTED]> wrote:
>
> > > I have some views for a model with a mix of fields, two of these


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



Re: problem with validation

2007-02-17 Thread Grant Cox

Well, if you don't do anything to remove it, the submitted form data
($this->data in your controller) will still be there when the form is
displayed with validation errors.  Which means the Project Name input
field should be prepopulated with what the user just submitted.

If you just want to get this value into your actual validation error
message, then just have something like this in your view


label('Project/name', 'Project Name');?>
input('Project/name', array('size' => '60'));?>
tagErrorMsg('Project/name', 'The Project Name `'.
$html->tagValue('Project/name').'` is invalid - please use alphabetic
characters only.');?>



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



Re: Association Problem

2007-02-17 Thread Grant Cox

Change your Intinerary's Event association to

var $hasMany = array('Event' => array('className'=> 'Event') );

in your itineraries/view action, have something like

function view($id) {
$this->Itinerary->recursive = 1;
$itinerary = $this->Itinerary->read(null, $id);
$this->set('itinerary', $itinerary);
}

and in your view, do a print_r($itinerary) to see how the associations
come through in your data array.


Or, just bake the whole lot - it can make all your models, controllers
and views, just make sure you tell it the right associations.


On Feb 17, 11:26 am, "strykstaguy" <[EMAIL PROTECTED]> wrote:
> I have tried to read the manual and look at examples but I am having a
> hard time with associations.
>
> For one, I have a three tables. Trips, Itineraries, Events
>
> Each has one Itinerary, Each Itinerary has many events.
>
> What i really want right now is to connect my Itineraries to Events,
> Currently when i display my itineraries it repeats them 6 times
> instead of twice (the number of itineraries i have right now). I want
> once i select an itinerary is to view the events that match that
> itinerary.
>
> itinerary.php
> ***
> 
> class Itinerary extends AppModel
> {
> Var $name = 'Itinerary';
> var $hasOne = array('Event' =>
> array('className'=> 'Event',
>   'conditions'   => '',
>   'order'=> '',
>   'dependent'=>  false,
>   'foreignKey'   => 'itinerary_id'
> )
> );
> var $validate = array(
>
> 'title'  => VALID_NOT_EMPTY,
> 'creator'   => VALID_NOT_EMPTY,
> 'when'   => VALID_NOT_EMPTY
>
> );
>
> }
>
> ?>
> ***
> events.php
>
> **
> 
> class Event extends AppModel
> {
> Var $name = 'Event';
> var $belongsTo = array('Itinerary' =>
>array('className'  => 'Itinerary',
>  'conditions' => '',
>  'order'  => '',
>  'foreignKey' => 'itinerary_id'
>)
> );
> var $validate = array(
>
> 'what'  => VALID_NOT_EMPTY,
> 'where'   => VALID_NOT_EMPTY,
> 'andwhen'   => VALID_NOT_EMPTY
>
> );
>
> }
>
> ?>
>
> *
>
> What it all comes down to is I know how to connect them with HasMany
> and BelongsTo but i don't know how to actually display the events info
> in the 'View' of my itineraries.
>
> Any Help?


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



Re: saveField saving more than one field

2007-02-17 Thread Grant Cox

$this->data in a model is NOT the same as $this->data in a
controller.  In a controller $this->data includes the submitted model
data from a form, in a model it is only the set() data that is about
to be saved.  When you use Model->saveField(), the only data set is
the field you are saving, so random form data will not be included.

The first case is your error, as you identified.  Of course you should
only process a field that is included (although perhaps validation can
care if a field is ignored).  But still, I don't think md5'ing every
time the model is saved is a good idea - you only want to md5 the
unhashed password from the user, and I imagine a lot of the time a
User is loaded and saved a fresh password is not included.  I would
recommend something more like

function beforeSave(){
 if ( isset($this->data['User']['new_password']) ){
  $this->data['User']['password'] = md5($this->data['User']
['new_password']);
 }
}



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



Re: How to pass variables via GET method?

2007-02-17 Thread Grant Cox

Well, the only reason that '$mydisplay' is in the url rather than 5,
is because variable substitution only happens automatically in php
when using double quote strings, not single quote.
'url'  => "/books/lister/?id=1&display=$mydisplay",
will do what you want.

Or are you asking how to modify this parameter using Javascript, based
upon the user interaction in a page?


On Feb 18, 6:53 am, "skyblueink" <[EMAIL PROTECTED]> wrote:
> I know this in not a Cake problem, but I think it's what we come
> across frequently in real world.
>
>$mydisplay = 5;
>
> $options = array(
> 'update'   => 'view',
> 'url'  => '/books/lister/?id=1&display=$mydisplay',
> 'type' => 'asynchronous',
> 'loading'  => "Element.hide('view');",
> 'complete' =>
> "Element.show('indicator');progressBy(n);Effect.Appear('view');"
> );
> echo 
> $javascript->event('window','load',$ajax->remoteFunction($options),false);
>
> ?>
>
> The value of $mydisplay will be changed frequenlty. Then how can I
> pass the value of $mydisplay (5) to /book/lister/ via GET method? As
> you can see, in the preceding example the string '$mydisplay' itself
> is passed to /books/lister, not its value 5.


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



Re: Setting dynamic menu + submenu

2007-02-17 Thread the_woodsman

Maybe I just don't fully understand your requirements,but... why can't
you have a menu that can map any menu item to any controller/action -
i.e. menu item 1 would link to pages/somepage, item 2 to
dynamic_content_controller/draw_graph, etc etc... It's a benefit of
Cake that URLs are so flexible, why tie yourself down like this?


> Of course it would be much nicer if the path would be /menuItem/view/
> subMenuItem but as the menu is dynamic this isn't possible (no
> controller with that name).

I'm sure you could achieve this by modifying your app's routes.php
file.


Woody


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



RE: Logical architecture for importing CSV or other files?

2007-02-17 Thread Mariano Iglesias

It's a very simple thing, really. Something like this to give you an idea:

class CsvImporterComponent extends Object
{
var $controller;
var $uses = array ('Model');

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

function import($csvFile)
{
// Do your thing and use $this->Model to save to your model
}
}

Then on your controller you do:

var $components = array('CsvImporter');

and somewhere in there:

$this->CsvImporter->import('myfile.csv');

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Joe Crawford
Enviado el: Sábado, 17 de Febrero de 2007 06:32 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: Logical architecture for importing CSV or other files?

That sounds promising. I'll dive into the components documentation.


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



Re: IBM Tutorial Products model ?

2007-02-17 Thread Mech7

Wait nevermind i found it :)

 array(
'className' => 'Dealer',
'conditions'=> null,
'order'=> null,
'foreignKey'=>'dealer_id')
);
}
?>

They forgot to add null to the array.

On Feb 17, 10:36 pm, "Mech7" <[EMAIL PROTECTED]> wrote:
> There is an error in the IBM tutorial but i don't know what is wrong?
> This is the code:
>
>  class Product extends AppModel
> {
> var $name = 'Product';
> var $belongsTo = array ('Dealer' => array(
> 'className' => 'Dealer',
> 'conditions'=>,
> 'order'=>,
> 'foreignKey'=>'dealer_id')
> );}
>
> ?>
>
> Also the dealer is wrong too i think?
>
>  class Dealer extends AppModel
> {
> var $name = 'Dealer';
> var $hasMany = array ('Product' => array(
> 'className' => 'Product',
> 'conditions'=>,
> 'order'=>,
> 'foreignKey'=>'dealer_id')
> );}
>
> ?>
>
> Does anybody know what this should be?


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



Re: Logical architecture for importing CSV or other files?

2007-02-17 Thread Joe Crawford

On 2/17/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
> Why not just build it as a component and from the component while importing
> populate your Cake models?

That sounds promising. I'll dive into the components documentation.

Thanks!

Joe

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



IBM Tutorial Products model ?

2007-02-17 Thread Mech7

There is an error in the IBM tutorial but i don't know what is wrong?
This is the code:

 array(
'className' => 'Dealer',
'conditions'=>,
'order'=>,
'foreignKey'=>'dealer_id')
);
}
?>

Also the dealer is wrong too i think?

 array(
'className' => 'Product',
'conditions'=>,
'order'=>,
'foreignKey'=>'dealer_id')
);
}
?>

Does anybody know what this should be?


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



How to pass variables via GET method?

2007-02-17 Thread skyblueink

I know this in not a Cake problem, but I think it's what we come
across frequently in real world.

   'view',
'url'  => '/books/lister/?id=1&display=$mydisplay',
'type' => 'asynchronous',
'loading'  => "Element.hide('view');",
'complete' =>
"Element.show('indicator');progressBy(n);Effect.Appear('view');"
);
echo $javascript->event('window','load',$ajax-
>remoteFunction($options),false);
?>

The value of $mydisplay will be changed frequenlty. Then how can I
pass the value of $mydisplay (5) to /book/lister/ via GET method? As
you can see, in the preceding example the string '$mydisplay' itself
is passed to /books/lister, not its value 5.


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



Re: What editor do you use for CakePHP?

2007-02-17 Thread GoodMoJo

It's all about jEdit.  I'm suprised it isn't getting much love on this
thread... Everyone seems to love Textmate but I like a little more out
of my development enviroment.
I like jEdit because It...
1) Is platform independent
2) Has snippets (they're called super abreviations... work pretty much
the same)
3) Has FTP (ftp plugin)
4) Has IRC (irc plugin)
5) Has Tabs (buffer tab plugin)
6) six bazillion other plugins which can easily be installed.


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



RE: Logical architecture for importing CSV or other files?

2007-02-17 Thread Mariano Iglesias

Why not just build it as a component and from the component while importing
populate your Cake models?

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Joe Crawford
Enviado el: Sábado, 17 de Febrero de 2007 03:48 p.m.
Para: cake-php@googlegroups.com
Asunto: Logical architecture for importing CSV or other files?

So I'm working on an application that has as one of its parts
accepting "leads" from external entities. We get these as emails in a
quasi CSV format (I'm trying to get a better format, XML maybe, but it
seems unlikely). I wrote some code in PHP to parse these to create SQL
statements to insert this data into a "leads" table --


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



Re: Caching XML views

2007-02-17 Thread Jippi

If your on linux you can use this shell script to replace all short
tags with full tags



# script to replace short php tags  /tmp/$$
mv -f /tmp/$$ $i
done
# remove accidentally doubled ones
for i in `find public_html -type f|grep -e "\.php\|\.inc"`; do echo
$i;
sed "s/ /tmp/$$
mv -f /tmp/$$ $i
done
# change the echo ones
for i in `find public_html -type f|grep -e "\.php\|\.inc"`; do echo
$i;
sed "s/ /tmp/$$
mv -f /tmp/$$ $i
done
---



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



Caching XML views

2007-02-17 Thread Nick Jones

Hi guys,

I'm currently creating RSS feeds using a separate layout with
header("Content-Type: text/xml"); inside of it, which all works fine
and dandy.

The problems occur when trying to push the code into my live
environment which relies on caching due to heavy traffic. I am now
getting "unexpected T_STRING" errors due to the http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Integrate a datepicker

2007-02-17 Thread [EMAIL PROTECTED]

Hi,
> I use this 
> onehttp://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-w...
> It is all right and simple to install.
Are you using a component/helper or did you integrate it "by hand"?
If so are you willing to share your component/helper?
bye,
nikolas


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



1.2: pagination related data in scaffolding-type baked views

2007-02-17 Thread Cynthia

I have a list of topics and each topics hasMany issues. After
scaffolding I have used bake.php to create the MVC's.

When I view the issues they paginate.
When I view the topics they paginate.

But when I view a single issue, I get this *huge* list of issues on
the page.

I've found one mention here http://tinyurl.com/2kxzma in "Pagination
for hasMany association" but adding var $paginate = array('limit' =>
10) to both the topics and issues controllers only makes them paginate
correctly in their own individual view. The related info still comes
up as just one huge list.

I looked at http://bakery.cakephp.org/articles/view/65 and the more
extended http://www.noswad.me.uk/Pagination but both seem to deal with
two sets of data displayed in one and the same view (i.e.: on each
line you have a product, category, etc.).

Any help, link or a push in the right direct would be so helpful.


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



Logical architecture for importing CSV or other files?

2007-02-17 Thread Joe Crawford

So I'm working on an application that has as one of its parts
accepting "leads" from external entities. We get these as emails in a
quasi CSV format (I'm trying to get a better format, XML maybe, but it
seems unlikely). I wrote some code in PHP to parse these to create SQL
statements to insert this data into a "leads" table --

The question I have  is this - what's the best way to manage this? I'd
like to do the parsing application in cake - basically a tool to
report what files are imported and which have yet to be imported -- is
there a preferred architecture here?

Sorry this is so scattered, I'm thinking I just want the parser to be
outside of Cake - but if I can think of a way to do it (or if you can
think of a way! *grin* in Cake then I want to do that.

Joe
--
http://joecrawford.com/
805-857-3951

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



Re: Using acl.php to create the database with shared domains

2007-02-17 Thread 4e4en

In which file?


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



Re: Navigation Component / Helper

2007-02-17 Thread lloydhome

Your example is good but you need to set the return attribute.
 $this->set($menu,  $this->Categories->requestAction('/categories/
getCategoryList', array('return'=>1)));

This is the type of thing that could use a cache as I descibed
  http://lloydhome.com/blog/archives/2007/02/More-Caching-in-CakePHP.html
and
  
http://groups.google.com/group/cake-php/browse_thread/thread/5e0034e1ce6c4798/#

If you follow the caching I posted then also add the cache parameter.
 $this->set($menu,  $this->Categories->requestAction('/categories/
getCategoryList', array('return'=>1, 'cache'=>1)));

HTH,

David Lloyd
--
lloydhome consulting, inc.
http://lloydhome.com


On Feb 17, 11:33 am, "Siegfried Hirsch" <[EMAIL PROTECTED]>
wrote:
> here is a small example:
>
> in your main controller or better in the app_controller in /app
>
> class AppController extends Controller  {
>   function beforeFilter() {
> $this->set($menu,
> $this->Categories->requestAction('/categories/getCategoryList'));
>   }
> ...}
>
> /* not tested - just as a hint */
>
> now you can access $menu in your elements and even in the layout.
>
> Siegfried
>
> 2007/2/17, Helmi <[EMAIL PROTECTED]>:
>
>
>
>
>
> > i'll get attached to this. My current thoughts go in the same
> > direction. The only question is where to get the data for the element?
>
> > I want to use a list of categories from the Category Model within my
> > menu and i don't really know how to access the data from the Category
> > Model within the elements.
>
> > Any further help for this?
>
> > Thanks,
> > Frank
>
> --
> Siegfried Hirsch
> hhS - Welserstr. 1 - 81373 M?nchen - (089) 5484 3564 - 
> skype:shirschhttp://gadgetgui.de/http://www.rss-blogger.dehttp://www.newsbee.deNewsBee
>  2 - customized RSS solutions


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



Re: Navigation Component / Helper

2007-02-17 Thread Siegfried Hirsch
here is a small example:

in your main controller or better in the app_controller in /app

class AppController extends Controller  {
  function beforeFilter() {
$this->set($menu,
$this->Categories->requestAction('/categories/getCategoryList'));
  }
...
}
/* not tested - just as a hint */

now you can access $menu in your elements and even in the layout.

Siegfried

2007/2/17, Helmi <[EMAIL PROTECTED]>:
>
> i'll get attached to this. My current thoughts go in the same
> direction. The only question is where to get the data for the element?
>
> I want to use a list of categories from the Category Model within my
> menu and i don't really know how to access the data from the Category
> Model within the elements.
>
> Any further help for this?
>
> Thanks,
> Frank
>
>
> >
>


-- 
Siegfried Hirsch
hhS - Welserstr. 1 - 81373 M�nchen - (089) 5484 3564 - skype:shirsch
http://gadgetgui.de / http://www.rss-blogger.de
http://www.newsbee.de NewsBee 2 - customized RSS solutions

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



Re: CakePHP CMS

2007-02-17 Thread Matt Adams

rhet wrote:

> Does anyone know of any good CMS for cake? I would like the
> application to be a plugin.

If you want a CMS, go and find a project that is serious about a CMS and 
use it.  Drupal, Typo3 (which I think is horrid, but it's been around 
for a while and quite popular in Europe, or so I read) if you must use PHP.

I doubt you'll see something with the community support of Drupal come 
from Cake any time soon.  So either create it yourself (which is quite a 
bit of work) or just move on.  There are a lot of other CMS products for 
PHP but a good number of them are half-baked and quite useless in the 
long run.


Just my two cents,

Matt
-- 
BASIC: A programming language.  Related to certain social diseases
in that those who have it will not admit it in polite company.

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



Re: Setting dynamic menu + submenu

2007-02-17 Thread junal

i dont know why you are thinking that way. you got ELEMENT to place
your menus. and to make your menus dynamic why dont you use CSS. thank
you.

On Feb 17, 2:56 am, "cakerdude" <[EMAIL PROTECTED]> wrote:
> Hi there. I'm quite new at cake but definitely jumping in to it.
> I have a question though. What would be the best way to set up a cake
> site with a dynamic menu + submenu. The way i see it i have to send
> two values to the controller so that the path would look like /
> controller/view/menuItem/subMenuItem.
> However isn't this against the whole idea of cake(stepping away from
> the whole model/controller/action/ concept)?
> Of course it would be much nicer if the path would be /menuItem/view/
> subMenuItem but as the menu is dynamic this isn't possible (no
> controller with that name).
>
> I hope i make any sense.
>
> Can anyone tell me where i'm thinking wrong because i'm positive this
> IS possible withing cake.


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



Re: (HtmlHelper::formTag) Deprecated: Use FormHelper::create instead

2007-02-17 Thread Mech7

Thanks adding the var $helpers only seem to generate more errors
though :(

Notice: Undefined index: models in E:\xampp\htdocs\portfolio\cake\libs
\view\helpers\form.php on line 84

Notice: Undefined index: controller in E:\xampp\htdocs\portfolio\cake
\libs\view\helpers\form.php on line 117

Notice: Trying to get property of non-object in E:\xampp\htdocs
\portfolio\cake\libs\view\helpers\form.php on line 158

Fatal error: Call to a member function parseHtmlOptions() on a non-
object in E:\xampp\htdocs\portfolio\cake\libs\view\helpers\form.php on
line 158


On Feb 17, 1:07 am, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> Make sure that your var $helpers includes the value for form helper
>
> in your controller you need to have
>
> var $helpers = array('Html','Ajax','Form');
>
> say if you want to be able to use the formHelper from your views. It
> seems pretty stable to me and it is totally addictive ;)  But it is
> still in development and is subject to change and could change out
> from under you.  But the choice to use the 'release' is yours and is
> probably a wise one as the majority of the documentation is targeted
> at 1.1 as are most of the related information scattered all over the
> web.
>
> Sam D
>
> On 2/16/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Thanks the link explained it pretty well but i think it is still very
> > buggy so i probably think ill go back to the stable 1.1
> > with :
> > create(array('default' => false)); ?>
>
> >  it tells me that $form is not defined, so when i put on the top:
>
> >  $form = new FormHelper();
>
> > Then it gives me :
>
> > Fatal error: Class 'FormHelper' not found in E:\xampp\htdocs\portfolio
> > \app\views\users\register.thtml on line 2
>
> > On Feb 16, 11:03 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> > > Given that 1.2 is still marked as development I wouldn't expect
> > > official documentation on it yet.  You can find some information on
> > > the form helper for 1.2 
> > > athttp://cake.insertdesignhere.com/posts/view/15also the api can be
> > > reached at api.cakephp.org/1.2/ though that is probably subject to
> > > change and I do not know with what regularity it has been updated
>
> > > Sam D
>
> > > On 2/16/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > > > Ok i am following the IBM tutorial for Tor but now i get this error
> > > > with the registration form:
>
> > > > (HtmlHelper::formTag) Deprecated: Use FormHelper::create instead
>
> > > > To what should i change this? and how do i find what is changed in
> > > > 1.2?
> > > > formTag('/users/register') ?>
>
> > > --
> > > ==
> > > S. DeVore
> > > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > > - its a fine line between a real question and an idiot
>
> --
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot


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



Re: Navigation Component / Helper

2007-02-17 Thread Helmi

i'll get attached to this. My current thoughts go in the same
direction. The only question is where to get the data for the element?

I want to use a list of categories from the Category Model within my
menu and i don't really know how to access the data from the Category
Model within the elements.

Any further help for this?

Thanks,
Frank


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



Re: category selection

2007-02-17 Thread Helmi

just to let you know...

got this working inside the JokeController


function list_by_cat($slug = null)
{
   $category = $this->Joke->Category->findBySlug($slug);

and...

   $criteria= array('Joke.category_id' => $category['Category']
['id']);

..then some pagination and other stuff.

Thanks for your help!


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



Re: Multilingual dynamic content

2007-02-17 Thread georgeL

I had the same problem in my last project, a multilanguage product
katalog:
http://www.shop.werit.eu

My solution was like langdon proposed:

a table called languages which keeps all translated strings and hold a
reference to the related record:
  - id
  - object_id (foreign object)
  - lang (de/en/fr)
  - type (product / category /page .. of the foreign object)
  - name (holding product name)
  - description (product description)

the selected language is kept in the session, and the strings for
buttons / static texts are in php language files within constant
defines.

the downside of this pattern is that when using internal cake
relations there is a big overhead in sql calls, so i wrote custom
finder methods for each related model (products/categories/..) to
findAllWithLanguage in one sql call.


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



CakePHP and LiveGrid (Rico)

2007-02-17 Thread archinform

Hi all,

since years I maintain and develop a architecture database and haven't
found a good framework for developing an web frontend for interacting
(viewing and(!) editing) with a complex relational database. Now I
discovered CakePhp and it look's like I have found the right thing.

But there is still a problem, if You have a relation to a table with
many,many entries. In the generated views the dropdown fields become
very large, because all possible selection have to be preloaded in the
html element.
With an classic AJAX Livesearch field it would be possible to avoid
this, but the negative thing with this Livesearch/Autosuggest stuff
is, that You can't scroll through the data!

Now I found the Javascript package Rico with their LiveGrid
technology.
Example: http://openrico.org/rico/livegrid.page and 
http://openrico.org/rico/yahoo_search
(scrollable field combined with a search field!)
This looks impressing.

My Question: Does anybody already have started to include this
LiveGrid technology into Cake PHP? I believe, that this could become
an killer feature for CakePhp ;)

Hope to hear from someone,
Sascha


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



Re: Multilingual dynamic content

2007-02-17 Thread Langdon Stevenson

There are many paths to the same goal :-)
Hope you find your solution.

Langdon


peper wrote:
> Well. Your idea looks good.
> For me caching and language selection is done in flash. On the other
> hand, this solution looks hard to put into our CMS. I'll think about
> it.
> 
> Thank you for your help.

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



Re: Multilingual dynamic content

2007-02-17 Thread peper

Well. Your idea looks good.
For me caching and language selection is done in flash. On the other
hand, this solution looks hard to put into our CMS. I'll think about
it.

Thank you for your help.

On Feb 17, 2:42 am, Langdon Stevenson <[EMAIL PROTECTED]>
wrote:
> Hi majna
>
> As you say, this isn't about Cake, its just a PHP design patern.
>
> What you suggested is pretty much what I do, except that I get the
> language setting from the browser.  To allow me to cache views though I
> will need to do as you are suggesting and add the language to the URL.
>
> Langdon
>
> majna wrote:
> > products table: add language_id.
>
> > for language detection add lang in URl,
> > like: products/view/en/123... or somethin else.(so page could be
> > linked)
> > grab this "lang", find language id and select from products where
> > language:id
> > put language_id in session etc.
>
> > This is not CAKE feature, but general web app design i think?!


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



Re: Rendering views of another ojbect with AJAX

2007-02-17 Thread [EMAIL PROTECTED]

Make sure you have var $uses = array("Users", "Projects"); in your
Users controller.



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



Rendering views of another ojbect with AJAX

2007-02-17 Thread jamieh

Hi people,

I have been searching this group for the answer to this question but I
cant find any post that relates to it!

I have 2 objects:

USERS & PROJECTS

The user is first presented with the "users/add" view.  This view
contains a div which by default contains a form for the user to create
an account.

Upon filling in and submitting the form I would like to populate the
div with a view from the Projects object.  This allows the user to
then add details about their project but without the page reloading.

What I have found is that I can load the view of another method of the
same object; but not that of another object.

So if I try to render "users/project" this works as expected.  However
if I try and render "projects/add" cake doesn't like it and tells me
that the view for UsersController::projects/add() doesn't exist.  Well
it doesn't, not under the USERS object anyway; but it does exist under
the PROJECTS object.

So - how does one render a view from another object?

Does anyone have a snippet of code that demonstrates how this would be
achieved?

I look forward to a reply as this has held me up for a few days now,
Jamieh...


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