full crud ldap data source

2009-06-15 Thread anagrithems

I've been working on expanding cake support under cakephp I've taken
the work from Gservat and expanded it
http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/
I will continue to update this data source as I get things like
associations working.

I've also create an auth component LdapAuth
http://www.analogrithems.com/rant/2009/06/13/ldapauth-component-for-cakephp/

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



Models Not Being Loaded

2009-06-15 Thread CharlesTMunger

I have developed a site on my windows machine and it is working
great.  I uploaded the entire cake directory to my ubuntu server and
it appears to be working ok, except that it seems that models are not
being accessed.

For example, first I noticed that the validation methods weren't
working.  I also noticed the model relationships are not being loaded
because this function "$this->Order->User->read()" generates the
following error:

"Fatal error: Call to undefined method stdClass::read() in /var/www/
Cake/app/controllers/orders_controller.php on line 50"

Please note that this function and the model validations were working
perfectly on my development (windows) site.

I started playing with the model classes and realized that they were
not being loaded at all.  For instance, I can write random characters
in the middle of the model files, such as:

 array('rule' => 'isUnique', 'message' => "Sorry,
this email address has already been registered."),
'password' => array('rule' => array('minLength', '6'),
'message' => 'Password must be at least 6 characters long.'),

);

}
?>

yet the behavior does not chance.  I can even erase the models folder
and the behavior remains constant.  The only conclusion I have come to
is that my models are, for some reason, not being loaded at all.

Any ideas as to why my models are not being loaded?

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



Territory routing question

2009-06-15 Thread Jim Wiberley

Hi All,

I'm looking for a way to set my site up so that the first part of the
url is always the territory,

eg. http://www.site.com/uk/news, http://www.site.com/fr/news

How would I set up the routing for this so that the territory variable
is passed on to the controller?

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 on iSCSI/SAN deployment question

2009-06-15 Thread puroroot

I have a question on deployment of CakePHP. Is there any
configurations that I should be doing on CakePHP when deploying my
CakePHP application on a iSCSI volume? I am using GFS2 and cman with a
2 node cluster running apache.

--~--~-~--~~~---~--~~
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: Thanks! who know that the file of app\views\helpers\paginator.php' cache at where

2009-06-15 Thread Rimoe
add
a little mistake

my core.php like but my core.php is Configure::write('debug', 0);
and  the file of app\views\helpers\paginator.php has been new create,
so it has been cached

what if you can help me,

Thank you very much

rimoe

2009/6/16 Rimoe 

> Hi,
>
> everyone.
>
> I repair the file of app\views\helpers\paginator.php, but my core.php is
> Configure::write('debug', 2);
>
> so it can't be applied at once,
>
> I should to delete the cache, but I don't know where is it?()
>
> If you know please tell me.
>
> Thank you very much
>
> rimoe
>

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



Thanks! who know that the file of app\views\helpers\paginator.php' cache at where

2009-06-15 Thread Rimoe
Hi,

everyone.

I repair the file of app\views\helpers\paginator.php, but my core.php is
Configure::write('debug', 2);

so it can't be applied at once,

I should to delete the cache, but I don't know where is it?()

If you know please tell me.

Thank you very much

rimoe

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



web developer position available

2009-06-15 Thread laptop

hi,

is anyone from sydney, australia available for freelance work during
july? I need someone to cover my ass while I head over europe for a
month. Please contact me on craig.michael.mor...@gmail.com or 0422 174
194.

Thanks,
Craig
--~--~-~--~~~---~--~~
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: Containable recursive find problem

2009-06-15 Thread Wilson

Hi Andreas,

I'm trying to this same thing, but without success.  Do you mind
pasting your find logic here?

On Jun 12, 9:20 am, Andreas Derksen  wrote:
> Thanks, Works fine! Thought to complicated... :-)
> Containable behavior is really nice ;-)
>
> greets
> Andreas
>
> Martin Westin schrieb:
>
> > You just go:
>
> > 'contain' => array(
> >   'Product' => array(
> >     'conditions' => array('Product.id' => $productId),
> >     'Module' => array(
> >       'Subject'
> >     )
> >   ),
> >   'Check'
> > )
>
> > That is: in contain you simply name the nearest "associates" and in
> > each of those you name furhter associates to return.
>
> > On Jun 12, 2:02 pm, Andreas Derksen  wrote:
>
> >> Hi, im currently developing a checklist application witch has the 
> >> following Models and relations:
> >> Checklist belongsTo Product
> >> Checklist hasMany Check
> >> Product HABTM Module
> >> Module hasMany Subjects
> >> Subject belongsTo Module
> >> So, what i want to do now is to generate tables like this:Checklist ID 
> >> 2Module 1Subject 1Subject 2Subject 3Subject 4Module 2Subject 1Subject 
> >> 2Subject 3Subject 4
> >> I tried to query it like this:
> >> $this->Checklist->find('first', array('contain' => array(
> >>                                                              'Product' => 
> >> array('conditions' => array('Product.id' => $productId)),
> >>                                                              'Check' )));
> >> the result is:Array ( [Checklist] => Array ( [id] => 1 [product_id] => 1 ) 
> >> [Product] => Array ( [id] => 1 [name] => Product1 ) [Check] => Array ( [0] 
> >> => Array ( [id] => 1 [check] => true [checklist_id] => 1 [subject_id] => 1 
> >> ) ) )Now I need the Product array recursive, means: the associated 
> >> Module(s) and the Subject(s) associated to the Module(s).
> >> A $this->Checklist->find('first', array('recursive' => 2, 'conditions' => 
> >> array('id' => $checklistId))); returns everything I need, ... and more. 
> >> thats the problem.
> >> How can I do that?
> >> Thanks in advance
> >> Andreas
>
>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



I want to add a parameter to the PaginatorHelper's link, where is the best to add?

2009-06-15 Thread Rimoe
Hi,

good afternoon!
I want to add a parameter to the method prev and next and numbers in the
file of PaginatorHelper.
for example
the link became like this
http://www.mysite.com/d/page:2?aaa=dfdfsd

where is the best to repair the PaginatorHelper?

Thank you very much

rimoe

--~--~-~--~~~---~--~~
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: routing to control layout

2009-06-15 Thread Adam Royle

Sorry, I never used reverse routing like that. Maybe someone else with more 
experience can help out?

With my facebook app I used fbml so my views were custom anyway which meant 
I had to use explicit urls.

Cheers,
Adam

- Original Message - 
From: "Greg Baker" 
To: "CakePHP" 
Sent: Tuesday, June 16, 2009 11:36 AM
Subject: Re: routing to control layout



Ahh thank you, that works nicely.
How about if I want the URLs to persist throughout the app, so that
$html->link(), say, would point to /AppName/facebook/controller/action
if $this->params['facebook'] were set?  Would this be possible using
routing or would I have to do something else?

On Jun 15, 10:36 pm, "Adam Royle"  wrote:
> Sure...
>
> Router::connect('/AppName/facebook/:controller/:action/*', 
> array('facebook'
> => 1));
>
> then in your app controller just check for
>
> $this->param['facebook']
>
> - Original Message -
> From: "Greg Baker" 
> To: "CakePHP" 
> Sent: Tuesday, June 16, 2009 10:28 AM
> Subject: routing to control layout
>
> > I'm trying to make an app that works standalone as well as with
> > facebook. Is it possible to define routing so that if the URL
> > matches /AppName/facebook/* it will route to /AppName/* and set a
> > parameter facebook=true so I can catch this in the AppController and
> > render it using my facebook layout?




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

2009-06-15 Thread Dr. Loboto

Your $validate is wrong totally as you not specified validation rules.
Should be this:

 var $validate = array(
'username' => array(
'required' => true,
'rule' => 'notEmpty',
'message' => 'Username is required'
),
'password' => array(
'required' => true,
'rule' => 'notEmpty',
'message' => 'Password is required'
)
);

On Jun 15, 8:19 pm, RhythmicDevil  wrote:
> Hi,
> having a little problem with validation. I am not using a DB. I have
> to auth against Web Services. I am currently just working on the login
> page trying to get messages to the view when validation fails.
>
> Here is the Model:
>
> class User extends AppModel
> {
>         var $useDbConfig = 'soap';
>     var $useTable = false;
>
>         var $validate = array(
>                                         'username' => array(
>                                                                               
>   'required' => true
>                                                                               
>   ,'allowEmpty' => false
>                                                                               
>   ,'message' => 'Username is required'
>                                                                               
>   )
>                                                 ,'password' => array(
>                                                                               
>   'required' => true
>                                                                               
>   ,'allowEmpty' => false
>                                                                               
>   ,'message' => 'Password is required'
>                                                                               
>   )
>                                                 );
>
> }
>
> Here is the Controller:
>
> class UsersController extends AppController
> {
>     public $layout = 'login';
>     public $fields = array ('username', 'password');
>
>     function index()
>     {
>
>     }
>
>     function login()
>     {
>
>                 // First set the data to the model
>                 $this->User->set( $this->data );
>
>                 // Check for validity
>                 if($this->User->validates())
>                 {
>                         print 'valid';
>                 }
>                 else
>                 {
>                         print 'invalid';
>                 }
>         $this->render('index');
>     }
>
>     function logout()
>     {
>
>     }
>
> }
>
> So pretty straight forward stuff. However when I submit the form I get
> the following error from Cake whether there is data in the fields or
> not:
>
> Warning (2): preg_match() [function.preg-match]: Delimiter must not be
> alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2431]
>
> Code | Context
>
> $this   =       User
> User::$useDbConfig = "soap"
> User::$useTable = false
> User::$validate = array
> User::$displayField = NULL
> User::$id = false
> User::$data = array
> User::$table = "users"
> User::$primaryKey = "id"
> User::$_schema = NULL
> User::$validationErrors = array
> User::$tablePrefix = NULL
> User::$name = "User"
> User::$alias = "User"
> User::$tableToModel = array
> User::$logTransactions = false
> User::$transactional = false
> User::$cacheQueries = false
> User::$belongsTo = array
> User::$hasOne = array
> User::$hasMany = array
> User::$hasAndBelongsToMany = array
> User::$actsAs = NULL
> User::$Behaviors = BehaviorCollection object
> User::$whitelist = array
> User::$cacheSources = true
> User::$findQueryType = NULL
> User::$recursive = 1
> User::$order = NULL
> User::$__exists = NULL
> User::$__associationKeys = array
> User::$__associations = array
> User::$__backAssociation = array
> User::$__insertID = NULL
> User::$__numRows = NULL
> User::$__affectedRows = NULL
> User::$_findMethods = array
> User::$_log = NULL
> $options        =       array()
> $data   =       array(
>         "username" => "",
>         "password" => ""
> )
> $methods        =       array(
>         "__construct",
>         "call__",
>         "bind",
>         "bindmodel",
>         "unbindmodel",
>         "__createlinks",
>         "__constructlinkedmodel",
>         "__generateassociation",
>         "setsource",
>         "set",
>         "deconstruct",
>         "schema",
>         "getcolumntypes",
>         "getcolumntype",
>         "hasfield",
>         "create",
>         "read",
>         "field",
>         "savefield",
>         "save",
>         "__savemulti",
>         "updatecountercache",
>         "_prepareupdatefields",
>         "saveall",
>         "__save",
>         "updateall",
>         "remove",
>         "del",
>         "delete",
>         "_deletedependent",
>         "_deletelinks",
>         "deleteall",
>         "__collectforeignkeys",
>         "exists",
>         "hasany",
>         "find",
>         "_findfirst",
>         "_findcount",
>         "_

Re: routing to control layout

2009-06-15 Thread Greg Baker

Ahh thank you, that works nicely.
How about if I want the URLs to persist throughout the app, so that
$html->link(), say, would point to /AppName/facebook/controller/action
if $this->params['facebook'] were set?  Would this be possible using
routing or would I have to do something else?

On Jun 15, 10:36 pm, "Adam Royle"  wrote:
> Sure...
>
> Router::connect('/AppName/facebook/:controller/:action/*', array('facebook'
> => 1));
>
> then in your app controller just check for
>
> $this->param['facebook']
>
> - Original Message -
> From: "Greg Baker" 
> To: "CakePHP" 
> Sent: Tuesday, June 16, 2009 10:28 AM
> Subject: routing to control layout
>
> > I'm trying to make an app that works standalone as well as with
> > facebook.  Is it possible to define routing so that if the URL
> > matches /AppName/facebook/* it will route to /AppName/* and set a
> > parameter facebook=true so I can catch this in the AppController and
> > render it using my facebook layout?
--~--~-~--~~~---~--~~
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: routing to control layout

2009-06-15 Thread Adam Royle

Sure...

Router::connect('/AppName/facebook/:controller/:action/*', array('facebook' 
=> 1));

then in your app controller just check for

$this->param['facebook']

- Original Message - 
From: "Greg Baker" 
To: "CakePHP" 
Sent: Tuesday, June 16, 2009 10:28 AM
Subject: routing to control layout


>
> I'm trying to make an app that works standalone as well as with
> facebook.  Is it possible to define routing so that if the URL
> matches /AppName/facebook/* it will route to /AppName/* and set a
> parameter facebook=true so I can catch this in the AppController and
> render it using my facebook layout?
> >
>
> 


--~--~-~--~~~---~--~~
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: grr help with cron/shell tabs

2009-06-15 Thread Adam Royle

"cake" is a shell script which needs to be chmod'ed to 755 to allow being 
executed (also chmod +x will do that)

If you're getting the output of the file instead of it being executed, then 
it seems you're passing the script onto something else (such as the php 
interpreter) rather than executing it as a script.

Do you have command line access? If so, try it first manually before trying 
to run in cron.

Even if you try and run the shell script with no arguments you should get 
something.

btw, this is the full command to run (either in cron or manually, no 
linebreaks either):

/home/mileswj/cake/console/cake your_shell_name -app 
/home/mileswj/sc2armory.com/app/

Even if you run this manually, you should get a listing of the available 
shells:

/home/mileswj/cake/console/cake -app /home/mileswj/sc2armory.com/app/

If you don't have command line access it's possible that the control panel 
you're using is changing the command before entering into cron (such as 
prefixing it with path of php). If that is happening you might need to write 
a dummy php script that exec()'s your real command.

Cheers,
Adam

- Original Message - 
From: "Miles J" 
To: "CakePHP" 
Sent: Tuesday, June 16, 2009 10:02 AM
Subject: Re: grr help with cron/shell tabs


>
> Nope, still getting this:
>
> clear
>
> LIB=${0/%cake/}
> APP=`pwd`
>
> exec php -q ${LIB}cake.php -working "${APP}" "$@"
>
> exit;
>
> >
>
> 


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



routing to control layout

2009-06-15 Thread Greg Baker

I'm trying to make an app that works standalone as well as with
facebook.  Is it possible to define routing so that if the URL
matches /AppName/facebook/* it will route to /AppName/* and set a
parameter facebook=true so I can catch this in the AppController and
render it using my facebook layout?
--~--~-~--~~~---~--~~
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: grr help with cron/shell tabs

2009-06-15 Thread Miles J

Nope, still getting this:

clear

LIB=${0/%cake/}
APP=`pwd`

exec php -q ${LIB}cake.php -working "${APP}" "$@"

exit;

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



Trouble using the "multiple" HABTM validation (per cookbook 4.1.4.18)

2009-06-15 Thread azkid

I have two associated models, SchGroup and Families, with a “SchGroup
HABTM Families” association between them.   I am attempting to use the
validation::multiple() validation rule per 4.1.4.18 in the cookbook to
force the user to select at least one Family when creating one of the
SchGroups.  The problem is, that the validation::multiple() validation
rule does not get called when using either the save() or saveALL()
methods in my “add” controller method.  The problem was also observed
by WebbedIT who posted to this group back in February of 2009 as found
here: 
http://groups.google.com/group/cake-php/browse_thread/thread/3390943040e2ded9/f00cd9f3ac21de19

WebbedIT proposed a Hack of lines #1511 to #1525 in model.php where he
basically is telling the saveAll() method to process HABTM
associations in addition to processing belongsTo associations.  This
hack actually worked for me, and appears to be allowing
validation::multiple() to be appropriately called (at least when using
saveAll() in my controller).

Nevertheless, I have several lingering concerns that I would really
like feedback on:

1. Is this really a bug, or have I missed something subtle that is
keeping it from working “out of the box” for me (see my code below)
2. Is WebbedIT’s hack a valid approach?  If so, could/should it be
integrated into the core?  Hacks are scary…
3. Since HABTM associations are savable using either save() or saveAll
(), wouldn’t there need to be a fix for the save() case also?

If there needs to be a bug report and associated test cases, I would
be glad to do some leg work, but being new to cakephp and framework
programming in general, I would appreciate any pointers from the
veterans here, especially as it relates to creating test cases.  I am
using build 1.2.2.8120.  I see that there is a more recent stable
build available, but checking the underlying tickets, it doesn’t seem
to have any fixes related to this problem.

Now, if you care to read on, here are some of the pertinent details of
my implementation:

The two models including the validation for SchGroup (including a
scattering of non-standard keys--this is a legacy application...) are
as follows:

class SchGroup extends AppModel
{
var $name = 'SchGroup';
var $primaryKey  =  'sch_group_id';
var $hasAndBelongsToMany = array(
'Family' => array(
'className' => 'Family',
'joinTable' => 'sch_group_tie',
'foreignKey' => 'sch_group_id',
'associationForeignKey' => 'familyid',
)
);

var $validate = array(
'description' => array(
'descriptionRule1' => array(
'rule' => 'notEmpty',
'message' => 'Must not be blank',
'last'=> true
),
'descriptionRule2' => array(
'rule' => 'numeric',
'message' => 'Must be a number',
'last'=> true
)
),
'Family' => array(
'rule' => array('multiple', array('min' => 1)),
'message' => 'Please select one or more Families'
)
);
}

class Family extends AppModel
{
var $name = 'Family';
var $primaryKey  =  'familyid';
}

Here's the add() section of the SchGroup controller:

function add() {
if (!empty($this->data)){
if ($this->SchGroup->saveAll($this->data)){
$this->Session->setFlash('Your group has been saved.');
$this->redirect(array('action' => 'index'));
}
}
$this->set('families', $this->SchGroup->Family->find('list', array
('fields' => array('Family.name';
}

And finally, the add() view for SchGroup is something like this:

echo $form->create('SchGroup');
echo $form->input('SchGroup.description');
echo $form->input('Family', array( 'multiple' => 'multiple'));
echo $form->end('Save Group');

And as mentioned, I have implemented WebbedIT’s hack of model.php as
outlined above.

--~--~-~--~~~---~--~~
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: Populate last_login field while using Auth-redirect!

2009-06-15 Thread Jorge Horacio Cué Cantú
Hello

Use

  $this->redirect($this->Auth->redirect());

Instead of

  $this->redirect('/')



>

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



EAV (Entity-Attribute-Value) Data Model with CakePHP

2009-06-15 Thread marco.rizze...@gmail.com

Hi
I must use a EAV schema for my web app but I have no idea about how
realizate this in cake?
I have a table with entities , a table with atrributes and many table
with value (one for datetime value,one for varchar value ,one for text
value  etc. ).
Can someone give me some suggestion about this?
Many Thanks
Marco
--~--~-~--~~~---~--~~
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: array extraction

2009-06-15 Thread Adam Royle
use this function, it works well...



// recursively reduces deep arrays to single-dimensional arrays
// $preserve_keys: (0=>never, 1=>strings, 2=>always)
function array_flatten($array, $preserve_keys = 1, &$return = array()) {
 foreach ($array as $key => $child) {
  if (is_array($child)) {
   $return =& array_flatten($child, $preserve_keys, $return);
  } elseif ($preserve_keys + is_string($key) > 1) {
   $return[$key] = $child;
  } else {
   $return[] = $child;
  }
 }
 return $return;
}



  - Original Message - 
  From: samuel darko 
  To: cake-php@googlegroups.com 
  Sent: Tuesday, June 16, 2009 1:16 AM
  Subject: array extraction


  Hi guys:
  i need help trimming down this:


Array(  [0] => Array(  [0] => Array   ( [Amount] => 72.64   
) ))
  TO this:

 Array (  [Amount] => 72.64 )I tried the ff code but to no 
avail:function afterFind($results, $primary=false) { if($primary == 
true) {
   if(Set::check($results, '0.0')) {  
$fieldName = key($results[0][0]);foreach($results as 
$key=>$value) {$results[$key][$this->alias][$fieldName] 
= $value[0][$fieldName];
  unset($results[$key][0]);}
}   }   return $results;}   
 Thanks, in advance, for your help
  -sam
  

--~--~-~--~~~---~--~~
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: caching in cakephp

2009-06-15 Thread Miles J

Well what type of cache are you using exactly? There are many types.

cacheAction, persistModel, cacheQueries, etc.
--~--~-~--~~~---~--~~
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: Form Input default Value

2009-06-15 Thread gbd

Thanks that worked!

On Jun 15, 2:14 pm, brian  wrote:
> I usually use the textarea() method myself. And, if you read the
> record into $this->data you should be able to do:
>
> echo $form->textarea('Bio.bio', array('label' => 'Band Bio', 'rows' =>
> '10', 'columns' => '40'));
>
> That's if the model is called, "Bio". I don't know if that was a typo
> on your part.
>
> On Mon, Jun 15, 2009 at 1:49 PM, gbd wrote:
>
> > Hey,
>
> > I can't figure out why my 'value' is not appearing as the default in
> > my Band Bio field:
>
> > input('Bio.bio',array('label'=>'Band Bio'),array
> > ('type'=>'textarea'),array('value'=>$option['Bio']['bio']));?>
>
> > Any ideas?
>
> > If I do the following  the data
> > displays correctly.
>
> > 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: Help with CSS Rollover Links

2009-06-15 Thread red mcgee

Re: Andreas:

that's a foul way to respond to someone.
please don't browse the forums looking for others to belittle.
the users here are merely looking for support - not criticism.
how ugly of you...


On Jun 12, 12:21 pm, Andreas  wrote:
> Hi,
> well i think you first need to learn the basics. e.g.: html + css before
> proceeding to php (cake not to mention).
> besides, its called "hover", not "rollover".
> But anyway, to help you with that problem (maybe i missunderstood it
> ...), this is how you make a button wich changes the image when the
> mouse is over it:
>
> Viewcode:
> link('Home', "blog/index/", array('id' => 'homebtn')); ?>
> link('Best Postings', "blog/bestof/", array('id' =>
> 'best')); ?>
>
> CSS:
> a#homebtn { background: transparent url(path/to/button/img.png) 0 0
> no-repeat); float: left; }
> a#homebtn:hover { background: transparent url(path/to/hover/img.png) 0 0
> no-repeat; float: left; }
>
> hope that helps.
>
> greets
> Andreas
>
> DbZeroOne schrieb:
>
> > Ok, good advice from both of you. This is what my code looks like now:
>
> >  > echo $html->link('',array('controller'=>'blog','action' =>
> > 'index'),array('ID' => 'homebtn','alt' => 'Home'));
> > echo $html->link('',array('controller'=>'blog','action' =>
> > 'bestof'),array('ID' => 'best',  ,'alt' => 'Best Postings'));
> > ?>
>
> > This should be one button to the right of the other.There will be 5
> > total in a horizontal menu.
>
> > The problem now is that only one button will work at a time (link and
> > rollover). Either one will work when they're alone, but together, only
> > the first one will work (whichever one is first). I've tried
> > everything I can think of, but either nothing changes or the whole
> > page blanks out.
>
> > Thank you for your input.

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



caching in cakephp

2009-06-15 Thread Claudiu Apetrei

Hello,

Just wrote my first cakephp website and now working on caching some
pages.

Read the IBM tutorial on caching and it says :

"But you don't have to do it. CakePHP does it for you. CakePHP knows
when data is inserted, updated, or deleted, and if this affects a
cached view, the cache for that view is cleared. That saves an awful
lot of work."

Have been trying this on my project, also on a simple test project. I
just can't get cake to delete the cache after a insert.

Are there any tricks for getting this to work ?

Regards,
Claudiu
--~--~-~--~~~---~--~~
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: Change the content-type

2009-06-15 Thread Miles J

But it doesn't work. Even if you use the Request Handler to output as
XML, it is not XML.

On Jun 15, 7:50 am, jperras  wrote:
> You should be using the RequestHandler Component for content-type
> setting/detection of your views and actions.
>
> http://api.cakephp.org/class/request-handler-component
>
> -j.
>
> On Jun 14, 5:56 pm, Peter  wrote:
>
> > thanks, that's what i neededalthough i moved it to the top of the
> > default xml-layoutfile i use.
>
> > On 14 jun, 23:44, Miles J  wrote:
>
> > > I usually put this at the end of my controller actions:
>
> > > $this->header('Content-Type: text/xml');
>
> > > On Jun 14, 10:26 am, Peter  wrote:
>
> > > > how can i change the content-type of a view? i have an xml-view which
> > > > renders just fine, but my browser sees it as text/html.
--~--~-~--~~~---~--~~
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: Preppulate username from User Model into a controller for Model Listing

2009-06-15 Thread Ashu

Thanks.

This is what I did in my view for add.ctp

echo $form->input('user_id',array('value' => $user['User']['id']));


But, I would like to make this statement invisible, as I am pulling
this data for a logged-in user and he does not really need to see his
ID. I tried to remove the echo, but in that case it does not populate
the "id" field and sets it to default 0.

thanks.


On Jun 15, 11:09 am, brian  wrote:
> On Mon, Jun 15, 2009 at 3:17 AM, Ashu wrote:
>
> >  Models 
> > class User extends AppModel {
> >  var $name = 'User';
> >  var $hasMany = array ('Listing');
> > }
>
> > class Listing extends AppModel {
> >   var $name = 'Listing';
> >   var $belongsTo = 'User';
> > }
>
> > *** Controllers ***
> > listings_controller
>
> >  function add() {
> >    $this->set('user',$this->Auth->user()); // From the User Model
> > Class
> >    if(!empty($this->data)) {
> >      if($this->Listing->save($this->data)) {
> >        $this->Session->setFlash('Your listing has been added');
> >        $this->redirect(array('action' => 'index'));
> >      }
> >    }
> >  }
>
> > *** View ***
> > views/listings/add.ctp
>
> > echo $user['User']['username']; /* Passed from listings_controller*/
>
> > echo $form->create('Listing');
> > echo $form->input('title');
> > echo $form->input('body', array('rows' => '4'));
> > echo $form->input('user');             < How do I pre-populate the
> > user name here --->
> > echo $form->end('Save Post');
>
> Because Listing is associated with User model, you should have a
> user_id field in its table. So, you want Listing.user_id in the form
> field.
>
> echo $form->input('Listing.user_id', array('value' => $user['id']));
>
> For an edit action, you'll already have user_id in your $data array,
> so the input can just be:
>
> echo $form->input('Listing.user_id');
>
> It's good practice to use the model name in the calls to FormHelper.
> It makes things a lot clearer.
--~--~-~--~~~---~--~~
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: find() returning different array structures.

2009-06-15 Thread Carlos Gonzalez Lavin
Ya, I was just summing up your explanation =)

2009/6/15 Marcelo Andrade 

>
> > 2009/6/14 Marcelo Andrade 
> >>
> >> On Sun, Jun 14, 2009 at 5:46 PM, centr0 wrote:
> >> > (..)
> >> > the view breaks after this, now i know its simply fixed my question is
> >> > is it normal that the array structure changes when calling find('all)
> >> > vs. find('first')?
> >>
> >> Sure it is.  In this case, there will be:
> >>
> >> $x= $this->Model->find('all');
> >> $y= $this->Model->find('first');
> >>
> >> $x[0] == $y
>
> On Mon, Jun 15, 2009 at 11:24 AM, Carlos Gonzalez
> Lavin wrote:
> > Since you are telling cake to only get you the first result with
> > find('first'), it doesnt feel the need to add number to the resulting row
> as
> > it would to the rows that a find('all') returns
>
> I know.  You're right.
>
> It was not a really working/usefull code, but just
> an illustration to better explain the overall idea
> to centr0.
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.com
>
> >
>

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



Question about Xml and how make it appear on my needs

2009-06-15 Thread Paulos23

Hi Cake people,
I have a question about Xml.I am using httpSocket to hit a specific
url in order to get some data.The url is http://www.geonames.org and i
received details about destinations in order to implement
geocoding.The results are in this format:


2877


London
51.5084152563931
-0.125532746315002
2643743
GB
United Kingdom
P
PPLC


The reason i send this post is to ask about how i can make this data
appear on my own needs ,for example:
destination:London
country:United kingdom
.
..
etc
as well as make destination label linkable.
Apart from that i want to kindly ask you if you have any url or any
article which might help me plz give me a reply!
Ty very much for your time.
Paulos
--~--~-~--~~~---~--~~
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: Form Input default Value

2009-06-15 Thread brian

I usually use the textarea() method myself. And, if you read the
record into $this->data you should be able to do:

echo $form->textarea('Bio.bio', array('label' => 'Band Bio', 'rows' =>
'10', 'columns' => '40'));

That's if the model is called, "Bio". I don't know if that was a typo
on your part.

On Mon, Jun 15, 2009 at 1:49 PM, gbd wrote:
>
> Hey,
>
> I can't figure out why my 'value' is not appearing as the default in
> my Band Bio field:
>
> input('Bio.bio',array('label'=>'Band Bio'),array
> ('type'=>'textarea'),array('value'=>$option['Bio']['bio']));?>
>
> Any ideas?
>
> If I do the following  the data
> displays correctly.
>
> 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: Preppulate username from User Model into a controller for Model Listing

2009-06-15 Thread brian

On Mon, Jun 15, 2009 at 3:17 AM, Ashu wrote:
>
>  Models 
> class User extends AppModel {
>  var $name = 'User';
>  var $hasMany = array ('Listing');
> }
>
> class Listing extends AppModel {
>   var $name = 'Listing';
>   var $belongsTo = 'User';
> }
>
> *** Controllers ***
> listings_controller
>
>  function add() {
>    $this->set('user',$this->Auth->user()); // From the User Model
> Class
>    if(!empty($this->data)) {
>      if($this->Listing->save($this->data)) {
>        $this->Session->setFlash('Your listing has been added');
>        $this->redirect(array('action' => 'index'));
>      }
>    }
>  }
>
> *** View ***
> views/listings/add.ctp
>
> echo $user['User']['username']; /* Passed from listings_controller*/
>
> echo $form->create('Listing');
> echo $form->input('title');
> echo $form->input('body', array('rows' => '4'));
> echo $form->input('user');             < How do I pre-populate the
> user name here --->
> echo $form->end('Save Post');

Because Listing is associated with User model, you should have a
user_id field in its table. So, you want Listing.user_id in the form
field.

echo $form->input('Listing.user_id', array('value' => $user['id']));

For an edit action, you'll already have user_id in your $data array,
so the input can just be:

echo $form->input('Listing.user_id');

It's good practice to use the model name in the calls to FormHelper.
It makes things a lot clearer.

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



Form Input default Value

2009-06-15 Thread gbd

Hey,

I can't figure out why my 'value' is not appearing as the default in
my Band Bio field:

input('Bio.bio',array('label'=>'Band Bio'),array
('type'=>'textarea'),array('value'=>$option['Bio']['bio']));?>

Any ideas?

If I do the following  the data
displays correctly.

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: find() returning different array structures.

2009-06-15 Thread Marcelo Andrade

> 2009/6/14 Marcelo Andrade 
>>
>> On Sun, Jun 14, 2009 at 5:46 PM, centr0 wrote:
>> > (..)
>> > the view breaks after this, now i know its simply fixed my question is
>> > is it normal that the array structure changes when calling find('all)
>> > vs. find('first')?
>>
>> Sure it is.  In this case, there will be:
>>
>> $x= $this->Model->find('all');
>> $y= $this->Model->find('first');
>>
>> $x[0] == $y

On Mon, Jun 15, 2009 at 11:24 AM, Carlos Gonzalez
Lavin wrote:
> Since you are telling cake to only get you the first result with
> find('first'), it doesnt feel the need to add number to the resulting row as
> it would to the rows that a find('all') returns

I know.  You're right.

It was not a really working/usefull code, but just
an illustration to better explain the overall idea
to centr0.

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

http://mfandrade.wordpress.com

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



Populate last_login field while using Auth-redirect!

2009-06-15 Thread DigitalDude

Hey,

I'm trying to figure out how I can populate a last_login-field without
turning off Auth's redirect! I have two options but I can't put them
together to work.

Option 1:
I set the AuthRedirect to false and can polpulate the field, when I do
this:

public function beforeFilter() {
$this->Auth->autoRedirect = false;
}

public function login() {
...
if($this->Auth->login($this->data)) {
$this->User->id = $this->Auth->user("id");
$this->User->saveField('last_login', date("Y-m-d H:i:s"));
$this->redirect('/');
}
}

This works fine, but I'm losing a very important functionality: When a
user is logged out because of a session timeout and loggs in again, he/
she will NOT be redirected to the page he was going to before the
session was timed out.

I can prevent this issue by setting the autoRedirect to TRUE, but THEN
i am not able to save the last_login field because the autoRedirect
redirects BEFORE I can save any data.

This should be an issue that more people have discovered yet, so I
hope somebody can help me with this.

THX in advance, and remember: Code is poetry!

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



Getting Xdebug to work under CakePHP 1.2 and NetBeans 6.5

2009-06-15 Thread kdubya

I have recently switched from a plain text development style to using
NetBeans 6.5. I figured I might like some of the niceties of a real
IDE (I have used them before) but my main motivation was to get
debugging with breakpoints, watches etc.

So, I have gotten Xdebug (verision 2.0.4) to work with a simple "Hello
World" script outside of PHP. I can set breakpoints and inspect
variables. Great!

Only it doesn't work in a CakePHP project. Actually, if I leave the
debug setting on to "Stop at first line", it does breakpoint there.
Where it stops (it says) is in the index.php from the /app folder. So
I do F8 (Step Over) and it does not stop at the next line of code. It
skips 10 lines of code and stops there. Do it a few more times and it
skips random chunks of code. It then gets about 5 lines from the
bottom of the file and one F8 sends it running, not stopping at any of
the subsequent breakpoints that I have set.

As I'm stepping through the file, it actually looks like it is showing
me the wrong file (there are several index.php files after all). I've
tried to match up the line number to figure out where it really is but
no luck.

BTW, my development machine is running Window XP Pro SP2. My webserver
is Apache 2.0.50 and PHP is 5.2.5, if that makes any difference.

I have searched the newsgroup for answers to this. There are a couple
of posts that are similar (like getting Xdebug to work under Eclipse
PDT) but they gave me no help.

Thanks in advance for any suggestions.

Ken

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

2009-06-15 Thread Suneeth Varghese

How do i configure mssql on cakephp.I am working on XAMMP.

--~--~-~--~~~---~--~~
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: aco problems

2009-06-15 Thread Joe

ok. @1.2.3.8166 Stable @2009-06-15

far more investigation on ACL.
solved most question in previous post, but one new question:

i have to embed acl->check in every controllers(or in app_controller
beforeFilter()?)
ACL do not check the access before load the page?

below is the answer to the previous questions:

for aros, use $actsAs in models as written in the cookbook tutorial,
aros do not have alias, and groups have its model.
follow the tutorial is good enough to have a working group/user
association with aro

for aco, the building aco code in cookbook works,
and disclosed more settings and "general behavior" that do not
documented elsewhere.
for controllers based aco, just use alias but not "model" and
"foreign_id"
just use the code to generate aco, do not build it yourself/in
console.
remember to create a root "controller" node as well.

setting permission:
even more crappy. i build it in console.
use syntax like
cake acl check Group.1 Users all
as aro do not have alias, use model and foreign_id
aco use alias
then users under Group model will work.

On 6月14日, 下午9時31分, Joe  wrote:
> from the cookbook of cakephp, there is not an example of creating
> acos.
>
> how 'Weapons' is associated with controllers? var $name =
> W'eaponsController'; ?
> but i cannot get through it.
>
> and how aros is assiociated with a logged in user?
> it will find the user id in session automatically?
>
> i have
> Aro tree:
> ---
>   [8]administrator
>
> [14]User.6
>
>   [9]editor
>
>   [10]authorized
>
> [15]User.23
>
> ---
>
> when i logged in by user.6, cakephp will know i am in group 8 also?
> but "$this->Acl->deny('authorized','Users');"
> do not work

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



Problem with model import and find conditions

2009-06-15 Thread VVilku

Hello (and sorry for my english) :)

I have a small problem with the import model, and the condition in the
method of using 'find'. Terms of use related model. The condition has
a reference to a related model (belongsTo).

A simple example:

I have 2 models:
1) User
class User extends AppModel {
var $name = 'User';
var $hasMany = array(
'Memoir' => array('className' => 'Memoir',
'foreignKey' => 
'user_id',
'dependent' => 
false,
),
);
2) Memoir
class Memoir extends AppModel {
var $name = 'Memoir';
var $belongsTo = array(
'User' => array('className' => 'User',
'foreignKey' => 
'user_id',
)
);

I have this condition for paginate options::
$this->paginate = array(
'conditions'=>array('Memoir.status' => 1, 'User.status' =>
1),
'order'=>array('Memoir.updated'=>'desc'),
);"

When I use it in the controller, everything is ok.

But when I try to use it after the import model in to another
controller, I receives an error.

I tried App::import and ClassRegistry::init().

//App::import('Model', $section['model']);
//$model = new $section['model']();
$model =& ClassRegistry::init($section['model']);

$results = $model->find('all', array
( 'conditions'=>array('Memoir.status' => 1, 'User.status' => 1)));

SQL Error: 1054: Unknown column 'User.status' in 'where clause'


I understand that the imported model is not somehow related to the
model of 'User'.
What can I do? Please :)

I'm stuck.

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



Preppulate username from User Model into a controller for Model Listing

2009-06-15 Thread Ashu

 Models 
class User extends AppModel {
  var $name = 'User';
  var $hasMany = array ('Listing');
}

class Listing extends AppModel {
   var $name = 'Listing';
   var $belongsTo = 'User';
}

*** Controllers ***
listings_controller

  function add() {
$this->set('user',$this->Auth->user()); // From the User Model
Class
if(!empty($this->data)) {
  if($this->Listing->save($this->data)) {
$this->Session->setFlash('Your listing has been added');
$this->redirect(array('action' => 'index'));
  }
}
  }

*** View ***
views/listings/add.ctp

echo $user['User']['username']; /* Passed from listings_controller*/

echo $form->create('Listing');
echo $form->input('title');
echo $form->input('body', array('rows' => '4'));
echo $form->input('user'); < How do I pre-populate the
user name here --->
echo $form->end('Save Post');



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



array extraction

2009-06-15 Thread samuel darko
Hi guys:
i need help trimming down this:

Array
(
  [0] => Array
(
  [0] => Array
   (
 [Amount] => 72.64
   )
 )
)


TO this:

 Array
 (
  [Amount] => 72.64
 )

I tried the ff code but to no avail:

function afterFind($results, $primary=false) {
if($primary == true) {
   if(Set::check($results, '0.0')) {
  $fieldName = key($results[0][0]);
   foreach($results as $key=>$value) {
  $results[$key][$this->alias][$fieldName] =
$value[0][$fieldName];
  unset($results[$key][0]);
}
}
}   
return $results;
}


Thanks, in advance, for your help


-sam

--~--~-~--~~~---~--~~
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 use 2 tables in a controller

2009-06-15 Thread nurvzy

Instead of using $uses which loads the model for every action
regardless of it being utilized you can use something more on the fly
when you actually need it like so:

In any action in your controller:

$CountEmail = ClassRegistry::init('CountEmail');
$CountEmail->find();


Nick

On Jun 14, 3:09 am, amjith ps  wrote:
> hi friends,
>
> I want to use another table update on a controller which users one
> model class.
>
> I have emailsController with its model as Email
> I uses this in the controller, while i fetch the data using Email
> model i want to update another table with count. say the table is
> count_emails. how will i do this in the same controller?
>
> Hope you got my doubt.
--~--~-~--~~~---~--~~
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: Change the content-type

2009-06-15 Thread jperras

You should be using the RequestHandler Component for content-type
setting/detection of your views and actions.

http://api.cakephp.org/class/request-handler-component

-j.

On Jun 14, 5:56 pm, Peter  wrote:
> thanks, that's what i neededalthough i moved it to the top of the
> default xml-layoutfile i use.
>
> On 14 jun, 23:44, Miles J  wrote:
>
> > I usually put this at the end of my controller actions:
>
> > $this->header('Content-Type: text/xml');
>
> > On Jun 14, 10:26 am, Peter  wrote:
>
> > > how can i change the content-type of a view? i have an xml-view which
> > > renders just fine, but my browser sees it as text/html.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem with Media Plugin of David Persson

2009-06-15 Thread marco.rizze...@gmail.com

Hi
I try to use MediaPlugin of David Persson.
I have installed it I config it but when I tr8y test it using
documentation (http://wiki.github.com/davidpersson/media/attachment-
model ) but It doesn't work (the plugin doesn't save the attachment).
My situation is:
I have User model with :

var $hasOne = array(
'Photo' => array(
'className' => 'Media.Attachment',
'foreignKey' => 'foreign_key',
'conditions' => array('model' => 'User'),
'dependent' => true,
)
);

In my controller I have:

$this->data = array(
'User' => array(
'id' => 1
),
'Photo' => array(
0 => array('file' => 
'http://cakephp.org/img/cake-logo.png',
'model' => 'User')
)
);

$this->User->saveAll($this->data, array('validate' => 'first'));

$this->data seems strange if I read from cake documentation  (
http://book.cakephp.org/view/75/Saving-Your-Data )
But if I set :

$this->data = array(
'User' => array(
'id' => 1
),
'Photo' => array(
'file' => 
'http://cakephp.org/img/cake-logo.png',
'model' => 'User'
)
);
I get an validation error from plugin
I hope someone can help me
Many Thanks
Marco

--~--~-~--~~~---~--~~
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 using shells inside plugin directory

2009-06-15 Thread Martin Westin

Just call it like any other shell should work asaik.
For example like Mark's benchmarking shell in DebugKit:
http://thechaw.com/debug_kit/wiki/docs/benchmark-shell



On Jun 13, 11:04 am, "marco.rizze...@gmail.com"
 wrote:
> Hi
> I have installed a plugin in my cakephp app.
> Now inside this plugin there is a shell that helps to configure the
> plugin.
> My problem is that i don't know how tell to cake console to use this
> shell
> My shell is in app/plugins/media/vendors/shells
> Sorry for the banal question 
--~--~-~--~~~---~--~~
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: find() returning different array structures.

2009-06-15 Thread Carlos Gonzalez Lavin
Since you are telling cake to only get you the first result with
find('first'), it doesnt feel the need to add number to the resulting row as
it would to the rows that a find('all') returns

2009/6/14 Marcelo Andrade 

>
> On Sun, Jun 14, 2009 at 5:46 PM, centr0 wrote:
> > (..)
> > the view breaks after this, now i know its simply fixed my question is
> > is it normal that the array structure changes when calling find('all)
> > vs. find('first')?
>
> Sure it is.  In this case, there will be:
>
> $x= $this->Model->find('all');
> $y= $this->Model->find('first');
>
> $x[0] == $y
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.com
>
> >
>

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



Validation

2009-06-15 Thread RhythmicDevil

Hi,
having a little problem with validation. I am not using a DB. I have
to auth against Web Services. I am currently just working on the login
page trying to get messages to the view when validation fails.

Here is the Model:

class User extends AppModel
{
var $useDbConfig = 'soap';
var $useTable = false;

var $validate = array(
'username' => array(

'required' => true

,'allowEmpty' => false

,'message' => 'Username is required'

)
,'password' => array(

'required' => true

,'allowEmpty' => false

,'message' => 'Password is required'

)
);
}

Here is the Controller:


class UsersController extends AppController
{
public $layout = 'login';
public $fields = array ('username', 'password');


function index()
{

}

function login()
{

// First set the data to the model
$this->User->set( $this->data );

// Check for validity
if($this->User->validates())
{
print 'valid';
}
else
{
print 'invalid';
}
$this->render('index');
}

function logout()
{

}
}


So pretty straight forward stuff. However when I submit the form I get
the following error from Cake whether there is data in the fields or
not:

Warning (2): preg_match() [function.preg-match]: Delimiter must not be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2431]

Code | Context

$this   =   User
User::$useDbConfig = "soap"
User::$useTable = false
User::$validate = array
User::$displayField = NULL
User::$id = false
User::$data = array
User::$table = "users"
User::$primaryKey = "id"
User::$_schema = NULL
User::$validationErrors = array
User::$tablePrefix = NULL
User::$name = "User"
User::$alias = "User"
User::$tableToModel = array
User::$logTransactions = false
User::$transactional = false
User::$cacheQueries = false
User::$belongsTo = array
User::$hasOne = array
User::$hasMany = array
User::$hasAndBelongsToMany = array
User::$actsAs = NULL
User::$Behaviors = BehaviorCollection object
User::$whitelist = array
User::$cacheSources = true
User::$findQueryType = NULL
User::$recursive = 1
User::$order = NULL
User::$__exists = NULL
User::$__associationKeys = array
User::$__associations = array
User::$__backAssociation = array
User::$__insertID = NULL
User::$__numRows = NULL
User::$__affectedRows = NULL
User::$_findMethods = array
User::$_log = NULL
$options=   array()
$data   =   array(
"username" => "",
"password" => ""
)
$methods=   array(
"__construct",
"call__",
"bind",
"bindmodel",
"unbindmodel",
"__createlinks",
"__constructlinkedmodel",
"__generateassociation",
"setsource",
"set",
"deconstruct",
"schema",
"getcolumntypes",
"getcolumntype",
"hasfield",
"create",
"read",
"field",
"savefield",
"save",
"__savemulti",
"updatecountercache",
"_prepareupdatefields",
"saveall",
"__save",
"updateall",
"remove",
"del",
"delete",
"_deletedependent",
"_deletelinks",
"deleteall",
"__collectforeignkeys",
"exists",
"hasany",
"find",
"_findfirst",
"_findcount",
"_findlist",
"_findneighbors",
"_findthreaded",
"__filterresults",
"resetassociations",
"isunique",
"query",
"validates",
"invalidfields",
"invalidate",
"isforeignkey",
"getdisplayfield",
"escapefield",
"getid",
"getlastinsertid",
"getinsertid",
"setinsertid",
"getnumrows",
"getaffectedrows",
"setdatasource",
"getdatasource",
"getassociated",
"joinmodel",
"beforefind",
"afterfind",
"beforesave",
"aftersave",
"beforedelete",
"afterdelete",
"beforevalidate",
"onerror",
"_clearcache",
 

Re: Any idea how to put one cakephp project in the directory structure of another cakephp project?

2009-06-15 Thread tarapage


Hi Adam,

Thanks for the idea, I've never messed with the .htaccess files before.  I
tried to put the change in the main directory of julabay and now I get:

Fatal error: Class 'Dispatcher' not found in
/home2/pageking/public_html/julabay/portfolio/photocardqueen/app/webroot/index.php
on line 89

Did I do this in the wrong directory?  There are a few .htaccess files
sitting around, and until now I've been able to just leave them be.   I
guess it is time to start learning about them :)  What directory do you
think I would need to add this change to?   Also, should I put my portfolio
directory under the app directory vs right from the main julabay directory,
or does this not matter as long as I have the .htacess set up properly?

Thanks in advance.

Adam Royle wrote:
> 
> 
> You will need to exclude the portfolio directory from being sent to your 
> default cake installation. Something like this might work...
> 
> 
>RewriteEngine on
>RewriteRule^$ app/webroot/[L]
>RewriteCond %{REQUEST_URI} !^/portfolio(/|$)
>RewriteRule(.*) app/webroot/$1 [L]
> 
> 
> - Original Message - 
> From: "tarapage" 
> To: 
> Sent: Monday, June 15, 2009 1:09 PM
> Subject: Any idea how to put one cakephp project in the directory
> structure 
> of another cakephp project?
> 
> 
>>
>>
>> Hi
>>
>> I want to host multiple cakephp projects on one domain.  I want to be
>> able
>> to have the following:
>>
>> www.julabay.com is our main website, it is a cakephp website.
>> I want to be able to add the following:
>>
>>  /portfolio/project1
>>  /portfolio/project2
>>
>> etc, and be able to access them by:
>>
>> www.julabay.com/portfolio/project1
>>
>> I want project 1 to then load up the cakephp application that is under
>> project1.  I hope that this makes sense.  When I put a subdir in the main
>> cakephp layout, of course it says:
>>
>>
>> Not Found
>>
>> Error: The requested address '/portfolio/project1 was not found on this
>> server.
>>
>>
>> The reason that I want to do this is that I don't want to keep all of the
>> websites that I have created, some of the domains will expire and I do
>> not
>> need to keep them live.  However, I want to keep them onfile for
>> portfolio
>> reasons, and want a fully functioning cakephp site living within another.
>>
>> Is this possible?
>>
>> Thanks
>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Any-idea-how-to-put-one-cakephp-project-in-the-directory-structure-of-another-cakephp-project--tp24028258p24028258.html
>> Sent from the CakePHP mailing list archive at Nabble.com.
>>
>>
>> >
>>
>> 
> 
> 
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Any-idea-how-to-put-one-cakephp-project-in-the-directory-structure-of-another-cakephp-project--tp24028258p24033669.html
Sent from the CakePHP mailing list archive at Nabble.com.


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

2009-06-15 Thread Martin Westin

Most likely: no.
I, for one, haven't touched my config files and I also run on 1.2.2 on
one server (1.2.3 for other installations). No cache problems using
File engine for me.

If you using some special Cache, or just the default File engine, then
have a look at the changelog to see if anything has been altered.

Also, unless have some very very good reason to stay on 1.2.2 then
upgrade your version of Cake.  You can see if the problem exists and
you will be up-to-date and one less security hole to worry about.



On Jun 15, 12:31 pm, lakers fan  wrote:
> Hello,
>
>      I m working with cake 1.2.2 whereas my collegue works with cake 1.2.3. 
> When he got the app folder from me, and run the website he got the following 
> errors.. is it a compatibility issue?
>
> Warning (512): Cache not configured properly. Please check Cache::config(); 
> in APP/config/core.php [CORE\cake\libs\configure.php, line 663]
>
> Code | Context
>
> $boot = true
>
> $shellPaths = null
>
> $localePaths = null
>
> $vendorPaths = null
>
> $pluginPaths = null
>
> $helperPaths = null
>
> $viewPaths = null
>
> $componentPaths = null
>
> $controllerPaths = null
>
> $behaviorPaths = null
>
> $modelPaths = null
>
> $cache = false
>
> Warning (2): array_merge() [function.array-merge]: Argument #1 is not an 
> array [CORE\cake\libs\configure.php, line 684]
>
> Code | Context
>
> $boot = true
>
> $shellPaths = null
>
> $localePaths = null
>
> $vendorPaths = null
>
> $pluginPaths = null
>
> $helperPaths = null
>
> $viewPaths = null
>
> $componentPaths = null
>
> $controllerPaths = null
>
> $behaviorPaths = null
>
> $modelPaths = null
>
> $cache = false
>
> $duration = "+10 seconds"
>
> $pref
>
> 2): array_merge() [function.array-merge]: Argument #1 is not an array 
> [CORE\cake\libs\configure.php, line 691]
>
> Code | Context
>
> $boot = true
>
> $shellPaths = null
>
> $localePaths = null
>
> $vendorPaths = null
>
> $pluginPaths = null
>
> $helperPaths = null
>
> $viewPaths = null
>
> $componentPaths = null
>
> $controllerPaths = null
>
> $behaviorPaths = null
>
> $modelPaths = null
>
> $cache = false
>
> $duration = "+10 seconds"
>
> $prefix = null
>
> Thanks,
>
> Bharani
>
> _
> Hotmail® has ever-growing storage! Don’t worry about storage 
> limits.http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_...
--~--~-~--~~~---~--~~
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: Modifying Html Helper Image method for localization support

2009-06-15 Thread John Andersen

Just thought of this, may not be a good idea, but worth a try!

Use the standard localization function __() as in the example below:

$html->image( __('btn_action.gif',true) );

and voila, you can decide to change the default image "btn_action.gif"
into something else depending on the language, by just specifying in
the language file, that "btn_action.gif" is equal to "eng/
btn_action.gif".

Haven't tried it, so you are on your own in testing it :)
Enjoy,
   John

On Jun 15, 3:25 am, "Adam Royle"  wrote:
> I guess it depends if you have any shared images that might be generic and
> used with all languages.
>
> If you want to override the helper, you can do it by creating an AppHelper
> class in app/app_helper.php
>
> Although this does change your functionality and you would have to duplicate
> any shared images between all languages.
>
> I would probably go the more explicit route, and just append the language to
> the image path ($lang = 'en/').
>
> $html->image($lang.'btn_action.gif');
>
> Cheers,
> Adam
>
> - Original Message -
> From: "daedalus" 
> To: "CakePHP" 
> Sent: Monday, June 15, 2009 6:24 AM
> Subject: Modifying Html Helper Image method for localization support
>
> > Hello,
>
> > I'm fairly new to CakePHP and have a question about the best way to
> > accomplish a task. Here is my situation: I'm building a little
> > localized app that incorporates a dozen or so images that will need to
> > be localized - for example navigation buttons.  The most logical way
> > to organize these images, it seems to me, is to put the images for
> > each language into a folder bearing the language abbreviation in the
> > "img" directory.  So, for instance, English images would be in "img/
> > eng/".
>
> > The app is working nicely now with Html helper image calls such as
> > $html->image('btn_action.gif').  The language variable is written to
> > the Config class in a beforeFilter of the (only) controller.  Ideally,
> > I guess, I need to modify or extend the Html helper to automatically
> > add the correct language directory into the image path, but as much as
> > I've looked around for examples I'm still a bit hazy on how to best
> > accomplish this.  Can I overwrite the "image" method of the Html
> > helper by including an appropriate class in /app/helpers? Am I going
> > about this in the right way to begin with?  I'm not so much interested
> > in what merely works, but with what is most elegant, logical, and
> > maintainable.
>
> > Thanks a lot,
>
> > AH
>
>
--~--~-~--~~~---~--~~
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: grr help with cron/shell tabs

2009-06-15 Thread Adam Royle

chmod +x /home/mileswj/cake/console/cake

then put this in cron

/home/mileswj/cake/console/cake your_shell_name -app /home/mileswj/
sc2armory.com/app/

Cheers,
Adam


On Jun 15, 6:25 pm, Miles J  wrote:
> Heres my current folder setup.
>
> /home/mileswj/cake/ (below root and shared between many apps)
> /home/mileswj/sc2armory.com/app/
> /home/mileswj/milesj.me/app/
> ... etc ...
>
> All the sites work correctly, im just trying to get a cron running on
> sc2armory. Ive tried all the following and none of them work.
>
> /usr/local/php5/bin/php /home/mileswj/cake/console/cake cron
> /usr/local/php5/bin/php /home/mileswj/cake/console/cake -app /home/
> mileswj/sc2armory.com/app/ cron
> /usr/local/php5/bin/php /home/mileswj/cake/console/cake -app "/home/
> mileswj/sc2armory.com/app/" cron
>
> All of those output this data into my email:
>
> clear
> LIB=${0/%cake/}
> APP=`pwd`
> exec php -q ${LIB}cake.php -working "${APP}" "$@"
> exit;
>
> Also tried using exec php -q and some other commands and nothing.
--~--~-~--~~~---~--~~
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 compatibility problem

2009-06-15 Thread lakers fan

Hello,

 I m working with cake 1.2.2 whereas my collegue works with cake 1.2.3. 
When he got the app folder from me, and run the website he got the following 
errors.. is it a compatibility issue?

 


Warning (512): Cache not configured properly. Please check Cache::config(); in 
APP/config/core.php [CORE\cake\libs\configure.php, line 663]

Code | Context

$boot = true

$shellPaths = null

$localePaths = null

$vendorPaths = null

$pluginPaths = null

$helperPaths = null

$viewPaths = null

$componentPaths = null

$controllerPaths = null

$behaviorPaths = null

$modelPaths = null

$cache = false



Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array 
[CORE\cake\libs\configure.php, line 684]

Code | Context

$boot = true

$shellPaths = null

$localePaths = null

$vendorPaths = null

$pluginPaths = null

$helperPaths = null

$viewPaths = null

$componentPaths = null

$controllerPaths = null

$behaviorPaths = null

$modelPaths = null

$cache = false

$duration = "+10 seconds"

$pref

2): array_merge() [function.array-merge]: Argument #1 is not an array 
[CORE\cake\libs\configure.php, line 691]

Code | Context

$boot = true

$shellPaths = null

$localePaths = null

$vendorPaths = null

$pluginPaths = null

$helperPaths = null

$viewPaths = null

$componentPaths = null

$controllerPaths = null

$behaviorPaths = null

$modelPaths = null

$cache = false

$duration = "+10 seconds"

$prefix = null

 

Thanks,

Bharani

_
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
--~--~-~--~~~---~--~~
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: CakePHP resources

2009-06-15 Thread Miles J

Agreed.

The only one that looked remotely correct was the model validation.

On Jun 15, 1:25 am, burzum  wrote:
> It looks more like you're trying to show examples how to do it
> horrible wrong.
>
> On Jun 14, 2:29 pm, Sumit Surai  wrote:
>
> >http://web-funda.blogspot.com/search/label/CakePHP
>
> > Here we are posting our findings about CakePHP.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP resources

2009-06-15 Thread burzum

It looks more like you're trying to show examples how to do it
horrible wrong.

On Jun 14, 2:29 pm, Sumit Surai  wrote:
> http://web-funda.blogspot.com/search/label/CakePHP
>
> Here we are posting our findings about CakePHP.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



grr help with cron/shell tabs

2009-06-15 Thread Miles J

Heres my current folder setup.

/home/mileswj/cake/ (below root and shared between many apps)
/home/mileswj/sc2armory.com/app/
/home/mileswj/milesj.me/app/
... etc ...

All the sites work correctly, im just trying to get a cron running on
sc2armory. Ive tried all the following and none of them work.

/usr/local/php5/bin/php /home/mileswj/cake/console/cake cron
/usr/local/php5/bin/php /home/mileswj/cake/console/cake -app /home/
mileswj/sc2armory.com/app/ cron
/usr/local/php5/bin/php /home/mileswj/cake/console/cake -app "/home/
mileswj/sc2armory.com/app/" cron

All of those output this data into my email:

clear
LIB=${0/%cake/}
APP=`pwd`
exec php -q ${LIB}cake.php -working "${APP}" "$@"
exit;

Also tried using exec php -q and some other commands and nothing.
--~--~-~--~~~---~--~~
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: added a 'created'-field in my table, but it's not filled

2009-06-15 Thread Martin Westin


Have you allowed NULL on the created field? (and modified)
I am not at all sure anymore but I have a vague memory of this being
significant... and os it appears to be still:
http://book.cakephp.org/view/69/created-and-modified




On Jun 15, 12:04 am, Peter  wrote:
> I read that adding a 'created' DATETIME-field to a table will be
> recognized and automatically filled whenever i save a new model to the
> db, but at the moment it's just empty all of the time. It seemed to
> work fine when i tested it on another model which i added through a
> form on a webpage, but now i'm doing a POST-request from a flash-
> app ... i don't think that should matter, but i don't know what i'm
> doing wrong here.
>
> What should i do or test to get this working? I have a DATETIME-field
> called 'created' and i save the model with this line:
>
> $this->Comment->save($this->params['form'])
>
> All the other data is saved correctly, but the created-field is not
> being filled
--~--~-~--~~~---~--~~
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: CakePHP resources

2009-06-15 Thread Martin Westin

You seem to focus on some odd topics.

http://web-funda.blogspot.com/2009/06/select-box-in-cakephp-12-generatelist.html
Why? I just don't get it. Why would you ever want to enclose find
('list') in a method that mimics the old argument lists? I mean, you
are not doing it to avoid re-writing an old project. For that you
would have also called the method generateList()


http://web-funda.blogspot.com/2009/05/dont-want-to-follow-database-table.html
Why do all that? Surely this simple line in the model is preferable:
var $useTable = 'tbluserinfo';


http://web-funda.blogspot.com/2009/05/how-to-import-controller-in-cakephp.html
I don't know what to say about this one.



On Jun 14, 2:29 pm, Sumit Surai  wrote:
> http://web-funda.blogspot.com/search/label/CakePHP
>
> Here we are posting our findings about CakePHP.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---