Re: textarea formating

2007-12-03 Thread schneimi
Hi, I think your problem is the '\n', because that way the line feed doesn't get interpreted, try it with "\n" instead. Best regards, Michael manu schrieb: > Hello all, > > I'm new to cake (and php btw). > I'm looking for a way to format a plain textarea text in html. I don't > want to use an

Re: Caching the view of the entry homepage

2007-12-03 Thread Adam Royle
Yes, this is a known issue, not sure if it has been addressed yet. However, my solution to this problem was to use an element (or two) to display the data and cache it that way. My homepage (http:// www.brisbanepowerhouse.org/) is actually made up from two elements sitting in my view. eg. eleme

I'm having problems with associations...

2007-12-03 Thread Jon Hinson
Ok, I can't seem to solve this problem for the life of me. I have a User model and a Zipcode model. Zipcode hasMany users. I want them to join on User.zip = Zipcode.zip. I have to join on Zipcode.zip and not Zipcode.id because a zipcode can have many rows because of several city names, etc. I know

Re: Easy referential data integrity?

2007-12-03 Thread Grant Cox
Set 'dependent'=>true in your $hasMany definition. See http://manual.cakephp.org/chapter/models for more details. On Dec 4, 2:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, I'm new to cakePHP and I'm wondering if there is an easy way to > setup automatic referential data integrity

Re: Newbie -- Inserting data into mutliple tables with one form

2007-12-03 Thread powtac
http://tempdocs.cakephp.org/#TOC89602 --~--~-~--~~~---~--~~ 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 [EMA

Caching the view of the entry homepage

2007-12-03 Thread Dave J
Hi guys, I've been having issues with caching the view of the homepage, and previous posts regarding the subject ( http://groups.google.co.uk/group/cake-php/browse_thread/thread/2f005c48b785426a/5019bc5f68475195 ) only seem to have come up with workarounds involving redirecting from the htaccess

Re: Search box

2007-12-03 Thread Josoroma
Is right to use sanitize in controller(index function) or do i have to clean the array inside some model function, if yes? How do i send $data array from controller function to model function? Thanks in advance. --~--~-~--~~~---~--~~ You received this message beca

Re: Please review my way of saving a Associaton Model

2007-12-03 Thread Josoroma
Thanks Nate, Maritn, Just a few questions more: 1. How do i send or use $this->data inside the afterSave function in Model? 2. Do i have to use: $this->data['Report']['id'] = $this->Benchlink->getLastInsertId(); Before to save the second model or cakephp can automatically handle that? Tha

Easy referential data integrity?

2007-12-03 Thread [EMAIL PROTECTED]
Hi, I'm new to cakePHP and I'm wondering if there is an easy way to setup automatic referential data integrity so that when I delete a parent, all of it's children are automatically deleted? Right now I have a $hasMany relationship setup in the parent's model and a $belongsTo relationship setup in

Re: How Do I install Mcrypt in Cake?

2007-12-03 Thread Wayne Fay
Mcrypt is a PHP module that must be turned on in your server's php.ini file... so I'm not quite sure what you believe that you have downloaded. You should probably ask RosSoft to help you with the Cookie Component if you are unable to figure it out. This might involve paying him/them some money f

Re: Multiple language support?

2007-12-03 Thread Wayne Fay
This is built into the core of CakePHP. Look at i18n examples in the Bakery. On 12/3/07, skoggins <[EMAIL PROTECTED]> wrote: > > Hi all, > > My client would like her website to have support for multiple > languages. Does anyone know the best way to do this? Is there any > CakePHP functionality

Multiple language support?

2007-12-03 Thread skoggins
Hi all, My client would like her website to have support for multiple languages. Does anyone know the best way to do this? Is there any CakePHP functionality I should be looking at? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Some newbie questions part 1: showing form for a habtm relation

2007-12-03 Thread Adam Royle
I gained a greater understanding about cakephp by baking my models, controllers and views, and analysing how cake does it by default. Maybe you should try this? Once you understand how cake does it, then it should be easier to figure out what cakes like and what you need to change to get it to wor

Re: Newby questions part 2: custom query for pagination

2007-12-03 Thread Adam Royle
I'm not sure if you've got this part sorted, but here is how I do something similar in my app. I have Films hasMany Ratings. My films table has a field called "average_rating" which is updated every time a new rating is added (whenever someone votes). Here is a cutdown version of my Rating mode

Re: Xml layout name

2007-12-03 Thread snowdog
Or you can set Router::parseExtensions('xml'), then you dont have to specify layout, cake will take care of it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cak

How Do I install Mcrypt in Cake?

2007-12-03 Thread skoggins
Hi all, I am trying to use RosSoft's cookie component and it uses Mcrypt so I downloaded it but can't figure out what I'm supposed to do with it now. Put files in the vendor folder I guess. Can anyone help? Thanks --~--~-~--~~~---~--~~ You received this message

Re: Problem adding new record with Id

2007-12-03 Thread Pablo Viojo
Exactly, this is related with the primary key for your model. See http://groups.google.com/group/CakePHP-es/t/9503e9e1222d1a08?hl=es (in spanish) as his original request. ;) Regards, -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On Dec 3, 2007 8:25 PM, kristofer <[EMAIL PROTECTED]> wrote

Re: Problem adding new record with Id

2007-12-03 Thread kristofer
Can you post your model? I don't think you should validate the id field. Have the DB auto_increment the id field instead. On Dec 3, 1:29 pm, dandreta <[EMAIL PROTECTED]> wrote: > Hi! > I have a problem and I cant solve it. I hope you can help me. > I have a table called Records with fields Id and

Re: textarea formating

2007-12-03 Thread kristofer
I know this doesn't answer the question, but if you integrate tinymce it will make your textarea look like MS Word and format the text into html accordingly. try changing $body to $this->data['ModelName']['nameOfFormField'] (adjusting ModelName and nameOfFormField respectively) On Dec 3, 6:06 pm

Re: textarea formating

2007-12-03 Thread kristofer
The form data once it's submitted should be posted to your controller function and show up in an array ($this->data) You're going to need something like str_replace('\n', '', $this- >data[Model][field]); On Dec 3, 6:06 pm, manu <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm new to cake (and php

Model->validates() ignores 'on'=>'created' option of validation rule?

2007-12-03 Thread Serge Rodovnichenko
Model validation rule (checkUnique method got from tempdocs :-) ): = var $validate = array( 'name' => array( 'on'=>'create', 'rule' => array('checkUnique'), 'message' => 'Name is not unique!',

Re: Why do am I getting zeros input into the database?

2007-12-03 Thread kristofer
shouldn't be a problem. try using print_r($this->data); die(); in your controller to see if the data gets posted correctly. On Dec 3, 5:59 pm, Brian <[EMAIL PROTECTED]> wrote: > I have a form where 2 of the fields are always 0 when insterted into > the database. It's the first_name and last_name

Re: newbie question - multiple functions in a page

2007-12-03 Thread Jon Miller
Thank you very much to everyone who replied to my question, your advice and suggestions are much appreciated and very helpful. Jon. On Dec 3, 2007 3:16 PM, the_woodsman <[EMAIL PROTECTED]> wrote: > > Yes, with your tag cloud example, the core functionality for this > might be best placed in the

textarea formating

2007-12-03 Thread manu
Hello all, I'm new to cake (and php btw). I'm looking for a way to format a plain textarea text in html. I don't want to use an html editor, but just want something like this: ', $body); ?> but it doesn't work. Is there a cake helper, or method which could do that? Is there another php way to d

Why do am I getting zeros input into the database?

2007-12-03 Thread Brian
I have a form where 2 of the fields are always 0 when insterted into the database. It's the first_name and last_name fields below. All the other fields are inserted correctly. If i have a typo in my code the database will be set to NULL but on this form I'm getting zeros inserted into the database

Re: Xml layout name

2007-12-03 Thread Grant Cox
Or actually, try: $this->layoutPath = 'xml'; $this->layout = 'default'; obviously that second line is optional - as 'default' is what should be used anyway. On Dec 4, 7:48 am, Grant Cox <[EMAIL PROTECTED]> wrote: > I expect it will work with > $this->layout = 'xml'.DS.'default'; > > On Dec 4, 4

Re: Xml layout name

2007-12-03 Thread Grant Cox
I expect it will work with $this->layout = 'xml'.DS.'default'; On Dec 4, 4:15 am, Andreas <[EMAIL PROTECTED]> wrote: > Hi > > I've been trying to use the xml layout but it's not going too well > since the layout file itself is located within a subfolder called xml > (xml/default.ctp) and I'm not

Re: How do I install Mcrypt in Cake?

2007-12-03 Thread Grant Cox
Mcrypt is a PHP module - and its installation is quite independent from Cake. http://au.php.net/mcrypt There is a newer Cookie component on the bakery ( http://bakery.cakephp.org/articles/view/encrypted-cookie-component ) which also uses mcrypt. On Dec 4, 6:14 am, skoggins <[EMAIL PROTECTED]> w

Re: html

2007-12-03 Thread Grant Cox
What is a "pure html tag" ? If you mean a form element that is not named with cake conventions, look in $this->params['form'] in your controller. On Dec 4, 2:18 am, firefox <[EMAIL PROTECTED]> wrote: > how can i get a value from a pure html tag to my controller? --~--~-~--~~

Re: Newbie -- Inserting data into mutliple tables with one form

2007-12-03 Thread Baz
Instead of give you bad info, I'll give you the source: http://manual.cakephp.org/chapter/models search for this heading: Saving Related Model Data With that said, you can correct me on the following if I'm wrong. You should be able to do something like $this->Employee->Address->save($this->data)

How do I install Mcrypt in Cake?

2007-12-03 Thread skoggins
Hi All, I am trying to use the RosSoft cookie component to implement a "Remember Me" functionality but it uses the Mcrypt engine and I am unclear how to add this module to cake. Can anyone help me out? Thanks! --~--~-~--~~~---~--~~ You received this message becau

Newbie -- Inserting data into mutliple tables with one form

2007-12-03 Thread Brian
I have a from under an Employee view / model / table like this https://www.website.com/employees/register. register is a form that needs to input data into several diff tables. The form works great for inserting data into the employee table but not sure how to get it to insert into the employee_a

Re: Using Pear with Oracle

2007-12-03 Thread Greg Baker
I think I have it working using the dbo_oracle from the new version of Cake. I scrapped trying to use pear. On Dec 3, 1:16 pm, Greg Baker <[EMAIL PROTECTED]> wrote: > I seem to be having a little trouble getting cake to connect to Oracle > using Pear. The config file says to use 'driver' => 'pe

Re: Paginating search results, keeping search criteria, and not messing with the view

2007-12-03 Thread loki_mdog
Hey Robert... Been out of town...I'll try to post my entire view and controller code so you can see... -- View this message in context: http://www.nabble.com/Paginating-search-results%2C-keeping-search-criteria%2C-and-not-messing-with-the-view-tf4899190.html#a14136056 Sent from the CakePHP mai

Problem adding new record with Id

2007-12-03 Thread dandreta
Hi! I have a problem and I cant solve it. I hope you can help me. I have a table called Records with fields Id and Name. I create model, controller and views with bake. In the model I validate that Id and name do not be empty and in the controller I have add function: function add() {

Xml layout name

2007-12-03 Thread Andreas
Hi I've been trying to use the xml layout but it's not going too well since the layout file itself is located within a subfolder called xml (xml/default.ctp) and I'm not sure how to reach it with $this->layout = '';? Andreas --~--~-~--~~~---~--~~ You received this

Re: Code critique? Anyone spare 5 mins to look over something?

2007-12-03 Thread bingo
hi, its seems fine, but you might be able to save lot of lines by using the http://bakery.cakephp.org/articles/view/an-improvement-to-unbindmodel-on-model-side extension Regards, Ritesh On Dec 3, 10:36 am, designvoid <[EMAIL PROTECTED]> wrote: > Hi all! > > I'm in the process of building my fi

html

2007-12-03 Thread firefox
how can i get a value from a pure html tag to my controller? --~--~-~--~~~---~--~~ 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 g

Using Pear with Oracle

2007-12-03 Thread Greg Baker
I seem to be having a little trouble getting cake to connect to Oracle using Pear. The config file says to use 'driver' => 'pear- drivername' (which I assume would be pear-oci8), but this does not work. So I tried using 'driver' => 'pear' which got me a little further.. Here's a snippet of my c

Re: custom GenerateList

2007-12-03 Thread grigri
The second method will still work with 1.2 On Dec 3, 3:38 pm, salimk786 <[EMAIL PROTECTED]> wrote: > It says Class 'Set' not found > I'm on Cake 1.4 not the 2. > > Thanks. > > On Dec 3, 4:30 am, grigri <[EMAIL PROTECTED]> wrote: > > > // Method one : use Set::extract() > > $data = $this->Attr

Re: custom GenerateList

2007-12-03 Thread salimk786
It says Class 'Set' not found I'm on Cake 1.4 not the 2. Thanks. On Dec 3, 4:30 am, grigri <[EMAIL PROTECTED]> wrote: > // Method one : use Set::extract() > $data = $this->Attribute->findAll(...); > > $ids = Set::extract($data, '{n}.Attribute.id}); > $status_arr = array_combine($ids, Set::ex

Code critique? Anyone spare 5 mins to look over something?

2007-12-03 Thread designvoid
Hi all! I'm in the process of building my first app with Cake and was wondering if someone could look over some code and let me know if what I have done is correct or waay off base... Its basically a few lines to get 3 different arrays populated with data from 2 tables via a HABTM releationship.

Re: Problems with save

2007-12-03 Thread hydra12
Try this: if(!empty($this->data)) { foreach ($this->data["Tiposviajesusuario"] as $tipo) { $t["usuario_id"] = $u["id"]; $t["tipo_id"] = $tipo;

Re: newbie question - multiple functions in a page

2007-12-03 Thread the_woodsman
Yes, with your tag cloud example, the core functionality for this might be best placed in the model. One reason to go through requestAction to call the model functionality is to reuse views. For example, perhaps your list of top ten posts in a specified category should appear the same way in load

changes in model relation in plugin #6115

2007-12-03 Thread francky06l
>From my previous post I discovered what was wrong. In a plugin, in case of model relation the className must be set with the pluginname.classname. Suppose a clt plugin and in a model such relation: ie var $belongsTo = array('Client' => array('className' => 'clt.Client')) --~--~-~--~

Re: New Cake App In The Wild

2007-12-03 Thread Jon Bennett
> Just launched an extremely basic web app using the 1.2 alpha. It's > called ClipRunner and basically served my own need of getting basic > text data from one computer to another. > > http://www.cliprunner.com When I first tried to use it, I entered some text, clicked on 'clip it' and was greete

CakePHP and PunBB

2007-12-03 Thread foxmask
Hi, PunBB create a cookie that way : setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed. $password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure, true); i dont find how CakePHP could read it. I've read the cookie component and all i conclude is I need to make my

Re: translate behavoiur + recursive

2007-12-03 Thread maniuch
> > I wouldn't go that far. It's just a little annoying, because you have > to set that kind of thing up manually. It can be done, though. > Of course, it can be done, but it needs some queries more and array manipulation to make it handy. It also can be done without this behaviour (i.e. lang co

Re: Getting information from an external database

2007-12-03 Thread Greg Baker
Thanks, Grant. Didn't think it would be that easy... The only issue I have is that the tables in this external database are not standard. For example student IDs are not stored in an 'id' field. However I'm sure I will get past that limitation. Greg On Dec 3, 3:02 am, Grant Cox <[EMAIL PROTEC

Re: Cake Scaling Limitations - What can it handle?

2007-12-03 Thread Dragos CHIRIAC
Wild guess : Try putting all your (relevant) keys in the db LONGINT(or similar). looks like you reached 32 768 on some autoincrement/identity or smth . If the value of the key at autoincrement field reached or passed the limit of the type you put in there, then you get errors. Also the int is

Re: Getting information from an external database

2007-12-03 Thread Chris Hartjes
On Dec 3, 2007 1:02 AM, Grant Cox <[EMAIL PROTECTED]> wrote: > > Connecting to multiple databases is easy. Just add the extra > connection to your /app/config/database.php, and have the appropriate > var $useDbConfig in your Student model class. If I understand Greg Baker's problem correctly, I'

Re: newbie question - multiple functions in a page

2007-12-03 Thread SeanW
On Dec 2, 7:56 pm, Adam Royle <[EMAIL PROTECTED]> wrote: > Using elements is what you want. Inside the elements you can use > requestAction to get at any data you wish to use. You can return an > array of data directly, or render a view. See tutorial here for an > example (and also how to cache th

Re: Cake Scaling Limitations - What can it handle?

2007-12-03 Thread Martin Wood-Mitrovski
i had a problem some time ago when an autoincrement id field didnt have enough storage space (it was set to signed SMALLINT, which gives you 32767 id's before it wraps around) now i make a habit of checking the type of the id column to make sure its either INTEGER or BIGINT it could be that

Problems with save

2007-12-03 Thread stefano
Hello i'm using the las version of cakephp1.2 i have a problem with Model->save this is my source --- if(!empty($this->data)) { foreach ($this->data["Tiposviajesusuario"] as $tipo) { $t["Tiposviajesusuario"]["usuario

Re: Cake Scaling Limitations - What can it handle?

2007-12-03 Thread Baz
If you think that having many records is an issue (which it's not), empty out the tables without changing any code and try again. -- Baz L Web Development 2.0: Web Design, CakePHP, Javascript http://www.WebDevelopment2.com/ On Dec 3, 2007 5:21 AM, AD7six <[EMAIL PROTECTED]> wrote: > > > > On Dec

Re: cakephp, extending to a subdomain?

2007-12-03 Thread Matt Kosoy
We run cake under subdomains on our server. We have 3 instances of our site, www.CLIENT.com, staging.CLIENT.com, and dev.CLIENT.com each subdomain has it's own 'installation' of cake. it's not a "true" extension, but it will work. -matt On Dec 2, 3:33 am, "Louie Miranda" <[EMAIL PROTECTE

Re: translate behavoiur + recursive

2007-12-03 Thread grigri
> Thank you for fast reply. Without this feature this is in fact usless > in medium/large or even small project... I wouldn't go that far. It's just a little annoying, because you have to set that kind of thing up manually. It can be done, though. Still, this is near the top of my wish-list of

Re: FormHelper, hidden field '_method'

2007-12-03 Thread a.php.programmer
'_method' for making a REST request. simulate a http method (PUT, DELETE...) On Dec 3, 6:47 pm, Serge Rodovnichenko <[EMAIL PROTECTED]> wrote: > $form->create() produces a 'form' tag, followed by hidden field > '_method'. What purpose of this option? --~--~-~--~~~---~

Re: translate behavoiur + recursive

2007-12-03 Thread maniuch
> The Translate behavior uses the beforeFind() callback, which sadly is > not supported on associated models. Even sadder, there are no plans to > fix this. > > > No, it doesn't make sense to me either. It looks like the model > association code is distributed over both the model and the > datas

Re: translate behavoiur + recursive

2007-12-03 Thread grigri
The Translate behavior uses the beforeFind() callback, which sadly is not supported on associated models. Even sadder, there are no plans to fix this. See https://trac.cakephp.org/ticket/3638 and https://trac.cakephp.org/ticket/1183 No, it doesn't make sense to me either. It looks like the mode

Re: Cake Scaling Limitations - What can it handle?

2007-12-03 Thread AD7six
On Dec 3, 11:45 am, bruceharrod <[EMAIL PROTECTED]> wrote: > Hello All, > > I have a cake app which logs and handles Orders and Quotes. Everything > has been working well up to now but as of last night, the Quotes model > doesn't want to save any more records. > > I currently have about 30K quot

translate behavoiur + recursive

2007-12-03 Thread maniuch
How to fetch translated fields form associated models? My Example: Models (extrected important parts): class System extends AppModel { var $actsAs = array('Translate' => array('name', 'description')); var $belongsTo = array( 'SystemType' => array('classNam

Save Error

2007-12-03 Thread [EMAIL PROTECTED]
Hello All, I have a cake app which logs and handles Orders and Quotes. Everything has been working well up to now but as of last night, the Quotes model doesn't want to save any more records. I currently have about 30K quotes already, could this be the problem? Just to test, I reverted back to

Cake Scaling Limitations - What can it handle?

2007-12-03 Thread bruceharrod
Hello All, I have a cake app which logs and handles Orders and Quotes. Everything has been working well up to now but as of last night, the Quotes model doesn't want to save any more records. I currently have about 30K quotes already, could this be the problem? Just to test, I reverted back to

translate behavoiur + recursive

2007-12-03 Thread maniuch
How to fetch translated fields form associated models? My Example: Models (extrected important parts): class System extends AppModel { var $actsAs = array('Translate' => array('name', 'description')); var $belongsTo = array( 'SystemType' => array('classNam

any twitter clone available to use...

2007-12-03 Thread sixlaneve
Hi all, I tried quite a few searches here and in google, without luck. I am looking for a twitter clone... I am not interesting in emulating twitter to be honest, but I like the "simple and essential" system, that could be use for other kinds of projects such as an intranet. any idea where I ca

Re: FormHelper, hidden field '_method'

2007-12-03 Thread Serge Rodovnichenko
P.S. Cake 1.2 from SVN. On Dec 3, 1:47 pm, Serge Rodovnichenko <[EMAIL PROTECTED]> wrote: > $form->create() produces a 'form' tag, followed by hidden field > '_method'. What purpose of this option? --~--~-~--~~~---~--~~ You received this message because you are sub

FormHelper, hidden field '_method'

2007-12-03 Thread Serge Rodovnichenko
$form->create() produces a 'form' tag, followed by hidden field '_method'. What purpose of this option? --~--~-~--~~~---~--~~ 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@g

Re: custom GenerateList

2007-12-03 Thread grigri
// Method one : use Set::extract() $data = $this->Attribute->findAll(...); $ids = Set::extract($data, '{n}.Attribute.id}); $status_arr = array_combine($ids, Set::extract($data, '{n}.Attribute.status')); $value_arr = array_combine($ids, Set::extract($data, '{n}.Attribute.value')); ... // Method t

IIS: Invalid URLs

2007-12-03 Thread Jack
Hi All Just ran through the typical "notes" example on IIS using scaffold to do the CRUD. I called up: http://localhost/php/cake/app/?notes and get the "List Notes" screen. However, clicking on "New Note" leads to the following invalid URL: /php/cake/app/index.php/notes/add (which, btw, crashes p

FOSDEM 2008 Brussels , Belgium 23-24 February

2007-12-03 Thread Marcin Domanski aka kabturek
Hey bakers, as some of you might already know there wil be a talk about CakePHP @ FOSDEM 2008 (Free and Open source Software Developers' European Meeting) by our favorite project manager - gwoo (http://www.fosdem.org/ 2008/schedule/events/246). There will also be a Firebug talk , php6 talk , DevRo

Re: newbie question - multiple functions in a page

2007-12-03 Thread maschoen
I'm fairly new to Cake too, so maybe I will hit something helpful here. The tutorial examples tend to make it look like 1 controller for 1 model and 1 model for 1 controller. This is not at all true. A controller can also use many models or even none. I think of a controller as the organizatio