Re: retrieve related model data

2010-03-25 Thread sebb86
sure! :-) [code of model port] public $belongsTo = array( 'HardwareUnit' => array( 'className' => 'HardwareUnit' ), 'Vlan' => array( 'className' => 'Vlan' ), 'PortEmploymentGroup' => array( 'className' => 'PortEmploymentGroup'

Re: retrieve related model data

2010-03-25 Thread Jeremy Burns
Can you show me your entire $hasMany and $belongsTo declarations, and your find statement? Jeremy Burns jeremybu...@me.com On 26 Mar 2010, at 06:24, sebb86 wrote: > Jeremy Burns > > Hello again :) > Code in the model of my port-table: > > (the $hasOne association from my origionally question

Re: retrieve related model data

2010-03-25 Thread sebb86
Jeremy Burns Hello again :) Code in the model of my port-table: (the $hasOne association from my origionally question was updated to the association below:) [code] public $hasMany = array( 'Port' => array( 'className' => 'Port', 'foreignKey' => 'uplink_id' ) ); [/code] I

Re: retrieve related model data

2010-03-25 Thread Jeremy Burns
Do you have the self join set up inside your model? Something like this: var $belongsTo = array( 'ParentPort' => array( 'className' => 'Port', 'foreignKey' => 'uplink_id' ) ); Then you can include the

Re: retrieve related model data

2010-03-25 Thread sebb86
I use this in my controller: [controller code] var $paginate = array( 'fields' => array('*'), 'recursive' => 2, 'limit' => 50, 'order' => array('Port.hardware_unit_id' => 'asc'), 'contain' => array(

Re: 3rd party app - installation issues

2010-03-25 Thread Jeremy Burns
Try installing it in /app/webroot/xxx, where xxx is a folder that you want your app to run in. Then access it via http://yoursite.com/xxx. I have put WordPress and all sorts in there without needing to change .htaccess or anything. I have also set up a subdomain pointing to that folder and acces

Re: Undefined index

2010-03-25 Thread Jeremy Burns
Have you debugged the data that is being presented to the controller function? Set debug to 2 and type die(debug($this->data)); as the first instruction, then take a look at what you see. Is password there? You might need to do something like $this->data[0]['password'], for example. Jeremy Burn

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread Jeremy Burns
The .htaccess files can be hidden and therefore missed when doing an upload. Seems like a basic thing - but are the .htaccess files on the sever? Jeremy Burns jeremybu...@me.com On 25 Mar 2010, at 22:59, cricket wrote: > On Mar 25, 4:31 pm, WhyNotSmile > wrote: >> WebbedIT - I haven't made any

Re: Multiple Recordsets in Same View

2010-03-25 Thread Jeremy Burns
I'd recommend that you read the section of the online guide that deals with models, in particular: http://book.cakephp.org/view/1039/Associations-Linking-Models-Together. This shows how you create a model for each table and then link them together. I'd also look at the containable behaviour: h

Re: Multiple Table-Model, Multiple DB

2010-03-25 Thread Jeremy Burns
Golly this is a long answer and I'm sorry if it sounds like an unhelpful rant. But I feel I need to make you rethink your strategy. Forgive me for saying this, but it does rather sound as if you are reinventing the wheel and giving yourself a bunch of challenges along the way. A well set up MyS

Re: Find Output Thoughts (why the not remove ['ModelName'])

2010-03-25 Thread Lucas Costa
I see, the thing about save (and also reminded me of the form data) is a good point. I guess this might be indeed the better format for the default find data. Guess I'll just do my own "find" method for beautifying data for my views. Thanks to all for the reply. Bake on On 25 mar, 09:12, euroma

Re: CakeFest IV - America - Help us pick a location!

2010-03-25 Thread Martin
USA West Coast, please. :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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 T

Broken search on http://book.cakephp.org/

2010-03-25 Thread Martin
Have others noticed that the search option on http://book.cakephp.org/ is broken? It no longer returns snippets of text with the search results, just basic and repeating titles. Martin Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions

Re: CakeFest IV - America - Help us pick a location!

2010-03-25 Thread shusta guthnar
I would much love to be haveing this in locations of Quality Inn 1220 West Main Street, Stroudsburg, PA. It has many thumbs up way high for good places and they have much foods for eating in mornings. no cost any monies and is best delicious. love and kittens, shusta On Mar 16, 10:45 am, piousb

Re: cake schema run update gone crazy

2010-03-25 Thread shusta guthnar
I am not visible of this however. I am not haveing Snow Leopards which internets are you useing. It is only with Web 2.0 Shusta On Mar 25, 9:02 am, Martin Westin wrote: > I thought I'd give schema migrations a try. But something small must > be horribly wrong with how I am trying to use the sc

Re: hasMany & Containable Problems

2010-03-25 Thread shusta guthnar
Yes, you are haveing a case of specifically not seperations of domains. If you left join haveing an operator on right you will be haveing much successes. Many Happy adjustments Shusta On Mar 25, 1:55 pm, Abdul-Hamid wrote: > Hello, > > I've got the following two > modelshttp://bin.cakephp.org

Re: Multiple Recordsets in Same View

2010-03-25 Thread shusta guthnar
Much confusion haveing many recordsets. To be haveing them with seperations is analagous with haveing two seperators thank you for haveing successes and successfulness. Happiness in helping, Shusta On Mar 25, 12:02 pm, Alper K. Tunç wrote: > Hello all, > > I'm one of the latest fans of CakeP

3rd party app - installation issues

2010-03-25 Thread ltix
I need to use a 3rd party app (phpsitemapng), but not sure where to install it. I'm using the app to create a site wide sitemap.xml and then I will submit it to the search engines. If I install it outside of "/app" then I assume I will need to modify ".htaccess". Although, I'm having trouble with

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread cricket
On Mar 25, 4:31 pm, WhyNotSmile wrote: > WebbedIT - I haven't made any changes to the .htaccess files from > their initial setup, as downloaded from the Cake repository.  I don't > really understand them, to be honest, so I tend to just leave them as > they are. The .htaccess file inside app simp

Re: Empty relation belongsto 1.3

2010-03-25 Thread RobertMeisner
its not intuitive at all. And now i need to do major rewrite of the app... i hoped some1 would tell its only RC2 "feature" and in live it s going to be as it should be... Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread Jon Bennett
> Thanks for the suggestion - I tried this, and got php_info working > fine.  I can't see anything obvious, although my local one explicitly > says mod_rewrite is enabled, whereas the live one doesn't mention it. > On the other hand, an earlier version of the site on this server DID > work fine, so

Re: making fpdf work in cakephp

2010-03-25 Thread cricket
On Mar 25, 11:59 am, butterlamb wrote: > Thanks! This seemed to work, but now I'm getting this error message, > instead of my index page: > > Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, > line 127] > > FPDF error: Incorrect orientation: array > > Here's the line the error is

Re: Multiple Recordsets in Same View

2010-03-25 Thread cricket
It depends on the situation. If the models are associated, it's easy enough to do $this->Model->find(...) and $this->Model->OtherModel- >find(...) in the same action. In your case, though, it looks like the two models wouldn't necessarily be associated. So, you could look at using requestAction().

Re: Trailing Slash redirect (SEO) and CakePHP Forms

2010-03-25 Thread Jon Bennett
> I'm not too experient about .htaccess, but what if you use a rewrite > rule instead of a redirect? Another option is to have 2 urls to access the content, but set one of them as the canonical url for that item. On the other hand, I really don't follow why you'd want/need/worry about SEO for for

Undefined index

2010-03-25 Thread Ed Propsner
I'm still goofing with forms, ajax, validation, etc. trying to learn Cake. I have a form set up with a field for password[code] $form->input('User.password'); [/code] When I reference that field in the controller [code] $pw1 = $this->data['User']['password'];[/code] I keep getting

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread WhyNotSmile
WebbedIT - I haven't made any changes to the .htaccess files from their initial setup, as downloaded from the Cake repository. I don't really understand them, to be honest, so I tend to just leave them as they are. Would it be using the security component? Does it do that automatically (sorry, I

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread WhyNotSmile
Thanks for the suggestion - I tried this, and got php_info working fine. I can't see anything obvious, although my local one explicitly says mod_rewrite is enabled, whereas the live one doesn't mention it. On the other hand, an earlier version of the site on this server DID work fine, so I think i

Re: Empty relation belongsto 1.3

2010-03-25 Thread Jamie
The reason for the empty hasOne relation is because Cake LEFT JOINs the relation and doesn't check for an empty record before returning the array. You can specify INNER if you want when declaring the relationship, but then if the related record is empty nothing will be returned. I suspect that's wh

Re: Empty relation belongsto 1.3

2010-03-25 Thread Jamie
The blank hasOne array (with all of the empty keys) has always struck me as the most counter-intuitive thing ever. An empty relation should be completely empty. If this is now the case with belongsTo (I haven't tested), then that seems to be a step backwards. On Mar 24, 4:19 pm, RobertMeisner wr

hasMany & Containable Problems

2010-03-25 Thread Abdul-Hamid
Hello, I've got the following two models http://bin.cakephp.org/saved/57087 http://bin.cakephp.org/saved/57088 And the following in the CustomerAccounts Controller http://bin.cakephp.org/view/689658989 What I am trying to do is to retrieve all customer account information that have a domain name

Multiple Recordsets in Same View

2010-03-25 Thread Alper K . Tunç
Hello all, I'm one of the latest fans of CakePHP. I met with the framework through a Google search for "PHP frameworks" and looking at the features (and the cute name of course) decided on CakePHP. I went through the blog tutorial and studied some stuff from web. Now I feel ready to shoot with my

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread Luiz Paulo Nascimento
i mean for 'every file', every model/view/controller file that you have created. LP 2010/3/25 Luiz Paulo Nascimento : > i had a similar problem months ago. after a lot of trying, i've edited > the uploaded files directly on server to eliminate blank > lines/characters at the end of every file. An

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread Luiz Paulo Nascimento
i had a similar problem months ago. after a lot of trying, i've edited the uploaded files directly on server to eliminate blank lines/characters at the end of every file. And it worked! :P Not so logical, but it's worth to give a try. Good luck. LP 2010/3/24 WhyNotSmile : > Thanks Jeremy. > > DB

Multiple Table-Model, Multiple DB

2010-03-25 Thread cupidoly
I am newbie in CakePHP, using it only for 2 days. I am using PHP 5.2.10, MySQL 5.0.84, CakePHP 1.2.6. I have two questions. Scenario 1. While designing my site in paper, I decided to split my tables into parts ( For example, member table will be like member_us_ny, member_us_ca, member_intl_en, m

Re: Trailing Slash redirect (SEO) and CakePHP Forms

2010-03-25 Thread Lucca Mordente
I'm not too experient about .htaccess, but what if you use a rewrite rule instead of a redirect? Lucca Mordente On 24 mar, 17:39, "Andreas D." wrote: > Hi there! > I have a Problem with my App. > In my .htaccess, i added some lines to redirect the user if the url > ends without a slash to the sa

Re: Saving form does not save item corresponding to select input type

2010-03-25 Thread hvannia
Your'e right [CODE] echo $form->input('User.role_id',array('options'=> $roles) ); [/CODE] works thanks ! On Mar 24, 5:46 pm, cricket wrote: > On Mar 24, 4:29 pm, hvannia wrote: > > > I have a controller where i get the user roles and set them so they > > can be displayed on the view as a selec

Re: cake schema run update gone crazy

2010-03-25 Thread Martin Westin
Ah. Thanks for the hint. I have models for all tables... BUT the schema generator does not find them all since some are in plugins and some are in sub-foldes of app/ models. I guess tables matching these models are the cause of the problem. So in reality, schema shell is only fully usable in apps

Re: making fpdf work in cakephp

2010-03-25 Thread butterlamb
Thanks! This seemed to work, but now I'm getting this error message, instead of my index page: Notice (8): Array to string conversion [APP\vendors\fpdf\fpdf.php, line 127] FPDF error: Incorrect orientation: array Here's the line the error is citing: $orientation=strtolower($orientation);

missing HABTM associated models

2010-03-25 Thread Johannes Goll
how do you fetch model information that is associated with tables that have a HBTM relationship? I have projects users project_users libraries projects and users are linked via a HBTM relationship projects have many libraries (hasMany) a search returns only the HBTM models and no Libraries (wh

Re: cake schema run update gone crazy

2010-03-25 Thread Ian M. Jones
Hi Martin, Have you got models defined for all the tables in your schema file? If not, running "cake schema run update" will try to add all the columns for any tables missing model files, so I discovered myself today. Regards, Ian IMiJ Ltd http://www.im

cake schema run update gone crazy

2010-03-25 Thread Martin Westin
I thought I'd give schema migrations a try. But something small must be horribly wrong with how I am trying to use the schema shell. I run "cake schema run update" on the database that just generated the schema and the shell wants to add all the columns to the tables again. That can't be right? Wh

Re: form helper ESCAPING quotes character values?? a bug?

2010-03-25 Thread euromark
escape should not be true but FALSE in this case On 25 Mrz., 08:41, "toka...@gmail.com" wrote: > Hi, > How can I escape double quotes when using form helper? Imagine we have > this value with double quotes stored in database: 15" - 16" > > How can I render a correct HTML select box? ..now it does

Re: Find Output Thoughts (why the not remove ['ModelName'])

2010-03-25 Thread euromark
why the overhead? controller: $article = $this->Article->read(null, $id); $this->set(compact("article")); view: echo $article['Article']['field']; etc usually you have left joins in it anyway - so parent models are retrieved too and could/need to be accessed as well: echo $article['User']['fiel

Re: access global inputfields in multiple controller

2010-03-25 Thread euromark
yes, there is! $form->create('Modelname', array('url' => '/'.$this->params[url] [url])) On 25 Mrz., 11:56, Baeckerlehrling wrote: > I've figured out a solution, but I'd like to get some feedback if it's > complete crazy to do something like this: > > in views/layouts/default.ctp I added >    

Re: access global inputfields in multiple controller

2010-03-25 Thread Baeckerlehrling
I've figured out a solution, but I'd like to get some feedback if it's complete crazy to do something like this: in views/layouts/default.ctp I added renderElement('menus/navigation'); ?> views/elements/menues/navigation.ctp : link(".events","/events"); echo $

Re: Disabling passedArgs

2010-03-25 Thread rich...@home
It looks like the ':' delimiter is set in /cake/router.php around line 99: var $named = array( 'default' => array('page', 'fields', 'order', 'limit', 'recursive', 'sort', 'direction', 'step'), 'greedy' => true, 'separator' => ':',

Disabling passedArgs

2010-03-25 Thread Macademic
I have an application that uses ids that have colons in them (and no way around it). Is there a way I disable passedArgs or at least change the delimiter? Stuart Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this me

Re: Find Output Thoughts (why the not remove ['ModelName'])

2010-03-25 Thread rich...@home
I'm with WebbedIT on this one. And besides, you can always do something like the following in your controller: $data = $this->Article->read(null, $id); $article = $data['Article']; $this->set(compact("article", "data")); and access $article['name'] etc. in your view. On Mar 24, 7:52 pm, Lucas

Re: Helpers

2010-03-25 Thread WebbedIT
It's a long road worth travelling :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegr

Re: Data validation rule (between) never returns true

2010-03-25 Thread WebbedIT
For reference here are the custom validation rules I use: function __validateConfirmPassword($field) { $valid = false; if ($this->data['User']['password'] == Security::hash(Configure::read('Security.salt'). $field['password_confirm']) { $valid = true; } return $valid; } function __val

Re: Data validation rule (between) never returns true

2010-03-25 Thread WebbedIT
Here are my user custom validation methods function __validateConfirmPassword($field) { $valid = false; if ($this->data['User']['password'] == Security::hash(Configure::read('Security.salt') . $field['password_confirm']) { $valid = true; } return $valid; } function __validatePasswordL

Re: Blank page when CakePHP is uploaded to the server

2010-03-25 Thread WebbedIT
Problems when uploading to a server are normally associated with .htaccess/url rewriting, but a white screen can also be indicative of the security component blackholing a request. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. Yo

Re: Find Output Thoughts (why the not remove ['ModelName'])

2010-03-25 Thread WebbedIT
It may take a little extra typing but the default array format is great because regardless of what you call your array each field can instantly be linked to it's model and is in a format that can be passed back to Model::save. I think the advantages of how all the automagic works with this array f

form helper ESCAPING quotes character values?? a bug?

2010-03-25 Thread toka...@gmail.com
Hi, How can I escape double quotes when using form helper? Imagine we have this value with double quotes stored in database: 15" - 16" How can I render a correct HTML select box? ..now it does this mess !! 15" - 16" is it a bug?? is there any workaround? PS1: escape => true is not he