Re: What's wrong with pagination sorting?

2009-10-20 Thread Cristian Cassina
Thanks Will, I didn't know this and find it useful, having my troubles, from time to time, with pagination. Cristian Will Poillion ha scritto: > Ok, I found the problem everyone. > > For anyone also having this problem, it is the default pagination. > > var $paginate = array('limit' => 100, 'pa

Re: What's wrong with pagination sorting?

2009-10-20 Thread Will Poillion
Ok, I found the problem everyone. For anyone also having this problem, it is the default pagination. var $paginate = array('limit' => 100, 'page' => 1, 'sort' => 'name', 'direction' => 'asc'); If you set a default sort and direction in your controller, all of your sorting will only work in one

What's wrong with pagination sorting?

2009-10-20 Thread Will Poillion
I've been pulling my hair out on this for a while now, and it just seems like the pagination sorting isn't working correctly. Using the defaults views/controllers created by cakebake, I get these headers in my view and this index function in my controller. sort('name');?> sort('cas_num');?>

Re: Bug report: CakePHP saving twice

2009-10-20 Thread Ma'moon
You may want to open a ticket @ https://trac.cakephp.org/ stating the steps to reproduce your claims so that the core DEVs may review it and fix it. On Wed, Oct 21, 2009 at 12:32 AM, Rawna wrote: > > I just found out that CakePHP saving twice when I have warnings (as I > saw it in debug.log) > E

Bug report: CakePHP saving twice

2009-10-20 Thread Rawna
I just found out that CakePHP saving twice when I have warnings (as I saw it in debug.log) E.g. I have $this->Model->save() in my controller And I have this in my default.ctp template: I think CakePHP is going through the controller action again when a warning caused by the above is present. --

submit throttling?

2009-10-20 Thread calzone
Has anyone worked on an app-level component that can help prevent a flood of submissions on a server? Ideally, such a system would prevent the same person from submitting more than x actions where there is database writing per minute --not just for a single action, but across the entire applicati

Your opinions about a Super Cake application library

2009-10-20 Thread CapeTownGuy
To the cake reader... What do you think of creating a super cake installation somewhere that can be downloaded but that has all kinds of pre installed controllers, views, models, components, helpers, vendors etc (and comprehensive schema to support all of this) so that one could literally cut a

Re: E-mail validation without model

2009-10-20 Thread Dr. Loboto
I think better create model (without table) even if you'll use it only for this validation. The only other "native" way I see is use multivalidate behavior with some of already existing model - but only if there is any model that logically connected with this action. http://bakery.cakephp.org/art

Object not found

2009-10-20 Thread QJ
I just started using CakePHP using this tutorial from IBM... I have the cake directory in localhost/cake I access a simple register.thtml from http://localhost/cake/users/register When I click the register button, the browser gives me an 'Object not found' error. The address in the address bar a

Re: Jquery JSON Ajax Callback Not Working

2009-10-20 Thread hahmadi82
Can someone please help me with this? hahmadi82 wrote: > > I'm trying to write a simple JSON post and the callback alert does not > show up no matter what I do. I used firebugs to see if the post was > getting any response and "SHOE" returns. So why is the alert not working > in the callback

Re: DboSource->query() increases memory unlimitedly

2009-10-20 Thread Sho Shimauchi
On Oct 20, 6:32 pm, AD7six wrote: > On 20 oct, 10:56, Sho Shimauchi wrote: > > > > > On Oct 15, 3:58 pm, AD7six wrote: > > > > On 15 oct, 00:01, Sho Shimauchi wrote: > > > > > My Program's memory usage increses when Model->query() is called. > > > > I found out that a cacheDboSource->_queryC

Re: Posts and Votes total, hasOne + COUNT relation?

2009-10-20 Thread Fabian
Yeah I'm trying to do the same thing. If you find a solution please post it thanks. On Oct 7, 1:40 pm, fael wrote: > Hello > I'm coding this reddit-like clone and so far, so good, just I want to > show how many ups and how many downs are by post in the index. > Something like this: > Up (20) | D

Re: Error on a fresh install

2009-10-20 Thread choumy
Hi can you please share your code so i can try help you? 2009/10/21 Vincent > > Hi, > > I'm new on CakePHP, but I'm an experimented web developer and I used > lost of frameworks. > > I just installed CakePHP 1.3 and configured it. > On the cake homepage I got all checks green. > My apache seems

Error on a fresh install

2009-10-20 Thread Vincent
Hi, I'm new on CakePHP, but I'm an experimented web developer and I used lost of frameworks. I just installed CakePHP 1.3 and configured it. On the cake homepage I got all checks green. My apache seems properly configured with mod_rewrite. Then tried made a simple test inspired from the blog t

ajax and auth component: logs out when multiple ajax requests are made

2009-10-20 Thread bMilesp
Hello, i have 2 ajax requests (SWFUpload and a jquery imageScroller plugin). when i do one of the two requests, works fine. When i do the other request, the session is never set and it logs out. I have Security.level = 'medium' in core.php. the cookie is sent in both request headers; i can debug

Re: "Notice (8): Undefined index: 0" When attempting to place custom element

2009-10-20 Thread StkMtd
Thanks John. I used debug() and I was receiving the values I expected. I realized that $this->params wasn't holding anything on the two problem cases, so I added an additional if wrapping the first 3 checks: if (isset($this->params['pass']['0'])) { if ($this->params['pass']['0'] == 'hom

HABTM single row

2009-10-20 Thread ark0n3
Hi many thanks to all members, you represent an invaluable support for worldwide CakePHP developers! This is my problem: i'm trying to create a new HABTM row, in a "Course" view I coded echo $form->create('Course', array('url' => array('action' => 'view', $course['Course

Select box save data problem

2009-10-20 Thread kangur91
Hey. I just want to save data from select multiply, it's a select: select('Files.name',$files,null, array ('multiple'=>true,'label'=>'Files:','class'=>'text ui-widget-content ui-corner-all','style'=>'width: 700px')); ?> Here data i send to controller: Array ( [name] => Array ( [0] => cos1.pdf [1

Best method for storing images?

2009-10-20 Thread Will Poillion
I'm developing a 3-tier inventory system, and wondering what's the best way to store the images for them. Composites hasandbelongstomany Inventory Inventory hasandbelongstomany Ingredients And Composites,Inventory, and Ingredients hasmany images associated with each. I'm a noob, so I'm asking f

RE: Where request comes from?

2009-10-20 Thread Dave Maharaj :: WidePixels.com
I was wondering if this makes sense: if ($this->RequestHandler->isAjax()) { $request_from = $this->RequestHandler->getReferrer(); if ($request_from != 'www.mysite.com'){

Re: Custom Authentication

2009-10-20 Thread xtraorange
Thanks! I had read about the auth system before hand and understood it, but I was at a loss as to how to contort it to work with my user level system. After re-reading the ACL instructions I think I can see how that would work for what I want to do once I get the hang of them. I appreciate your

translate behaviour

2009-10-20 Thread HK
Hello. I have a site with an english and a greek language. I use the traslate behaviour as: class Position extends AppModel { var $name = 'Position'; var $actsAs = array( 'Translate' => array( 'description' => 'descTranslate',

Re: Admin Controller

2009-10-20 Thread adam
I always thought the same thing as Dave, but finally gave up because there is no other sensible solution. I never thought to put common methods in app_controller!! I'm so glad I opened this thread, because this just made cake so much more elegant for me. On Oct 20, 11:55 am, "Dave Maharaj :: Wi

Re: Design Pattern == Erroneous?

2009-10-20 Thread adam
@Amit: I thought the same thing, but you can't really return something to the browser from a Component @j0n4s: It's not speed, it's having one controller that handles typical generic requests, so that you don't have ajax_* actions in 15 or so different controllers Adam On Oct 20, 7:56 am, "j0

Re: "Notice (8): Undefined index: 0" When attempting to place custom element

2009-10-20 Thread John Andersen
Try to put a debug($this->params) before you use it, so you can confirm that there are the values and indexes that you expect! Enjoy, John On Oct 20, 8:18 pm, StkMtd wrote: > Cake Version: > 1.2.5 > > Environment: > Apache and MySQL on localhost > > Summary: > I'm creating a nav element to si

"Notice (8): Undefined index: 0" When attempting to place custom element

2009-10-20 Thread StkMtd
Cake Version: 1.2.5 Environment: Apache and MySQL on localhost Summary: I'm creating a nav element to simplify the code on my main layout. Details: The nav element first checks which controller is active, or which page in the pages controller. It then assigns an integer value to the variable $p

RE: Admin Controller

2009-10-20 Thread Dave Maharaj :: WidePixels.com
Yeah the added model strain I figured as much. Low down on my problem. User has 5 HABTM relations. Normally you edit all the user info in 1 call admin_edit in user controller. But I have broken the info into sections for each HABTM, I managed to write 1 function that will updated each HABTM so th

Re: creating layout with multiple view

2009-10-20 Thread kamiseq
ok, Ill try that as well, thanks On 20 Paź, 15:16, m-e- wrote: > On 20 oct, 14:42, kamiseq wrote: > > > ok but you think more about inserting element(s) into layout that is > > not depending on action - so you will add element that acts as a menu > > or stuff > > Actually you can use in the lay

Re: Admin Controller

2009-10-20 Thread Jon Bennett
Hi Dave, > create an admin_controller and keep all admin functions separate from the > other controllers? Personally I wouldn't. Have a look at the Cookbook source, this is what I follow - all admin methods except special cases go in app_controller, streamlines things a lot. Cheers, Jon -- j

Re: Associated models in paginate results...

2009-10-20 Thread Jamie
Hi, I suggest that you use Containable behavior: http://book.cakephp.org/view/474/Containable Using Containable instead of recursive gives you more control over what is returned in your queries. I would suggest putting Containable in your AppModel and setting recursive to -1. I do this: Class

Re: Admin Controller

2009-10-20 Thread Jamie
I don't think you should put your admin functions in their own controller. First, having a separate admin controller means that, instead of just loading one primary model per controller, you'll be stuck handling a ton of models within that one controller, which could get messy and almost certainl

Re: help with using schema after to preload the database

2009-10-20 Thread azeckoski
It would also help if anyone can point me to any examples of loading data in the schema before and after methods. -AZ On Oct 17, 8:38 pm, azeckoski wrote: > I am using the schema shell stuff (cake schema) to generate tables in > the database but I would like to also preload the tables with some

Re: Associated models in paginate results...

2009-10-20 Thread ilcaduceo
Yeah recursive was the problem! Thanks for solution, now i have resolved... Bye! On 20 Ott, 17:46, Céryl wrote: > Try using recursive = 1, I think recursive = 0 specifically only finds > properties itself. recursive = 1 lets the model go one iteration > deeper and also get the associated images

Re: Custom Authentication

2009-10-20 Thread persianshadow
and for user level and complex system use ACL Component: http://book.cakephp.org/view/171/Access-Control-Lists On Oct 20, 12:20 pm, xtraorange wrote: > Howdy all, > > I'm brand new to CakePHP (and MVC frameworks for that matter), but > perfectly comfortable with php and mysql. > > For a number

Re: Custom Authentication

2009-10-20 Thread persianshadow
Authentication in cakephp: 1 - you must build users table in database (Default) that contain username and password fields (you can change these fields). 2 - in your controller add Auth component : var $components=array('Auth'); 3 - add two functions in your controller : function login(){}

Re: Associated models in paginate results...

2009-10-20 Thread Céryl
Try using recursive = 1, I think recursive = 0 specifically only finds properties itself. recursive = 1 lets the model go one iteration deeper and also get the associated images On 20 okt, 17:18, ilcaduceo wrote: > Hi, I have two models > > Properties HasMany Images > Images BelongsTo Properties

Admin Controller

2009-10-20 Thread Dave Maharaj :: WidePixels.com
Can you, or suggest , reasons for or not to create an admin_controller and keep all admin functions separate from the other controllers? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Find queries, select fields, and arithmetic: possible DboSource bug?

2009-10-20 Thread Jamie
OK, so I'm building a find query that needs to use simple arithmetic within the fields that are selected, and then assign the result of the arithmetic to an alias. Wow.. that was a pretty obscure sentence. :) Here's what I mean (the statement is simplified but the important part is there): $this-

Associated models in paginate results...

2009-10-20 Thread ilcaduceo
Hi, I have two models Properties HasMany Images Images BelongsTo Properties In the index controller method I have this code: $this->Property->recursive = 0; $this->set('properties', $this->paginate(null, $filters)); But in the array $properties, result of paginate in the view, there aren't ass

Re: controller problem

2009-10-20 Thread Céryl
First, the thing I notice is that controllers must be the plural of the models, so the calss should be called FreeTextsController... $name should also be 'FreeTexts'. It should then also be saved as free_texts_controller.php. If you don't use a model, I'd like to add $uses = null just to be safe.

E-mail validation without model

2009-10-20 Thread Céryl
Hello all, On my site I have a contact page (which is just pages/contact, with a small form where users can enter their name and some text. After clicking the button, an action in my controller (Actually a loose controller called mails_controller, without views and a model) is done which sends th

Re: creating layout with multiple view

2009-10-20 Thread m-e-
On 20 oct, 14:42, kamiseq wrote: > ok but you think more about inserting element(s) into layout that is > not depending on action - so you will add element that acts as a menu > or stuff Actually you can use in the layout all the variables passed by the controller to the view. So some parts of t

controller problem

2009-10-20 Thread alex
layout = "club_free_text_layout"; } } ?> $Route->connect('/free_text',array('controller'=> 'freetext','action' => 'index')); please can anyone tell me why when i visit the /free_text i get Not found The requested address index was not found on this server. and when i visit fre

Custom Authentication

2009-10-20 Thread xtraorange
Howdy all, I'm brand new to CakePHP (and MVC frameworks for that matter), but perfectly comfortable with php and mysql. For a number of years I have hand written and reused my own authentication systems, which have worked fantastically for me. Now that I've found the benefit of CakePHP, I'd rea

Re: Howto disable redirect to login view on main page?

2009-10-20 Thread jayarjo
I think that's exactly what I've imagined. Thanks :) On Oct 20, 1:43 pm, Céryl wrote: > No worries, > > A slow day at uni makes me want to hang around here... > > Anyway, to answer your question, The '*' just means "allow all". In > the pages controller, I guess just 'display' does the trick, si

Re: Design Pattern == Erroneous?

2009-10-20 Thread j0n4s.h4rtm...@googlemail.com
I would not want to break the basic MVC paradigm because I just can, though I admin thinking about live validation (of form fields) to add some additional php file like ajax.php which handles some model construction and validation checking without ever running a full cake stack. Besides that I won

Re: creating layout with multiple view

2009-10-20 Thread kamiseq
ok but you think more about inserting element(s) into layout that is not depending on action - so you will add element that acts as a menu or stuff Im trying to figure out the way to have layout with "holes" (and like now with one "hole" - that is $content_for_layout) that will be populated with

Re: Ordering tree

2009-10-20 Thread Aurimas
well it is working now, and i think i found a bug. Whend var $cacheQueries = true; is defined in model with tree behaviour script halts server, xdebug report: Fatal error: Maximum function nesting level of '100' reached. On Oct 20, 12:11 pm, Aurimas wrote: > How can i order  "MPTT" tree? I am us

HABTM in 1.2.5?

2009-10-20 Thread Mukhamad Ikhsan
Is in this version there still not any configuration (adding parameter) to save function on HABTM relation type? on the default, the model->save on HABTM function is replace the records...delete and insert, not update without delete (just adding), i've just read the article http://bakery.cakephp.or

Re: Design Pattern == Erroneous?

2009-10-20 Thread Dr. Loboto
I use same actions for all types of requests. Not "ajax_save" but just "save". On Oct 20, 8:23 am, adam wrote: > Hey all, > > Curious about a design pattern I schemed up while daydreaming at work > today.  Instead of littering every controller with actions that are > used for standard ajax reque

Re: creating layout with multiple view

2009-10-20 Thread Ma'moon
Nope, you can change the layout the way you want, all you have to do is just specifying the layout that you want in your controller, for instance, $this->layout = 'admin' then that would call the admin layout inside your app/views/layouts directory and apply all the renders in that layout, if you d

Re: Howto disable redirect to login view on main page?

2009-10-20 Thread Céryl
No worries, A slow day at uni makes me want to hang around here... Anyway, to answer your question, The '*' just means "allow all". In the pages controller, I guess just 'display' does the trick, since that is the action that is available in that controller... In all my other controllers I indee

Re: Help - Can't write the SQL query in CakePHP style

2009-10-20 Thread logout
Oh, I tried with the Containable behavior, but without any luck... On Oct 16, 11:04 am, "Dr. Loboto" wrote: > Not any helpful reply, but... your query will work with "Invoice > hasOne Writedown". > And you can try Containable > behavior:http://book.cakephp.org/view/474/Containable > > On Oct 15

Re: Help - Can't write the SQL query in CakePHP style

2009-10-20 Thread logout
Yes, I noticed that, but it is a typo. In the original source the second variable is wd_amount. :) Thanks anyway :) On Oct 16, 8:02 am, Bert Van den Brande wrote: > Don't know if it helps but you map two sums to the same column alias > 'amount' , I think you should make them unique ... > > > > O

Re: DboSource->query() increases memory unlimitedly

2009-10-20 Thread AD7six
On 20 oct, 10:56, Sho Shimauchi wrote: > On Oct 15, 3:58 pm, AD7six wrote: > > > > > On 15 oct, 00:01, Sho Shimauchi wrote: > > > > My Program's memory usage increses when Model->query() is called. > > > I found out that a cacheDboSource->_queryCache is not flushed in > > > source code. > > >

Re: Howto disable redirect to login view on main page?

2009-10-20 Thread jayarjo
I guess I got to get used to Google Groups as well :) I thought Reply to Author creates a branch of discussion. I was wrong :) Céryl, it worked. Thank you very much! On Oct 20, 1:17 pm, Céryl wrote: > To elaborate on this... > > Assuming your main page is the standard static page in /pages/ > h

Pagination ancd checkboxes

2009-10-20 Thread Cristian Cassina
Hello everyone, I have a little problem. I paginate results from a query. Every row, in the view, has a checkbox so that I can choose multiple rows (actually orders), submit them and have a resume with the total hours needed to complete them, materials used and quantities and so on. The problem

Re: creating layout with multiple view

2009-10-20 Thread kamiseq
I thought that layout can be populated only by view that is releted to action that is executed in controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-

Re: Howto disable redirect to login view on main page?

2009-10-20 Thread Céryl
To elaborate on this... Assuming your main page is the standard static page in /pages/ home.ctp, you need to copy the pages_controller from /cake/lib/ controllers in the /app/controllers folder, and add the allow line from Persianshadow. In my case, my static pages are always visible for everybo

Ordering tree

2009-10-20 Thread Aurimas
How can i order "MPTT" tree? I am using tree behaviour and currently data is ordered by "lft" field. I want to reorder tree by name (ASC) Was trying $this->Cat->reorder(array('field' =>'Cat.name'); And it generates query: SELECT `Cat`.`id`, `Cat`.`name`, `Cat`.`lft`, `Cat`.`rght` FROM `cats` AS

Re: Howto disable redirect to login view on main page?

2009-10-20 Thread persianshadow
you must use this method in BeforeFilter function: $this->Auth->allow('index'); On Oct 20, 11:48 am, Davit Barbakadze wrote: > Still not confident on this platform. It could be that the answer is > self-obvious, but just can't get my mind around it just yet. > > I want my main page to be loa

Re: Uploadify and lost session

2009-10-20 Thread
I soled the problem. do it , follow these step 1. get session_id by anyway 2. set script : 'some url'+session id , like $.ajax({ url : 'sessions/getID', dataType: 'text', type: 'POST'

Re: DboSource->query() increases memory unlimitedly

2009-10-20 Thread Sho Shimauchi
On Oct 15, 3:58 pm, AD7six wrote: > On 15 oct, 00:01, Sho Shimauchi wrote: > > > > > My Program's memory usage increses when Model->query() is called. > > I found out that a cacheDboSource->_queryCache is not flushed in > > source code. > > >https://trac.cakephp.org/browser/trunk/cake/1.2.x.x/

Online PO EDITOR for cake

2009-10-20 Thread lacenaepro...@gmail.com
HI, I already tried entrance but it's not waht I'm looking for. I wonder if anyone has already developed an ONLINE VERSION OF POEDIT to use with cake structure. I can't understand why this tool would be useful only for me... Any help? Tnx Dario --~--~-~--~~~---~

Howto disable redirect to login view on main page?

2009-10-20 Thread Davit Barbakadze
Still not confident on this platform. It could be that the answer is self-obvious, but just can't get my mind around it just yet. I want my main page to be loaded despite of user authentication status. Then I get additional content via Ajax, which should then depend on whether user has been authe

cakePHP Person in NYC

2009-10-20 Thread amin
Hi All. My name is Amin and I was was wondering if any of you in the city will be interested in helping out with localfeedr, www.localfeedr.com, if you have some free time and or looking for a project to work on please email me directly, I would love to meet with you in person and tell you more a

Re: Uploadify and lost session

2009-10-20 Thread
I get the same problem , but I couldn't solve this..sor... Someone else could help us? On 10月16日, 上午7時35分, bondo wrote: > I really hope someone can help me. I've been struggling with this > problem for a long time and can't seem to figure it out. > > I'm usingUploadifyto handle file

Cakephp + uploadify(jQuery plugin), Auth Session missed!?

2009-10-20 Thread
Demo URL: http://www.ccmos.co.cc/samples/cakephp/fileuls (test / test) Source Code: http://www.ccmos.co.cc/samples/cakephp.test.20091020.tar.gz ( Run on Ubuntu Linux 9.04 ) (1) in FireFox 3.5 Login → Browse → upload a.→ if uploader Action is not allowed → nothing happened after process