Re: MVC-way to obtain common data formatting

2009-08-27 Thread Bert Van den Brande
Hmm I see ... well, I think this can only be accomplished with some kind of helper method/class in the view, just like Jon Bennet says. Imho a class like that will get bloated very quickly , because there will be different options to choose from on how to display the data. A small helper for

Cloud application with CakePHP? Different databases with same app.

2009-08-27 Thread Sebastian
The title may be misleading, but bear with me. I would like to use CakePHP to create one application, which then has multiple instances. Think of it, if you will, as different websites being powered by the same application--not a copy of it. Each instance (website) would have its own database

Re: Announcing CakeXT: Bind CakePHP and ExtJS together

2009-08-27 Thread Mark Tannenberg
Hi I started using this project and I guess I still have to grasp the concept of ExtJs coding ... I wonder, would it be possible to use this in a different environment than just the 3 tabs you mentioned? Regards On 25 Aug., 10:23, technicaltitch technicalti...@gmail.com wrote: Very exciting!

Re: encoding problems: utf-8

2009-08-27 Thread danfreak
the main encoding problem is in a shell script: The script imports RSS from 10 different sources once every hour and stores them in DB. In order to normalize the grabbed content I use: foreach ($feed-get_items() as $item){ $myitem['title'] =

How to use a plugin's layout form a different plugin

2009-08-27 Thread MPeg
Hi to all. I'm developing a plugin named pizza and I have another plugin named beautifull_layout. When I order a new pizza i'd like to use a layout from the beautifull_layout plugin. class Pizza extend PizzaAppController { function order() { $this-plugin = beautifull_layout;

Re: Friendly image/files URL routing

2009-08-27 Thread Walther
Actually, using a media view would be the better bet. Already deals with everything for you. On Aug 26, 3:30 pm, Jon Bennett jmbenn...@gmail.com wrote: Hi, I am uploading files(images, mp3s etc) to my webroot /files/ folder. The files are named their id number.their extension. Without any

Re: Help

2009-08-27 Thread rich...@home
Just to clarify mike's point: in your controller: $conditions = array(Property.zip = $this-data); should be: $conditions = array(Property.zip = $this-data['Property'] ['zip']); On Aug 26, 10:15 pm, mike karthauser mi...@brightstorm.co.uk wrote: hi you should turn on debug=2 and have a look

Radio with WRONG LABEL ID

2009-08-27 Thread lacenaepro...@gmail.com
HI, I can't resolve a strange problem. This is my code: echo $form-input('User.SecurityAccess.'.$aco_id, array ( 'div' = false, 'label' = false, 'type' = 'radio', 'legend' =

Re: related to Session-setFlash

2009-08-27 Thread cbhan
Sorry for the late reply.Yes, you are right, if you are doing it in views/layouts/default.ctp On Aug 21, 6:53 am, kdubya kenwin...@winanstech.com wrote: On Aug 19, 9:01 am, zaboo adambartholo...@gmail.com wrote: Don't echo $this-Session-setFlash() On Aug 19, 8:27 am, Chander Bhan

Re: file upload strange - doesn't appear in filesystem, but can be move_uploaded_file()ed

2009-08-27 Thread Dr. Loboto
You should first check by is_uploaded_file() and then move it by move_uploaded_file(). It is the only safe way with PHP. These functions goes through bunch of PHP security restrictions instead of normal file functions. Until move_uploaded_file() called or request finished file is in temp dir

Re: MVC-way to obtain common data formatting

2009-08-27 Thread benjamwelker
You can try creating a couple of methods in your model. One afterFind, and another beforeSave. You can convert the data however you want in the afterFind, and then convert it back in the beforeSave so that it doesn't mess up your validation and save methods. But you're going to run into other

Re: Cloud application with CakePHP? Different databases with same app.

2009-08-27 Thread Martin Westin
I detailed how I do it in an article in the Bakery: http://bakery.cakephp.org/articles/view/one-core-one-app-multiple-domains It works on one Cake core, one app, one apache (or nginx) vhost (with multiple aliases). It makes development-specific settings easy as-well since that is handled the

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread Martin Westin
Cake can handle it... what you are really asking is wether your server can handle it without any type of load-balancing. This is a much harder question to answer since it would depend on many factors. The reason Cake is a good framework for your situation is that it is designed to help you out

Re: get profile id when user logs in

2009-08-27 Thread brian
Actually, you had the right idea already. If User hasOne Profile and Profile belongsTo User, then Profile will have user_id and User will not have profile_id. However, you could pass just the User.id as before and get the Profile.id in the action that your link points to. view: echo

Re: encoding problems: utf-8

2009-08-27 Thread brian
Are you sure your db connection is using UTF-8? BTW, I noticed an error in my last reply. It should be SET NAMES 'utf8'; (no '-') On Thu, Aug 27, 2009 at 4:01 AM, danfreakfreakclimb...@gmail.com wrote: the main encoding problem is in a shell script: The script imports RSS from 10 different

Re: file upload strange - doesn't appear in filesystem, but can be move_uploaded_file()ed

2009-08-27 Thread brian
Just to add to Dr. Loboto's response, from your question, it seems that you're passing the final destination path to is_uploaded_file(). That will not work, as it expects the tmp name (because it will look in the tmp directory). And, as it's already been moved, the tmp file will have been

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread brian
A single DB table with 500,000 records is not a problem, as long as you're using a decent DB engine. I've used both Postgres and MySQL for tables with several million records. Just make sure that you use the DB's optimisation for large tables (eg. indexes, etc.) On Wed, Aug 26, 2009 at 7:23 PM,

Re: How to use a plugin's layout form a different plugin

2009-08-27 Thread majna
You can not do this. But you can add beautifull_layout to $viewPaths in bootstrap.php. I would hack this out like: class Pizza extend PizzaAppController { function order() { Configure::write('viewPaths', array_unshift(Configure::read ('viewPaths'),

Re: Cloud application with CakePHP? Different databases with same app.

2009-08-27 Thread Sebastian von Conrad
Martin, Thank you for the link! It seems to be more than enough to get me started on this. I will likely modify some of your methods to suit my intended setup, but it is indeed a great article. Out of curiosity, how many different domains do you run with this setup? And how do you feel the

Weird SQL requests with CakePHP on an Oracle DataBase ?!!

2009-08-27 Thread Xanax
Hi everyone, I've transfered all my data from MySQL to an Oracle Database. It used to work very well with MySQL. Now, when i try to launch my application, i've got weird request. I respected all tablename conventions from the CakePHP sites so i've set plural tablenames. For examples for the

Re: Modules in cake?

2009-08-27 Thread majna
No, but you can group mvc files by adding additional paths in bootstrap.php (see doc comments), but this is not best solution. (performance and some other issues on how cake includes view files) On Aug 26, 11:09 pm, Mech7 chris.de@gmail.com wrote: Is there way to setup modules in cake... I

Re: Help

2009-08-27 Thread bumper
Thanks ... that did it !!! Rich --~--~-~--~~~---~--~~ 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

Re: Modules in cake?

2009-08-27 Thread Jamie
Well, you could just write plugins that take advantage of this functionality - i.e. write a Blog plugin that will use a Tag plugin if it exists. On Aug 26, 2:09 pm, Mech7 chris.de@gmail.com wrote: Is there way to setup modules in cake... I don't mean plugins which are seperate

checkboxes with alternative value

2009-08-27 Thread fabio
Dear all, i'm a CakePHP newbie and i'm looking for some help regarding a particular use of checkboxes in a form. Basically i've got a check-boxes-section in the form of a baked edit.ctp, called with a basic echo $form-input('Amenity', array( 'type' = 'select', 'multiple' = 'checkbox' )); The

Re: How to use a plugin's layout form a different plugin

2009-08-27 Thread MPeg
But this way it couldn't be two (or more) layout with same name in different plugins... I might use plugins to distribute graphics and client-side functionality... import every plugins's paths into viewPaths might reduce system performance... do you know an alternative way to share layout between

Re: Weird SQL requests with CakePHP on an Oracle DataBase ?!!

2009-08-27 Thread brian
I'm not familiar with Oracle syntax. Does it normally leave out the AS when using an alias? If so, it looks ok to me. The table is groups and the alias is Group. On Thu, Aug 27, 2009 at 9:48 AM, Xanaxmammer...@gmail.com wrote: Hi everyone, I've transfered all my data from MySQL to an Oracle

Re: Weird SQL requests with CakePHP on an Oracle DataBase ?!!

2009-08-27 Thread Xanax
I found the reason : it's the alis GROUP. This is a keyword reserved by ORACLE database engine. How can i change the alias ? Perahps in the model of the table ? Another solution is to change the tablename so it will change the alias associated but i would have to change a lot of SQL request...

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread DigitalDude
Hey, ok these infos sound nice, the fact with the multiple read-db's is one I haven't heard of but I'll gather all required info on that topic. But to stay more practical, how would one realise a friend-list like facebook or the other big networks? Is a join-table really a good approach to

Re: saveAll with a hasMany relationship

2009-08-27 Thread Nancy
I think maybe the difference between what you and I was doing is that I was trying to save multiple main records at one time, whereas you were doing one. $this-data[1]['Recipe']['name'] = 'Delicious apple pie'; $this-data[1]['Recipe']['serves'] = 6; $this-data[1]['Recipe']['valid'] = 1;

Changing the alias giver to a table ! :)

2009-08-27 Thread Xanax
Hi, I have a problem with some SQL request in Oracle. GROUP is a reserved keyword for Oracle. And Cakephp generate some SQL request with this alias (because my table's name is GROUPS). So these request don't work until i change the alias from GROUP to GROUPE for example. I would like to know

Re: Joining two arrays to use in a Select box with the formhelper

2009-08-27 Thread Melgior
Hi, That's easy. You can use array_unshift to add an entry to the start of an array. Just add this to your controller: $isps = $this-Consultation-Isp-find('list'); array_unshift($isps, array(none=None of the above)); And you should be all set. Greets, Melgior.

Moving TinyMCE into vendors folder...Need Help.....

2009-08-27 Thread Sheetal
Hi, when TinyMCE was placed inside webroot/js folder, everything worked fine. But when i placed it inside vendor folder (more apps can use it) TinyMCE run and display their window in place of textarea, but icons don't load. When I move the mouse over, button gets highlighted but icons are not

String conversion error when enabling debug mode after switching hosts.

2009-08-27 Thread superdav
Greetings to all, This is my first cake app I've made and I am having problems after moving it from my development server to a production server. Everything is working fun except two actions are just giving me a blank page when I try to view them. One is an advanced search action and the other

Where do you put code needed in controllers and models?

2009-08-27 Thread Nancy
Would a component be the right thing to use? For instance, I have a routine that parses data and I need it both in models and controllers. How do you include a component in model? I guess I can always access the model from the controller, so perhaps app_model is a better choice. Any opinions

Re: Joining two arrays to use in a Select box with the formhelper

2009-08-27 Thread Melgior
Yes, you could use array_push() indeed, although you don't even need to. The PHP manual recommends this method if you want to add just one entry: $isps['none'] = None of the above; This way 'none' will show up as last in the dropdown, as long as you put the line after -find().

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread Miles J
Not necessarily. If you are doing a friend system, the table would look like so: friends: id, user1_id, user2_id And 1 row would be for both user1 and user2, instead of adding 2 rows for each user. --~--~-~--~~~---~--~~ You received this message because you are

Change the alias or the name of a table !!

2009-08-27 Thread Xanax
Hi, I need to change the alias OR the name of a table. It's weird, i tried to change many variable whithout any changes on requests generated by Cakephp : var $name var $useTable The name of the controller (the name of the file AND the name of the class) The name of the model(the name of the

Re: Joining two arrays to use in a Select box with the formhelper

2009-08-27 Thread DigitalDude
forgot something... If you save the value none to your database and in the other cases 0, 1, 2, 3 (id's of the suppliers...) and so on your code should probably look like this: $form-input(Modelname.isp_id, array( 'empty' = __('Select your supplier', true) ); The 'empty' key of the array

Re: ajax remoteFunction problem

2009-08-27 Thread bondo
Thanks. I'll give that a try. For now I had just modified h() in basics.php to get it to work. On Aug 13, 2:26 am, Dr. Loboto drlob...@gmail.com wrote: script language=JavaScript function new_heading(heading) {       var name =prompt(Enter a heading name, );       new Ajax.Updater(          

Re: Where do you put code needed in controllers and models?

2009-08-27 Thread Melgior
Most people seem to be fan of 'fat' models: put all your code that handles data in your models and keep your controllers thin and easy to read. Since your function parses data I would put it into the model indeed. If you need it in every model/controller, you can add it to app_model. You could

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread DigitalDude
Hey, ah ok I think we both mean the same thing, but I forgot that the relation is not only by one side, but by two sides. So a simple example would look like this: Table friends: id user1_id user2_id 1 12 2 52 3 31 4 41

Multiple pagination same view

2009-08-27 Thread ML
Does anyone know how to have multiple blocks (multiple tables for example) of paginated data on the same page? There seems to be 2 issues: 1) the navigation section ($paginator-next, etc) gets overwritten by the last pagination on the page. So the navigation data and page counts are correct only

Re: Radio with WRONG LABEL ID

2009-08-27 Thread Miles J
Um correct me if im wrong, but in the example you showed me the IDs are different and correct. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread Pablo Viojo
Take a look at http://needish.com It's cakephp based :) Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://needish.com On Wed, Aug 26, 2009 at 7:23 PM, DigitalDude e.blumsten...@googlemail.comwrote: Hey, I'm wondering if it would be possible to build up a

Using belongsTo and hasMany relationships: Is it possible to access tables through a chain of relationships?

2009-08-27 Thread Sarah
This is my setup: A 'user' hasMany 'userpage's. A 'user' belongsTo an 'animal'. I would like to be able to display user information as well as some information about the user's animal on a userpage view. I perform a find query to get the userpage id, user_id, animal_id. Is there a way to

Re: Joining two arrays to use in a Select box with the formhelper

2009-08-27 Thread DigitalDude
Hey, nice one, didn't know about that. Would it be correct for an added value at the END of the array to use array_push() ? On 27 Aug., 20:48, Melgior melg...@hotmail.com wrote: Hi, That's easy. You can use array_unshift to add an entry to the start of an array. Just add this to your

redirect after download dialog

2009-08-27 Thread Martin Radosta
Let's say I have a view that renders an excel file to download. It presents a download dialog to the user. This user can decide to save the file to the local drive, to open the file or to cancel the operation. Now I need to redirect somewhere else after any operation with the download dialog.

Passing data from the view to the controller

2009-08-27 Thread Robert Popplewell
I am trying to add a comments area to a simple blog application and I would like to pass the id of a specific blog post to the comments controller. The only example I can find involves setting a hidden form field and passing it via the form data... echo $form-hidden('Comment.post_id',

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread Pablo Viojo
I don't recommend this approach because if you want to know all user 1 friends yo must do something like user_id_1=1 or user_id_2=1 and thats an overhead (and you need two indexes for that) if you have something like: Table friends: id user1_id user2_id 1 12 1 2

Re: Joining two arrays to use in a Select box with the formhelper

2009-08-27 Thread channel5
Thanks all for your help, worked a charm! Thanks again :) c5 --~--~-~--~~~---~--~~ 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

Re: Using belongsTo and hasMany relationships: Is it possible to access tables through a chain of relationships?

2009-08-27 Thread Sarah
Ah, that worked. :) Thank you! On Aug 27, 3:19 pm, delocalizer conrad.leon...@hotmail.com wrote: Hi Sarah; If your relationships are set up correctly and you have recursive -1, the usual 'find' method on User model should be returning the parent 'Animal' anyway - what do you see if you

Re: saveAll with a hasMany relationship

2009-08-27 Thread Nancy
Ok, just caught something in the cakephp online docs: saveAll(array $data = null, array $options = array()) Used to save (a) multiple individual records for a single model or (b) this record, as well as all associated records So perhaps this means I'm just trying to do something that isn't

Re: Using belongsTo and hasMany relationships: Is it possible to access tables through a chain of relationships?

2009-08-27 Thread Sarah
The only problem I am having with this is that userpages are then received like this: [Userpage] = Array ( [0] = Array ( [id] = 2 [filename] = helloworld.html [type] = text/html

Organizing hierarchical system with breadcrumb navigation

2009-08-27 Thread geste
I have modeled a business system for my department and it includes about 60 tables/models, perhaps 20 of which as simply lookup/reference tables that I would only make available through admin routing. Out of the box, CakePHP organization is pretty flat -- views and controllers all lying under

Re: jQuery with Cake forms

2009-08-27 Thread Mike
Thanks a ton for the tip - this worked out great! The only thing I'd want to warn other people about (just in case someone else is following these same footsteps) is that the text input appeared to be a normal, everyday text input until I clicked on it, whereupon the DatePicker control nicely

Re: Using belongsTo and hasMany relationships: Is it possible to access tables through a chain of relationships?

2009-08-27 Thread delocalizer
Hi Sarah; If your relationships are set up correctly and you have recursive -1, the usual 'find' method on User model should be returning the parent 'Animal' anyway - what do you see if you put this in one of your user controller functions: $example = $this-User-find('first'); debug($example); ?

Strange queries

2009-08-27 Thread jcx...@gmail.com
Hi pals, this is an freak error in my mysql queries: when save / edit an datetime field, all the hyphens are converted in #45; then this field can't be saved or edited. I've checked all the database and app configurations and that's set in utf-8. Some idea?

Custom query pagination

2009-08-27 Thread Dean C
Hi folks, Before I begin, yes I've read this page: http://book.cakephp.org/view/249/Custom-Query-Pagination I've also read many of the other pages on Google but I'm still stuck! First of all if I may introduce you to my query: http://bin.cakephp.org/view/1064020598 It's a union query that

Re: Using belongsTo and hasMany relationships: Is it possible to access tables through a chain of relationships?

2009-08-27 Thread Sarah
To clarify, I get the error message: Warning (512): SQL Error: 1054: Unknown column 'Userpage.id' in 'field list' [CORE/cake/libs/model/datasources/dbo_source.php, line 525] When I try to get select the Userpage.id field. On Aug 27, 3:19 pm, delocalizer conrad.leon...@hotmail.com wrote: Hi

Re: String conversion error when enabling debug mode after switching hosts.

2009-08-27 Thread superdav
I figured it out. I had a module named 'Query' and when I changed the class name and filename etc to 'Search' and the controller etc to searches everything worked fine. For some reason cakephp with php4 does not like modules named 'Query'. Does that mean I found a bug? On Aug 27, 12:19 pm,

Re: Is Cake capable of building up a small or medium social network?

2009-08-27 Thread Miles J
@DigitalDude - Yes thats correct. @Pablo - No its not, it doesn't make a difference in overhead at all. Also by inserting 2 rows your causing overhead and unneeded rows in the database. Heres an example of one of my methods in my Friend model. /** * Checks to see if two users are friends *

Re: Radio with WRONG LABEL ID

2009-08-27 Thread delocalizer
Do you mean the name is the same? Because it is supposed to be - both buttons provide a value to the same field. What is the symptom of your problem? On Aug 27, 9:19 pm, lacenaepro...@gmail.com lacenaepro...@gmail.com wrote: HI, I can't resolve a strange problem. This is my code: echo

Re: Hi, my server admin in not loving changes.

2009-08-27 Thread Alexandru Ciobanu
On 8/26/2009 1:27 PM, Cosmin Paul wrote: Hi, I am a programmer from a 7 gays team, and I have recently finisher my module. When I uploaded my work to stage one server, I have a bug in sql query generated by cake: guys, right? :-) It appends the model name to an aliascode

Re: Passing data from the view to the controller

2009-08-27 Thread brian
Look into the Security component. However, I have to ask: so what? If a user is determined to be a jackass, this is one of the least things I'd be concerned about. On Thu, Aug 27, 2009 at 1:18 PM, Robert Popplewellr0b...@gmail.com wrote: I am trying to add a comments area to a simple blog

Re: Moving TinyMCE into vendors folder...Need Help.....

2009-08-27 Thread Miles J
You cant link to img, css and js within the vendors folder, unless the files are in the respective folders, example: /venders/css/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group,

Re: Modules in cake?

2009-08-27 Thread Mech7
But plugins are not convenient to use for this purpose as they have their own layout / script etc files.. And not really share anything from the main application On Aug 27, 4:36 pm, Jamie jamie@gmail.com wrote: Well, you could just write plugins that take advantage of this functionality -

Re: Changing the alias giver to a table ! :)

2009-08-27 Thread brian
Try leaving the class name as 'Group' and adding var $alias = 'Groupx'; On Thu, Aug 27, 2009 at 12:03 PM, Xanaxmammer...@gmail.com wrote: Hi, I have a problem with some SQL request in Oracle. GROUP is a reserved keyword for Oracle. And Cakephp generate some SQL request with this alias

Re: Using belongsTo and hasMany relationships: Is it possible to access tables through a chain of relationships?

2009-08-27 Thread delocalizer
Hi Sarah; I'm not sure what you are asking. User hasmany Userpages, so Userpage array will contain all the Userpages belonging to User. $example = $this-User-find('first'); foreach($example['Userpage'] as $key=$value){ debug($value['id']); } On Aug 28, 9:18 am, Sarah

Re: Passing data from the view to the controller

2009-08-27 Thread Robert Popplewell
I'd rather it werent possible for some random jackass to post comments to ANY published/unpublished post :p Regardless of how far down the list, it is still a concern! 2009/8/28 brian bally.z...@gmail.com Look into the Security component. However, I have to ask: so what? If a user is

Re: redirect after download dialog

2009-08-27 Thread brian
You can't. In order to have the browser present the user with a save dialog, certain headers need to be sent. By the time that's happened, it's too late to send a redirect header. On Thu, Aug 27, 2009 at 5:35 PM, Martin Radostamartinrado...@gmail.com wrote: Let's say I have a view that renders

Re: Organizing hierarchical system with breadcrumb navigation

2009-08-27 Thread Braindead
In my opinion using a model for breadcrumbs is bloated. Why don't you just set the breadcrumbs in the view manually? The HTML helper has two functions addCrumb and getCrumbs, which makes basic breadcrumbs really simple. --~--~-~--~~~---~--~~ You received this