Looks like RC3 has added an empty array for the model when a COUNT is
performed.
before I would do this in my afterFind method.
foreach( $results as &$record )
{
if(isset($record['Portfolio']))
{
$record['Portfolio']['long_title'] = $this-
>getTitle( $record['Portfolio'] );
}
}
Now, I
Really. Sorry about that.
I am now getting errors in all my behaviors when COUNT queries are
called, because the structure of the array appears to have changed.
Is that one of the changes in RC3?
--~--~-~--~~~---~--~~
You received this message because you are su
Congrats on your new site.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED
Behaviors are now called after each COUNT query. The "afterFind"
method is called with data like this.
Array
(
[0] => Array
(
[count] => 14
)
)
Should behaviors have a new method called afterCount.
How can you tell the difference between a COUNT query and a table that
has a field call
I think I do this differently.
I add the virtual server to Apache as so.
ServerName www.yourdomain.local
DocumentRoot "C:/work/project1/www"
ServerName project2.yourdomain.local
DocumentRoot "C:/work/project2/www"
Then I add the line in my hosts file c:/windows/system32/dri
$html->link('View
User',array('admin'=>false,'controller'=>'users','action'=>'view','id'
=> $user['Users']['id']));
The prefix string needs a boolean value. If your prefix had been
"chicken_add" then you would pass "chicken"=>false.
I dislike Cake's implementation of the Router defaulting to the
x27;=>'login'));
- Original Message
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: CakePHP
Sent: Friday, October 3, 2008 5:16:31 PM
Subject: Re: URL routing
Great, that helped a lot. A follow up issue I am having is what is
the correct way to handle su
> if(isset($this->data['Product']['user_id'] = $user_id)) {
> if(isset($this->data['Product']['user_id'] = $this->Auth->user('id');) {
if(($this->Auth->user('id') != null) && isset($this->data['Product']
['user_id']))
{
$this->data['Product']['user_id'] = $this->Auth->user('id');
}
--~--~-
Thanks so much for all the hard work guys!
Special thanks to Mark Story, because bugs I reported were fixed the
next day by him. He's so fast! Thanks for all the hard work Mark!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Googl
$count = $this->find('count',array('conditions'=>
$data,'recursive'=>-1));
should be
$count = $this->find('count',array('conditions'=>array('state'=>
$data),'recursive'=>-1));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Assuming you want the currently logged in administrator.
$this->data['Product']['user_id'] = $this->Auth->user('id');
Otherwise, you'll need a belongsTo association in your Product model,
and allow scaffolding to show a user drop down list.
--~--~-~--~~~---~--~~
Router::connect('/users/:username',
array('controller'=>'users','action'=>'index'),array('pass'=>array('username')));
This routes /users/bobcostas to the function index( $username ) method
of the controller, with the username passed as a parameter.
Router::connect('/users/:username/:action',
arr
I've been debugging this code, and I'm confused as to how Routing is
suppose to work with named parameters.
In the Router.php file in the function mapRouteElements there is this
logic.
if (!strpos($route[0], '*') && (!empty($pass) || !empty($named))) {
return false;
}
This will return false f
I'm trying to create a custom route for my profiles controller located
in plugin. I need to pass the username as a named parameter, but it
doesn't seem to be working for me.
Router::connectNamed(array('username'));
Router::connect('/profiles/:username',
array('plugin'=>'gems','controller'=>'gemsP
Don't call your field "password" on the form, because the Auth
component always hashs posted data that has the field name as
"password".
For my user registration I created two fields called "secret" and
"confirmsecret", and I use this in the validate rules. It doesn't
matter that the secret field
Can this be installed into Zend Studio?
- Original Message
From: kiang <[EMAIL PROTECTED]>
To: CakePHP
Sent: Friday, May 23, 2008 12:05:59 PM
Subject: A small plugin for PDT&CakePHP - Open Cake File
http://sourceforge.net/projects/opencakefile/
http://opencakefile.sourceforge.net/
It
Assuming that your blocking their IP, because you think a hacking attempt is
taking place.
Usually, hacking attempts are performed by robots, and it wouldn't be hard to
have the robot retry every 5 minutes.
I think storing the IP address in the session isn't useful. If they fail to
login after
Thanks for the tip! :)
- Original Message
From: keymaster <[EMAIL PROTECTED]>
To: CakePHP
Sent: Thursday, May 22, 2008 10:01:19 AM
Subject: Re: Why CakePHP always uses var?
For symptomatic relief in Zend Studio:
- right click in the debug messages window,
- choose: Debug Message Fil
Thanks,
I think your right about the component being the way to go, but the manual
doesn't give much information about creating components.
How would I access the Document model from the component, and how would I pass
the pagination data to the view from the component?
Sorry if these are basi
The beforeFilter of AppController wasn't executed, because the class wasn't
instantiated. It wasn't instantiated because the controller didn't exist.
AppController is an abstract class that controllers extend. So if the framework
doesn't find a controller, then a Not Found error is the correct r
What are tags? and where can I find more info on this in the documentation?
Is this a feature of views or controllers?
- Original Message
From: Action <[EMAIL PROTECTED]>
To: CakePHP
Sent: Wednesday, May 14, 2008 3:15:17 PM
Subject: Re: Custom tags no longer working in 1.2 Beta...has s
http://book.cakephp.org/view/94/views#elements-97
- Original Message
From: benjam <[EMAIL PROTECTED]>
To: CakePHP
Sent: Wednesday, May 14, 2008 2:05:18 PM
Subject: Re: Including a menu on some pages but not all
Exactly what I was looking for.
Thanks.
On May 14, 11:56 am, Kyle Decot
A model will return false if there was an error, and an empty(false) returns
true.
If the model works, but finds no records, then I think it returns
array('Photo'=>array()) which is not empty.
- Original Message
From: Kyle Decot <[EMAIL PROTECTED]>
To: CakePHP
Sent: Tuesday, May 13,
You should be separating the index action, and the requested action.
try creating
function getPhotos()
{
return $this->Photo->findAll();
}
and calling that from your element.
- Original Message
From: Kyle Decot <[EMAIL PROTECTED]>
To: CakePHP
Sent: Tuesday, May 13, 2008 1:51:52 P
thanks, that was exactly what I needed.
- Original Message
From: Dan Bair <[EMAIL PROTECTED]>
To: CakePHP
Sent: Monday, May 12, 2008 5:16:42 PM
Subject: Re: Popup color picker.
Do you have a specific color picker in mind? There are plenty of good
color pickers for JQuery and Prototype
I do this by rendering my HTML header with an element, and then passing it
parameters from the controller.
- Original Message
From: MarcS <[EMAIL PROTECTED]>
To: CakePHP
Sent: Monday, May 12, 2008 3:45:23 PM
Subject: include CSS and Javascript into layout 'on demand'
Is it possible t
var $helpers = array('Form');
put that in your controller.
- Original Message
From: jaredonline <[EMAIL PROTECTED]>
To: CakePHP
Sent: Monday, May 12, 2008 1:52:12 PM
Subject: Fatal Error when using $form
Controller:
View:
Please Login
create('User', array('action' => 'login')); ?>
While this subject is open.
I would like to be able to download the manual, and read it offline. I find the
Cake website feeds out pages from the manual very slowly.
- Original Message
From: Esoteric <[EMAIL PROTECTED]>
To: CakePHP
Sent: Monday, May 12, 2008 1:48:19 PM
Subject: Re: Co
For cake 1.1.19.x
In your /app/config/routes.php file add the following.
$Route->connect('/sitemap.xml',
array('controller'=>'xml','action'=>'sitemaps','sitemap') );
- Original Message
From: deeps <[EMAIL PROTECTED]>
To: CakePHP
Sent: Monday, May 12, 2008 1:14:00 PM
Subject: Advanced
output, if its cli then its being invoked by the cron job
since you would use php cli to invoke console jobs. place a check at the start
of the controller
if (php_sapi_name() == "cli") {
// proceed
}
Thanks.
On Mon, May 12, 2008 at 9:18 PM, Mathew Nik Foscarini <[EMAIL PROTECTED]>
Well, wouldn't the remote address have the same IP address as the server? Then
again, I can't remember if $_SERVER is defined when running from the command
line?
if( $_SERVER['SERVER_ADDR'] === $_SERVER['REMOTE_ADDR'])
{
// the client has the same IP as the server.
}
Another approach would
http://framework.zend.com/manual/en/zend.pdf.html
- Original Message
From: Dr. Tarique Sani <[EMAIL PROTECTED]>
To: cake-php@googlegroups.com
Sent: Monday, May 12, 2008 11:13:21 AM
Subject: Re: Somebody konw any library for receive html code and generate
document pdf?
try html2fpdf
T
$data .="--$boundary--\r\n";
$header .= "Content-length: " . strlen($data) . "\r\n\r\n";
// Open the connection
$fp = fsockopen($remote_server, 80);
// then just
fputs($fp, $header.$data);
fclose($fp);
?&g
Thanks, I didn't know wget could do HTTP POST operations.
- Original Message
From: Marcin Domanski <[EMAIL PROTECTED]>
To: cake-php@googlegroups.com
Sent: Saturday, May 10, 2008 12:56:28 PM
Subject: Re: Sending POST to Cake website via PHP
Look at wget[1] /curl (its supported in all ma
Did you define your absolute paths using your /home/username account for your
web server?
Mine are setup something like this.
define('ROOT','/home/username/public_html');
define('APP_DIR','../../folder/cake_1_2.app');
define('CAKE_CORE_INCLUDE_PATH', '/home/username/folder/cake_1.2.0');
When yo
Hi,
Your very close. You have everything setup correctly, but your trying to find
the project the wrong way.
$this->Project->findall(array('Task.id' => 1));
A project has many tasks, but a task belongs to just one project and just one
user.
So, if you have the task.id and you need the project
Have you looked at the PHP port of Apache Lucene from Zend.
http://bakery.cakephp.org/articles/view/integrating-zend-framework-lucene-with-your-cake-application
http://framework.zend.com/manual/en/zend.search.lucene.html
http://lucene.apache.org/java/docs/index.html
- Original Message
I switch a site from 1.1.19 to 1.2 a month ago. Mind you, it was still in
development and not that big.
I had to modify the database description, the core parameters, and the caching
has changed. Other then that. I didn't have to much of a problem.
Give it a try in a safe sandbox area of your s
Thanks guys,
Yes, I keep my core separated from my app.
I keep everything in my own SVN repository, but it's been a while since I
updated my build of Cake 1.2.
- Original Message
From: Sliv (Tim MacAleese) <[EMAIL PROTECTED]>
To: CakePHP
Sent: Thursday, May 8, 2008 2:33:19 PM
Subject
I hope this isn't a stupid question, but how can I check what version of Cake
1.2. is installed?
I also need to update my Cake 1.2 install with the latest version. When copying
files over top my existing install which files should not get modified? are
there any I should worry about, or is
I'm switching from the default auth component to the DarthAuth component. Looks
like it has everything you could need without the overhead of ACLs.
- Original Message
From: Louie Miranda <[EMAIL PROTECTED]>
To: cake-php@googlegroups.com
Sent: Thursday, May 8, 2008 1:28:19 PM
Subject: Wh
101 - 141 of 141 matches
Mail list logo