Caching not working

2008-04-17 Thread Andres Monroy-Hernandez
As a follow up to a discussion with some people in #cakephp, here I am posting a problem I'm having with caching. Since my site was featured on cakephp.org I've been getting even more traffic so caching would be greatly appreciated :) In in core.php I have: define('CACHE_CHECK', true); In my

Re: single view for multiple controllers

2008-04-17 Thread damo
thanks for your replies. I will probably just go with the simple render option as this seems ridiculously easy to do! What would be the benefit of using the (slightly) more complicated elements option? I am also trying to figure out how to modify multiple records with a single form. I see

delete or update habtm

2008-04-17 Thread .
How do you do a delete or update a row in a HABTM table in cake 1.2? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

Re: Caching not working

2008-04-17 Thread Adam Royle
If you are trying to cache your homepage view eg /, you'll find this doesn't work (with older cakephp installs). Newer versions (at least in 1.2) allow this. The problem is caused by the method used to generate the cache filename, as described here.

Re: Deleting AROs

2008-04-17 Thread Langdon Stevenson
I just realised that I forgot to mention that I am using Cake version 1.1.19.6305 Langdon Langdon Stevenson wrote: Hi, I have just resolved a small ACL issue, but am interested to know if there might any problems with what I have done. If I delete a use in my application I also need

Does Acl-deny() work in Cake 1.1.19.6305?

2008-04-17 Thread Langdon Stevenson
I have been trying to use the Acl-deny() function (with database stored ACL) to remove a user's access to certain actions in my application. However deny() appears to allow rather than deny access. After about an hour of fiddling and reviewing log output I manually changed all permissions

Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread orbdex
Hey there, we're using the afterFind()-Method in one of our models. Works fine. But there is one admin action where we do not want to call this method. Which would be the best practise to do that? Setting a variable of the model within the controller's action? Thanx for all replies

Re: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread orbdex
again: forgot the version: cake 1.2 latest beta --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send

Re: Twitter Component

2008-04-17 Thread strangy
Well, I'm using the 1.2.x.x branch not the nightly. And maybe I written it wrongly, because English is not my primary language, but for the basic/Basic stuff I meant to say that I changed from basic to Basic. If you don't have git you can just copy it from here

Re: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread avairet
Hello, Some solutions... - test a special field (or value) into $results in afterFind(), a field (or value) that is only fetch by your special action's find() - create a custom find() method in your model and call it from your controller's special action (for example: $this-MyModel-

Re: newbie how to update a row with 2 primary keys

2008-04-17 Thread grigri
CakePHP does not support composite primary keys. This has been discussed at length. Just add an auto-incrementing column to your table and make that the primary key [ change your primary key index to a unique index first ]. How do I delete a row? I cannot seem to do $this-FoodCategory-del($id)

Re: single view for multiple controllers

2008-04-17 Thread Femi Taiwo
Um. I practically rolled on the floor when I saw the one-liner that did what you wanted. The method I gave was a case of using shot-gun to kill a fly.(w.r.t the case in view) That method allows you to create reusable elements in cake. Consider for example that you want to have

Re: zend studio and cakephp - jump to function source

2008-04-17 Thread Dardo Sordi Bogado
Yes, also there is an article in the bakery from Mariano showing how to set up Eclipse. Following it, plus some threads in this group I've made eclipse to autocomplete controllers, helpers, components and models methods. But as Silv says, this has been discussed many times in this group. On

Re: Curious model related bug - server stops responding

2008-04-17 Thread MonkeyGirl
After a *lot* of trial and error, I've finally fixed this! What was happening was this: App::import('Model', 'Person'); Was, through a long winded bunch of entity-relationship type associations, making CakePHP read in my Categories model. $this-PersonTemp = new Person(); # This conflicts

Re: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread Dardo Sordi Bogado
I wolud go with making a behavior, and enabling/disabling it, but if a simple variable fits your needs the go for it. On Thu, Apr 17, 2008 at 7:41 AM, avairet [EMAIL PROTECTED] wrote: Hello, Some solutions... - test a special field (or value) into $results in afterFind(), a field (or

Re: Can I limit access to the captcha action in my controller?

2008-04-17 Thread k10
You can check the HTTP_REFERER from the _SERVER array against the url of your view as provided in the snippet below or you can strip out the server name from the HTTP_REFERER and compare it against. Feeding direct url of the captcha action will redirect the user to ur main page. $base =

Re: single view for multiple controllers

2008-04-17 Thread Sourabh Sharma
Render is very useful if you are using a same view with different controller Thanks Regards Sourabh Sharma On Apr 17, 11:34 am, damo [EMAIL PROTECTED] wrote: thanks for your replies. I will probably just go with the simple render option as this seems ridiculously easy to do! What would be

Json format

2008-04-17 Thread inma
Into a Uer model, I have a field named cod_serial defined as varchar(6) into database. I use json to render the view. But when I parse the data to json format (with utf8_encode($javascript-Object($users))) The result is: {User:{user_id:1, name: , cod_serial:08}} It seems that

Re: (n00b) Issue setting layout

2008-04-17 Thread kaffe
But I think my issue is as follows: Do I really need to make an *empty* model, an *empty* database table and an *empty* controller - just to set the layout of a static page? I have tried to take the cake page_controller and moving it to my app/ controllers/... but still I have this issue that I

Re: (n00b) Issue setting layout

2008-04-17 Thread kaffe
Thank you for your time, but is there no easier way? I think(?) that the solution you are describing would require me to make both a model and a controller for each static page. I tried what you describe, but then for each static page I would need an *empty* controller and a an *empty* model

Re: zend studio and cakephp - jump to function source

2008-04-17 Thread meixnerit
i did a search but didnt find anything. what IDE do you use? dont you use the jump to function feature in your IDE? for me that feature is very nice specially if i want to learn how this framework works. thx, markus On Apr 17, 1:23 am, Sliv [EMAIL PROTECTED] wrote: Do a search on the group to

Problem with autocomplete in IE

2008-04-17 Thread lekshmi
Hi, I'm using cakephp version 1.1.17.5612. There is a problem with auto complete.I'm using autocomplete helper without using auto complete component. autocomplete is working fine in firefox. But has some problems in IE. While entering something in textbox for autocomplete or while mouse

Re: can i use a component under a helper?

2008-04-17 Thread dbruensicke
I have seen a lot of components which use serialized data in sessions to interchange data between components and helpers. But that would obviously not work with source-code. I remember a case, where we had a reference to the corresponding view in a helper and i can imagine that you could have a

What code editors do you use?

2008-04-17 Thread Sliv
http://groups.google.com/group/cake-php/search?group=cake-phpq=what+code+editorsqt_g=Search+this+group --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

name the locale directory

2008-04-17 Thread Johnson
i want to support eng and zh_tw in my website.the locale's directories are app\locale\eng\LC_MESSAGES\default.po app\locale\zh_tw\LC_MESSAGES\default.po then, i use $this-Session-write('Config.language', $language); to control current language. if i want to display english , i set

Re: Problem with autocomplete in IE

2008-04-17 Thread grigri
I don't know if it's relevant, but try adding this javascript to the relevant page: try { document.execCommand(BackgroundImageCache, false, true); } catch(err) {} [put it in an ie cc - nothing else needs it] On Apr 17, 11:12 am, lekshmi [EMAIL PROTECTED] wrote: Hi, I'm using cakephp

Re: can i use a component under a helper?

2008-04-17 Thread grigri
It might seem like overkill, but one way of handling this might be: //- /app/vendors/something.php class Something extends Object { function doSomethingCool($input) { return $output; } } /app/controllers/components/something.php App::import('Vendor',

Re: (n00b) Issue setting layout

2008-04-17 Thread grigri
If you really need to change the layout per-page, then extending the page_controller is the way to go. There's a bakery article on this subject [http://bakery.cakephp.org/articles/view/taking-advantage-of- the-pages-controller] Basically, if you have a page called 'faq' then the pages controller

Re: delete or update habtm

2008-04-17 Thread [EMAIL PROTECTED]
I never do that directly. What I do is that I update either of the models involved with the association either added or removed. This si an example straight out of a project I am working on. It is for Cake1.2. A quick disclaimer though: It may not at all be the best way and it may not at all

speeding up autocomplete

2008-04-17 Thread michaelmcandrew
Hi there, I have a simple autocomplete that i would like to speed up. I could be wrong but i think the delay is intentionally added to the ajax for cosmetic / keeping load off the database reasons. The query only takes 1 millisecond to execulte but i have a .4(?) second delay before the search

Re: name the locale directory

2008-04-17 Thread Sebastian Veggiani
Johnson, If you look here: http://api.cakephp.org/1.2/l10n_8php-source.html#l00180 You'll find that the code you are trying to use is set with - instead of _. I think the codes must be used as defined in this array. Here you have some additional info:

Re: Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Dr. Tarique Sani
On Thu, Apr 17, 2008 at 7:11 PM, Joshua McFarren [EMAIL PROTECTED] wrote: Is this the expected behavior of the method? The API says, Returns the ID of the last record this Model inserted. Am I reading this wrong? Its it only supposed to return the Id of a CREATE not an UPDATE? It is

Re: Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Chris Hartjes
On Thu, Apr 17, 2008 at 9:41 AM, Joshua McFarren [EMAIL PROTECTED] wrote: Is this the expected behavior of the method? The API says, Returns the ID of the last record this Model inserted. Am I reading this wrong? Its it only supposed to return the Id of a CREATE not an UPDATE? I think

Re: Twitter Component

2008-04-17 Thread DragonI
Thanks strangy, I'll try the new version On Apr 17, 4:00 am, strangy [EMAIL PROTECTED] wrote: Well, I'm using the 1.2.x.x branch not the nightly. And maybe I written it wrongly, because English is not my primary language, but for the basic/Basic stuff I meant to say that I changed from

Need tips on keeping Test, Dev, Production In Sync

2008-04-17 Thread mmayes
Hi all, I was wondering if anybody could provide tips on keeping various environments in sync? For example: I plan on having a local development environment on my computer, say www.domain.dev Then I plan on having a testing domain on the live server, like test.domain.com Then the production

Re: Need tips on keeping Test, Dev, Production In Sync

2008-04-17 Thread Chris Hartjes
On Thu, Apr 17, 2008 at 10:35 AM, mmayes [EMAIL PROTECTED] wrote: Any tips/best practices for working with this type of configuration would be great, or if there's a better way to do it. For example, when rolling out/developing new features, do you use svn, cvs, git, plain old ftp,

Re: newbie how to update a row with 2 primary keys

2008-04-17 Thread Baz
But wait... isn't food_categories with only 2 columns a HABTM table? Am I missing something here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Twitter Component

2008-04-17 Thread Siegfried Hirsch
I have tried the new version and I still get also the error: Class 'AppHelper' not found The problem is, that cake tries to load the xml.php in the view/helper but should instead load the xml.php from the /cake/libs directory. I am not sure, how I can tell cake to load this specific file. BTW,

Re: Test Suite v1.2: $useDbConfig problem in model association.

2008-04-17 Thread Defranco
Should I report the fact that $model-setDataSource($dbConfig) do not affect related models as a bug or as an enhancement? Actually, if I set $model-setDataSource('test_suite'); Related model like $model-Model2 will still have $dbConfig='default' not $dbConfig='test_suite' as the main model -

Re: Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Joshua McFarren
Hi Tarique, So if I understand correctly, Model::getLastInsertID should do the same thing as SELECT LAST_INSERT_ID(); which only returns an ID if you inserted a row into a table that has auto_increment? http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html Best, Joshua P.S. looks

Problem on serializing Ajax data with Cake

2008-04-17 Thread Pierre MARCOURT
Hi, I am using the $ajax-sortable function to change the order of a list (3 items). Then I want to save the order in a database but I have a problem. When I use Sortable.serialize to send the data to my controller, my array is empty... Here is the code I use in my view : ?php echo

Re: CakeAMF on a shared host?

2008-04-17 Thread Ramiro Araujo
Im using CakeSWXPHP for my flash projects (I would use CakeAMF, but my clients all have shared hostings :( and dont have de amf php extension). BUT, im using cakeswxphp with the amf connection; its like using amfphp. You have the option of using swx, amf o json. Take a look, Im sure it'll fit

cakePHP or not?

2008-04-17 Thread foongoos
I have a free lance developer that wants to do a job for me and he sounds very promising. The project is based on cake but I am afraid that I will not be able to tell the difference if he used another frameowork, maybe CMS or even bought a script. What are the sure signs that indicate that asite

RE: cakePHP or not?

2008-04-17 Thread Mariano Iglesias
Well you could look at the generated HTML source of some page that includes a form and look for the data[Model][field] format in the input names. -MI --- CakeFest: December, 2008 - Buenos Aires, Argentina -

Re: cakePHP or not?

2008-04-17 Thread Dr. Tarique Sani
If you really don't know the difference then why bother? Focus on getting a solution... Or hire a project manager who you can trust! Wait a min!! Is it that you are the project manager :o) Yes looking at the source code of the rendered page can give enough clues Cheers Tarique On Thu, Apr 17,

Re: (n00b) Issue setting layout

2008-04-17 Thread aranworld
I think(?) that the solution you are describing would require me to make both a model and a controller for each static page. This controller doesn't require any Models: class BoilerplatesController extends AppController { var $uses = array(); // setting it as a blank array means no models

Re: cakePHP or not?

2008-04-17 Thread aranworld
These are typical CakePHP urls: http://www.domain.com/articles/view/354 http://www.domain.com/staff_bios/ http://www.domain.com/pages/about_us/ http://www.domain.com/news/index Look for the pattern of a plural word followed by either index or view. At least if they are clean URLs like this,

Re: OT?: How to use Poedit with the __d() translation function?

2008-04-17 Thread snowdog
Use cake i18n command (similar to cake bake) to extract all terms and create .pot file, then you can use it in normal way (update your .po from .pot) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To

Re: (n00b) Issue setting layout

2008-04-17 Thread Reggie Mason
Or without modifying pages_controller.php In /app/views/pages/one.ctp (for CakePHP1.2) ?php $this-layout='eggs'; ? h1This page uses the eggs layout/h1 And, in /app/view/pages/about.ctp ?php $this-layout='bacon'; ? h1This page uses the bacon layout/h1 On Apr 17, 7:59 am, grigri [EMAIL

Re: Need tips on keeping Test, Dev, Production In Sync

2008-04-17 Thread mmayes
Funny! I just got done watching that - I'll post any ?'s on the entry comment form. Cheers. On Apr 17, 9:41 am, Chris Hartjes [EMAIL PROTECTED] wrote: On Thu, Apr 17, 2008 at 10:35 AM, mmayes [EMAIL PROTECTED] wrote: Any tips/best practices for working with this type of configuration

Re: Twitter Component

2008-04-17 Thread Siegfried Hirsch
2008/4/17, Siegfried Hirsch [EMAIL PROTECTED]: I have tried the new version and I still get also the error: Class 'AppHelper' not found I was able to get around the errors by doing the following at the start of the file uses('xml'); App::import('Core', array('HttpSocket')); works

Re: Leadership issues....

2008-04-17 Thread R. Rajesh Jeba Anbiah
On Apr 16, 10:21 pm, b logica [EMAIL PROTECTED] wrote: Gonzalo: I'm not suggesting that anyone *wants* CakePHP to collapse. This public argument amongst the core devs doesn't bode well for the health of the project, regardless of what anyone--including them--wants. FWIW, public discussion

Re: CakeAMF on a shared host?

2008-04-17 Thread R. Rajesh Jeba Anbiah
On Apr 17, 8:03 pm, Ramiro Araujo [EMAIL PROTECTED] wrote: Im using CakeSWXPHP for my flash projects (I would use CakeAMF, but my clients all have shared hostings :( and dont have de amf php extension). BUT, im using cakeswxphp with the amf connection; its like using amfphp. You have the

Re: Exporting the index.thtml view to csv

2008-04-17 Thread R. Rajesh Jeba Anbiah
On Apr 17, 10:25 am, Adam Royle [EMAIL PROTECTED] wrote: Excel does read tabular html (including basic styles). You just need to set the correct content type. header(Content-disposition:attachment;filename=myexport.xls); header(Content-type:application/vnd.ms-excel); Alternatively, if you

Re: can i use a component under a helper?

2008-04-17 Thread R. Rajesh Jeba Anbiah
On Apr 17, 5:41 pm, grigri [EMAIL PROTECTED] wrote: It might seem like overkill, but one way of handling this might be: //- /app/vendors/something.php class Something extends Object { function doSomethingCool($input) { return $output; } }

Re: can i use a component under a helper?

2008-04-17 Thread [EMAIL PROTECTED]
if you do $this-set('component', $this-Component); you should be able to access the component functions via $component- in your views. I think. On Apr 16, 2:05 pm, miuuzn [EMAIL PROTECTED] wrote: Hi, i've been trying to make some reusable stuff to deal with dates i've developed a component

3 table HABTM OR don't use a primary key

2008-04-17 Thread [EMAIL PROTECTED]
I have a couple tables in a database I'm building a management tool for that are essentially HABTM (hasAndBelongsToMany) relationships, but with 3 foreign keys, and a couple of these tables carry extra data along as well. A quick note before hand - I did not create the database structure, and I

Re: Custom SQL call problem

2008-04-17 Thread Defranco
no ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more

Re: Twitter Component

2008-04-17 Thread strangy
I'm glad you manage to get it working. I've updated my cake installation to the latest revision (6679). I use this repository https://svn.cakephp.org/repo/branches/1.2.x.x. Then I tried my twitter component and it worked without any code modifications. I really don't know why it is not working

Using HtmlHelper in custom helper?

2008-04-17 Thread smacks
Hi guys, I've got a weird problem with including the HtmlHelper in a custom helper. Well, maybe I just can't see what I did wrong, but ... This is my custom helper: class MenuHelper extends Helper { var $helpers = array('Html'); function createMenuList($data,$check) {

link

2008-04-17 Thread smacks
just noticed that my stripped down link-function doesn't have a target. but that's not the problem. at least not for the problem, that i just can't include the html-helper. help?!? :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Custom SQL call problem

2008-04-17 Thread Erico Franco
2008/4/17, [EMAIL PROTECTED] [EMAIL PROTECTED]: i know zilch about stored procedures, but this doesn't really seem to be a cake problem I think that it is a cake problem. what happens if you run that query outside of cake - on a regular php page or in an sql manager It works on both

Re: can i use a component under a helper?

2008-04-17 Thread Joel Perras
if you do $this-set('component', $this-Component); you should be able to access the component functions via $component- in your views. I think. There are so many bad habits rolled into that one line of code, I don't know where to begin.

Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-17 Thread Joshua McFarren
Hi, Is there a case where Model::save() doesn't initiate the beforeSave and afterSave callbacks for that Model? Maybe this doesn't work from another afterSave callback? Are these callbacks only initiated when Model::save() is accessed from a Controller not another Model? I have a Schedule Model

Re: Twitter Component

2008-04-17 Thread DragonI
Unfortunately upgrading to 6679 didn't work for me. I get the same error ;( BUT Siegfried's suggestion did work uses('xml'); App::import('Core', array('HttpSocket')); On Apr 17, 2:16 pm, strangy [EMAIL PROTECTED] wrote: I'm glad you manage to get it working. I've updated my cake

Re: Using HtmlHelper in custom helper?

2008-04-17 Thread Joshua McFarren
Hm... this is what worked for me. Maybe its a bad, brute force, way to do it though: App::import('Helper', 'Time'); class DateHelper extends TimeHelper { ... } Best, Joshua On Apr 17, 4:38 pm, smacks [EMAIL PROTECTED] wrote: LOL thanks for your comment Fred! But actually I did that.

Re: Can I limit access to the captcha action in my controller?

2008-04-17 Thread ReiToei
Thanks Aran and Ketan, I ended up going for Ketan's solution, using the referer method. Works exactly how I wanted it to. You guys rock :) -Rei On Apr 17, 5:13 am, k10 [EMAIL PROTECTED] wrote: You can check the HTTP_REFERER from the _SERVER array against the url of your view as provided in

[SOLVED] Does Acl-deny() work in Cake 1.1.19.6305?

2008-04-17 Thread Langdon Stevenson
In case anyone else has this problem in the future I thought it worth mentioning my solution. The answer to this question is: yes it does work. However, the database ACL tables were created with the script provided with Cake in an older version of Cake. That version set the field types for

Bug with findAllThreaded

2008-04-17 Thread Renan Gonçalves
Hello, I was trying the method findAllThreaded and I have found a bug! I have been tested this in Cake 1.2, but problaly the bug is on 1.1 too. There is a table called sections (model Section) with id, parent_id, created, modified and name. When I try to sort this data with $sections =

Re: OT: What code editors do you all use?

2008-04-17 Thread [EMAIL PROTECTED]
I've been using jEdit (linux and OSX) for a few years now. It works very well for me. Incidentally, to enable proper syntax highlighting for .ctp files, copy the php.xml file in the modes subdirectory of the jEdit install dir to a new file named ctp.xml. You can change: MODE NAME=php

Re: need advice = try to develop alternative flex client

2008-04-17 Thread kiang
We are using amfphp directly with CakePHP application (1.2). Only share some settings and the database. My experiences: CakeSWXPHP works well if I disable PECL/APC settings. http://blog.aboutme.be/cakeswxphp/ CakeAMFPHP need some modification to work under CakePHP 1.2. But the project is a

testing in cakephp 1.2-Bug-Class 'Usel' Not found

2008-04-17 Thread bhushan A
I have followed the steps given in http://bakery.cakephp.org/ articles/view/testing-models-with-cakephp-1-2-test-suite link. But still I am gettng 'Fatal error: Class 'User' not found in /tests/cases/ models/user.test.php' I am putting my user.test.php's code here. Please let me know what i am

Re: Question about Model::save() and its beforeSave and afterSave callbacks

2008-04-17 Thread Joshua McFarren
Hi Aran, Thanks for the advice. Unfortunately I tried that and it doesn't make a difference. The syntax i tried is: $this-ProjectTasks-create(); $this-ProjectTasks-save($task); In either case the save method does update the row in the DB but the callbacks don't happen. Any other ideas? -

Re: testing in cakephp 1.2-Bug-Class 'Usel' Not found

2008-04-17 Thread Amit Badkas
On Fri, Apr 18, 2008 at 10:54 AM, bhushan A [EMAIL PROTECTED] wrote: I have followed the steps given in http://bakery.cakephp.org/ articles/view/testing-models-with-cakephp-1-2-test-suitehttp://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1-2-test-suite link. But still I am