Paginating an associated model

2012-07-04 Thread Ronen Amiel
Hey everyone, I have a page in my application where I show information about 1 category and all of it's products (category hasMany product, product belongsTo category). I have been using a call to $this-Category-find() supplying it with conditions and containments to get something like that

Re: Method from controller is not mapped

2012-07-04 Thread tigr
I would think that since your host name is just a single word, perhaps cake may get confused by your urls sometimes. Why don't you try to rename the host into 'ServerName mysite.local'? That would make the urls look much more 'normal'... On Tuesday, July 3, 2012 7:34:55 PM UTC+2, c05min wrote:

Re: syntax error, unexpected T_CLASS

2012-07-04 Thread tigr
vim is your friend :) On Tuesday, July 3, 2012 3:45:48 PM UTC+2, David Lozzi wrote: Holy sucky-IDE Batman! That worked!! GAH that's frustrating. I'm using Komode Edit for my IDE, which obviously didn't pick up on that. What IDE do you use? -- Our newest site for the community: CakePHP

Re: Login problem

2012-07-04 Thread tigr
Accordsing to documentation, it should be array('authorize' = 'Controller'), and not 'authorize'=array('Controller'), Could this be the problem? On Tuesday, July 3, 2012 5:34:51 PM UTC+2, Paulo Victor wrote: I don't know what do do anymore. My login system is up and runnig, but no matter

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-04 Thread Tom Cowle
Thanks Max, this is the first thing I tried, but it didn't seem to work. On Tuesday, 3 July 2012 17:10:38 UTC+1, Max Dörfler wrote: Hi, have you tried copying the core CakeRequest.php to app/Lib/Cake/Network/CakeRequest.php and do your changes there? I think I remeber doing something

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-04 Thread Tom Cowle
Thanks Stork - looks good to me - will give it a try - thanks very much. Tom On Tuesday, 3 July 2012 17:26:25 UTC+1, stork wrote: Just change last line of APP/webroot/index.php and call dispatcher with your custom request class. #APP/Lib/Network/AppRequest.php App::uses('CakeRequest',

Re: How can I add months to a date?

2012-07-04 Thread Mike Griffin
On Wed, Jul 4, 2012 at 6:29 AM, Steven Scaffidi ssca...@gmail.com wrote: I want to be able to add a certain amount of months to date. Basically I have a from in order to start a new product. In the form, there is a begin date that the user select (this is a date). I want to add a variable

Re: Login problem

2012-07-04 Thread Paulo Victor
Hum, right. I checked and this is the correct. But the problem remains. Aparently i have to keep reading the most recent docs. Must be something like that. 2012/7/4 tigr alb...@tigr.net Accordsing to documentation, it should be array('authorize' = 'Controller'), and not

add 2 records in i18n for a new record

2012-07-04 Thread marcogo
hi i want to add a multiple lines (ita eng) in i18n for one record in jewel so i add a afterSave in model cause i want to add multiple lines only for a new record and not for a modify one i add this public function afterSave($created) { if ($created) { if (isset ($this-data['Jewel']['eng']))

Re: Biiling System with Cakephp

2012-07-04 Thread Matt Murphy
All the interface stuff you described is going to be JavaScript. All the backend stuff can be most anything you like. I suspect the Javascript Framework that fits best with what you describe is EXTJS, though perhaps someone else has a better suggestion. If you want to use cakephp as the

Re: How can I add months to a date?

2012-07-04 Thread Steven Scaffidi
This is what I have going on. $con_period = ceil($d['Option']['con_period']); $ebegin_date = strtotime(+$con_period months, strtotime($d['Project'][ 'begin_date'])); $ebgin_date = date('Y-m-d', $ebegin_date); $d['Expense']['0']['begin_date'] = $ebegin_date; This is what $d looks like

Re: AuthComponent, set userScope in appController

2012-07-04 Thread Lucas Simon Rodrigues Magalhaes
Thaks. Solved Em terça-feira, 3 de julho de 2012 18h32min58s UTC-3, cricket escreveu: On Tue, Jul 3, 2012 at 8:31 AM, Lucas Simon Rodrigues Magalhaes lucass...@gmail.com wrote: The error appear in this line: 'scope' = array('User.status' = Configure::read('User.ACTIVE')), And on that

ModelValidator fails on SaveAssociated in Plugin

2012-07-04 Thread tigr
Hi! There is something I do not understand. I have a plugin where I save some data into related models. When I do it with a Save, everything works fine. As soon as I try to use SaveAssociated, I get this error (and it is interfering of course with the headers). Can someone confirm that this is

Re: Paginating an associated model

2012-07-04 Thread bberg
although each *product* shows data for *category*, cake makes only 1 db request for the whole page upon *paginate*(). so i wouldn't worry about it. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site

Memcached or Redis

2012-07-04 Thread baur79
Hi, i plan to implement data caching in my project, please suggest me, which to use Memcached or Redis (with simple comments) thanks in advance -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org

Re: Method from controller is not mapped

2012-07-04 Thread lowpass
Cake has nothing to do with the domain, that's Apache's business. On Wed, Jul 4, 2012 at 3:46 AM, tigr alb...@tigr.net wrote: I would think that since your host name is just a single word, perhaps cake may get confused by your urls sometimes. Why don't you try to rename the host into

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-04 Thread lowpass
I think this is what you want: http://api20.cakephp.org/class/cake-request#method-CakeRequestaddDetector On Wed, Jul 4, 2012 at 4:25 AM, Tom Cowle tom.co...@gmail.com wrote: Thanks Max, this is the first thing I tried, but it didn't seem to work. On Tuesday, 3 July 2012 17:10:38 UTC+1, Max

Re: Generating KML pages

2012-07-04 Thread Jaime
Try this function beforeFilter() { $this-RequestHandler-setContent('kml', 'text/xml'); // $this-RequestHandler-setContent('kml', 'application/vnd.google-earth.kml+xml'); } On Thursday, September 24, 2009 7:01:18 AM UTC+2, Kyle Decot wrote: I am attempting to create KML pages for my site but

Finding an user with a field from associated data ?

2012-07-04 Thread JonStark
Hi everyone ! I have a question that shouldn't be that hard but I really can't manage it : In my app, User HABTM User users_users table is : id, following_id, follower_id I want to count every user where follower id is $id. This is my function : public function countFollowing($id) { $user =

Re: Finding an user with a field from associated data ?

2012-07-04 Thread lowpass
Because your User table has no such column. Try running the find on the associated model. $this-User-UserUsers-find(...) On Wed, Jul 4, 2012 at 2:38 PM, JonStark jean...@gmail.com wrote: Hi everyone ! I have a question that shouldn't be that hard but I really can't manage it : In my app,

Re: Date picker for CakePHP 2.0.3

2012-07-04 Thread kebuno
Just want to say: Many thanks guys!!! Le mardi 29 novembre 2011 11:03:06 UTC+1, Florin Trifu a écrit : Hi I need to implement a date picker into my application. I have found this tutorial: http://bakery.cakephp.org/articles/agusti/2010/02/02/transparent-datepicker-with-jquery but

cakePhp showing menu or login form

2012-07-04 Thread Chris
I am the beginer in cakePhp. I have a problem. My website has one div, and inside of it it has to show menu or login form (depends on user login). Where can I do it? It is repeated in all pages. I think, that I should create this in layout, to not repeat it in every view, but really havo no

Re: CakeDC Search plugin for CakePhp 2.0, multiple models

2012-07-04 Thread Julio Quinteros P.
oops, my message was meant to you Bob, sorry * * *Hi. Recently I had to face this same issue, but with cakephp 1.3 * *Did you read the README.txt that came along cakedc search plugin? with that as a starting point, I was able to build a search box where I ask not only fields related to

Re: cakePhp showing menu or login form

2012-07-04 Thread lowpass
I would create two elements, menu.ctp and login_form.ctp, and load either based on whether the person is logged in. if ($this-Session-read('Auth.User')) { echo $this-element('menu'); } else { echo $this-element('Users/login_form'); } On Wed, Jul 4, 2012 at 3:01 PM, Chris

Re: Finding an user with a field from associated data ?

2012-07-04 Thread JonStark
Thanks for the advice, but when I tried this, it returned : Call to a member function find() on a non-object for this code : public function countFollowing($id) { $user = $this-User-UserUsers-find('all', array( 'conditions' = array( 'follower_id' = $id ), )); debug($user); } Any

Re: Finding an user with a field from associated data ?

2012-07-04 Thread lowpass
Is your User model associated with UserUsers? You said that User HABTM User. What is the alias you're using for that? UserUsers? And is this function in the controller or model? If model, then $this-UserUsers-find() On Wed, Jul 4, 2012 at 5:12 PM, JonStark jean...@gmail.com wrote: Thanks for

Re: Finding an user with a field from associated data ?

2012-07-04 Thread lowpass
No wait -- that won't work. Which table has the follower_id column? And what do your associations look like? On Wed, Jul 4, 2012 at 5:32 PM, lowpass zijn.digi...@gmail.com wrote: Is your User model associated with UserUsers? You said that User HABTM User. What is the alias you're using for

Re: Finding an user with a field from associated data ?

2012-07-04 Thread JonStark
My User Model : class User extends AppModel { public $name = 'User'; public $hasAndBelongsToMany = array( 'Following' = array( 'className' = 'User', 'joinTable' = 'users_users', 'foreignKey' = 'follower_id',

Re: Finding an user with a field from associated data ?

2012-07-04 Thread lowpass
Then you should only need to do: return $this-Following-find('count'); That's if the method is in your model. If in the controller, $this-User-Following ... On Wed, Jul 4, 2012 at 5:43 PM, JonStark jean...@gmail.com wrote: My User Model : class User extends AppModel { public $name =

Missing Controller

2012-07-04 Thread Luke
Hi everyone, I'm new to cake. I've installed Cake into a subdirectory (http://server.com/my-admin/), and it's all working well! However, when I access the site via https instead of http I get an error: Missing Controller *Error: **My-adminController* could not be found. *Error: *Create the