Re: (Web Service) Using XML to Output HTML into my website
Hi, What about moving that data to an array and then use that array to show the information in html? Something as follow: $xml=Xml::build('YOUR XML URL'); $hotelFares = $xml-xpath('HotelFares_PATH_IN_XML'); You can even use Xml::toArray() to convert your object into an array. Is that what you was looking for? Regards, Fernando 2014-05-27 18:21 GMT-03:00 NHGDESIGN hover.tours.p...@gmail.com: Hello. I hope I can explain myself clearly so that I will get help here. I've been given a web service access to show content to my website (The web service is in a another domain). The information is about Hotels (Hotels names, Hotel Images, Hotel Category, Hotels Locations, Hotels descriptions). The file is like the following: soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope; xmlns:bud=http://www.softur.com.ar/wsbridge/budget.wsdl; xmlns:bud1= http://www.softur.com.ar/wsbridge/budget.xsd; soap:Header/ soap:Body bud:searchHotelFaresRQ1 !--Optional:-- cityLocation code=PMV / dateFrom2014-05-30/dateFrom dateTo2014-05-31/dateTo name/name pos idFakeID/id passwordFakePassWord/password /pos currencyUSD/currency OtherBrokertrue/OtherBroker FareTypeSelectionList xmlns= http://www.softur.com.ar/wsbridge/budget.xsd; FareTypeSelection OccupancyId=11/FareTypeSelection Ocuppancy OccupancyId=1 Occupants type=ADT / Occupants type=ADT / /Ocuppancy /FareTypeSelectionList /bud:searchHotelFaresRQ1 /soap:Body /soap:Envelope I am running that request using soapUI 3.5.1, which outputs an XML file with lots of data about Hotels. HotelFares UniqueId=HT|0011080 BackOfficeCode=000814 BackOfficeOperatorCode=00658 xmlns= HotelAddress xmlns= http://www.softur.com.ar/wsbridge/budget.xsd;Hotel Address/HotelAddress NameHOTEL AGUA DORADA/Name Category 4 */Category HotelPhone xmlns= http://www.softur.com.ar/wsbridge/budget.xsd;55/HotelPhone HotelZone xmlns= http://www.softur.com.ar/wsbridge/budget.xsd;Hotel Zone Area/HotelZone HotelAccess xmlns= http://www.softur.com.ar/wsbridge/budget.xsd;Address Description of the Hotel Here/HotelAccess HotelPosition xmlns= http://www.softur.com.ar/wsbridge/budget.xsd; Latitude-63.93631/Latitude Longitude11.022754/Longitude /HotelPosition /HotelFares I want to show that information as an HTML file into my website, but I don't know how to go about this. I guess saving these information appropriately into a database, and then spitting that information from the database to my website would be a way. Any help I can get here using CakePHP so that I would know where to start would really help. Thanks in advance. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout. -- Fernando Negrotto -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Best way to set up this Relation
Hey everybody. I am looking for some advice here. I got the following tables in my application: Movies and Celebrities. Celebrities can participate in movies as Actors, Directors and Script Writters. So, while editing a movie (or adding one) I should be able in my view to select in 3 different fields the Celebrities that take role in each part. I read that in these situations I should not use HABTM relations as it won't set the parameter that will allow me to differentiate Actors from Directors. So I would need to create a model for the relationship table and set HasMany relations instead. Does that sound correct? Also, if I'm creating a Model for this relation, how would my Movies Controller and View be set up? Thanks a lot in advance! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Login function doesn't work on client server
Yesterday I finally finished my first project. But when I test the admin login page I noticed that was no working, I put login and password correct and just back to the same page. After about 5 min the login page simply goes blank. Every time I enter the login page goes blank. What might be happening? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake Bake cannot connect to my database
Try to use: Terminal: sudo mkdir /var/mysql sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock Em sexta-feira, 21 de outubro de 2011 13h34min04s UTC-4, Nate escreveu: In manually setting everything up, I'm able to successfully add, modify, view, and remove products with scaffolding enabled. However, when I go into Bake, and I choose to create a [C]ontroller - it then asks for my database (default). I confirm that setting and I get this error: Warning Error: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in [/Users/nate/ Sites/tor.local/html/lib/Cake/Model/Datasource/Database/Mysql.php, line 160] Any ideas? Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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 cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
using group by and order by together
Hello friends, I have a doubt, I am working with two tables categories and posts on a given query want to display in my home only 1 post from each category, the last. As if it was the home of a forum. I am able to display one post from each category, but they can not be the last registered. Follow my code using group by and order by together http://bin.cakephp.org/saved/84693 Does anyone by chance has gone through this problem? Thank you in advance! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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 cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Upload by josegonzalez , i does not upload the file..
I installed the Plugin, i do not see any error it is saving to the Database, but not save the Dir fro the file. and DO not upload the file, here is my Code : my Model : class Picture extends AppModel { public function beforeValidate() { $this-data['Picture']['filename']['name'] = strtolower($this-data['Picture']['filename']['name']); return true; } public $actsAs = array( 'Upload.Upload' = array( 'filename' = array( 'fields' = array( 'dir' = 'dir', 'type' = 'mimetype', 'size' = 'filesize', ), 'thumbnailSizes' = array( 'xvga' = '1024x768', 'vga' = '640x480', 'thumb' = '80x80' ), 'pathMethod' = 'flat', 'path' = '{ROOT}webroot{DS}dvdpictures{DS}' ) ) ); public $validate = array( 'filename' = array( 'rule' = 'isSuccessfulWrite', 'message' = 'File was unsuccessfully written to the server' ) ); THE CONTROLLER : public function add($Subject = null, $idEvento = null) { if ($this-request-is('post')) { $this-Picture-create(); $this-request-data['Picture']['filename'] = AuthComponent::user('id') . '_' . $idEvento . '_' . $this-request-data['Picture']['filename']['name']; $this-request-data['Picture']['event_id'] = $idEvento; $this-request-data['Picture']['created'] = getdate(); if ($this-Picture-save($this-request-data)) { $this-redirect(array('action' = 'index', $Subject, $idEvento)); } else { $this-Session-setFlash(__('The Picture could not be saved. Please, try again.')); } } } What am i missing ?? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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 cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
I do not get an Error but only a The connection was reset
Hi I have this line of code in my XXXController.php : $this-request-data['Picture']['filename'] = $this-data['User']['ID'] + '_' + $idEvento + '_' + $this-request-data['Picture']['filename'] + ; I spent like 1 day trying to figure out, why when i run that Controller method just gave me an ugly browser error The connection was reset so, i opened my ayes better and find out that my line of code had an extra + , damn , i just removew that extra + and it worked fine. My Question is Why i did not got an error from the compiler/interpreter to tell me something wrong in that line? Thanks in advance -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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 cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Send email Shell Application
euromark I could not figure out how to make it work, Can you help me with an example? On Sat, Mar 31, 2012 at 6:01 AM, euromark dereurom...@googlemail.comwrote: @LITTO CHACKO: he wants to use it inside a shell, so he has to use the CakeEmail class (and not the compontent!) take a look at this question (as he already figured it out pretty good): http://ask.cakephp.org/questions/view/send_email_shell_application the only thing missing is that he should pass some settings to the class (in this case SMTP to send emails via this protocol) other than that is is fully functional also note that you should set the domain manually for Emails sent via CLI @see http://cakephp.lighthouseapp.com/projects/42648/tickets/2698-cakeemail-messageid-in-cli-environment Am Freitag, 30. März 2012 20:56:26 UTC+2 schrieb Fernando: I'm using cake 2.1 and I need to send emails by a Shell Application. I found no documentation about it. How can I do it? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Fernando Andreacci Biólogo Fone +55 47 9921 4015 fandrea...@gmail.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Send email Shell Application
The code: class EmailShell extends AppShell { #public $uses = array('Empresa', 'Licenca'); public function main() { App::uses('CakeEmail', 'Network/Email'); $email = new CakeEmail(); $email-from(array('EMAIL' = 'EMAIL')); $email -to('EMAIL'); $email-subject('About'); $email-send('My message'); $this -out('OK'); } } On Mon, Apr 2, 2012 at 1:33 PM, euromark dereurom...@googlemail.com wrote: without seeing the code you already tried out so far it is impossible to help you Am Montag, 2. April 2012 16:11:33 UTC+2 schrieb Fernando: euromark I could not figure out how to make it work, Can you help me with an example? -- Fernando Andreacci Biólogo Fone +55 47 9921 4015 fandrea...@gmail.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Fernando Andreacci Biólogo Fone +55 47 9921 4015 fandrea...@gmail.com -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Send email Shell Application
I'm using cake 2.1 and I need to send emails by a Shell Application. I found no documentation about it. How can I do it? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
How does $this-request-is('post') works?
Hello everyone! I'm having some trouble with the $this-request-is('post') object and hope I can get some answers here... In my controller I have the following: public function movie($action = list, $id = ) { if ($action == single) { if ($this-request-is('post')) { // Saves the record } elseif ($id != ) { // Load record info } else { // Load blank form } // Load other informations... $this-render('movie'); } } When i load a blank form at admin/movie/single and try to submit the form it works just fine and my record is saved. But, when i load a record using admin/filme/single/1 and try to update it, $this-request-is('post') returns false, and nothing happens... What am I doing wrong here? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Model Association and Find
Hello all! I've been programming in PHP for a while now but just started to use Cake in this new project I'm working. I have 3 Table I'd like to Associate together: Movies, Actors and Cast My Movie Model is set the following way: *public $hasAndBelongsToMany = array(* *'Elenco' = array(* *'className' = 'Personalidade',* *'joinTable' = 'filmes_personalidades',* *'foreignKey' = 'filme_id',* *'associationForeignKey' = 'personalidade_id',* *'unique' = true,* *'fields' = 'id,nome'* *)* ); When I use $this-Filme-find('all') it works fine and all the Actors are selected correctly. But when I try to filter movies that have a selected actor using: *$this-set('filmes', $this-Filme-find('all', array(* *'conditions' = array(Elenco.id = array($personalidade_id)),* *'limit' = 20,* *'page' = $pagina* *)));* Cake tells me *SQLSTATE[42S22]:* Column not found: 1054 Unknown column 'Elenco.id' in 'where clause'. What am I doing wrong? Thanks for the support in advance! Fernando Nery Filho* * -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Basic issue with HABTM
Hi guys, I am having some trouble with pretty basic things but it took me precious hours today, and I decided to ask for some light ... I have this config that I am trying to make work: http://bin.cakephp.org/view/2004163346 I baked everything with cake bake and I need a way to proper save all 3 models on submit Any hints or ideas ? -- Fernando Barrocal fbarro...@gmail.com +55 11 8257-7200 +55 11 3020-7332 skype: fbarrocal 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Do not show flash message when a url redirects to the login page
Set your layout to recognize when on the login page and encapsulate your flash message on a if based on this condition! On Tue, Nov 2, 2010 at 08:20, alberto alberto.pri...@gmail.com wrote: Hi, I was looking how to do not show flash message when a url redirects to the login page Thanks in advance! Alberto 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Fernando Barrocal fbarro...@gmail.com +55 11 8257-7200 +55 11 3020-7332 skype: fbarrocal 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Basic issue with HABTM
Some updates on here (paste bins are used to delete my post even when I ask to mantain) /* Tables /* users people contacts -- 1---1 n---n -- id id id username user_id phone f_name Yes, there is a people_contacts table with both Ids /* View */ ?php echo $this-Form-create('User'); echo $this-Form-input('username'); echo $this-Form-input('Person.f_name'); echo $this-Form-input('Contact.0.phone'); echo $this-Form-end(__('Submit', true)); ? /* Controller */ function register($step = create_account) { if (!empty($this-data)) { $this-User-create(); if ($this-User-saveAll($this-data)) { $this-Session-setFlash(__('The user has been saved', true)); } else { $this-Session-setFlash(__('The user could not be saved.', true)); } } } On Tue, Nov 2, 2010 at 22:15, Fernando Barrocal fbarro...@gmail.com wrote: Hi guys, I am having some trouble with pretty basic things but it took me precious hours today, and I decided to ask for some light ... I have this config that I am trying to make work: http://bin.cakephp.org/view/2004163346 I baked everything with cake bake and I need a way to proper save all 3 models on submit Any hints or ideas ? -- Fernando Barrocal fbarro...@gmail.com +55 11 8257-7200 +55 11 3020-7332 skype: fbarrocal -- Fernando Barrocal fbarro...@gmail.com +55 11 8257-7200 +55 11 3020-7332 skype: fbarrocal 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RadioButton on Form
Hello I have a page that contains two callings to generate radiobuttons. Like this: echo $this-Form-input('h2', array('type'='radio', 'options'=$Event1)); echo $this-Form-input('h2', array('type'='radio', 'options'=$Event2)); So, it generates two blocks of code with radiobuttons, but only one choice is available for all options. See the generated HTML ( http://pastebin.com/1nKdvMHn). *PROBLEM:* If I check a radio from the second box, I can catch its value in the $this-data correctly in the ['h2'] key. But, if I check a radio from the first box, my $this-data retrieve an empty value for ['h2'] key. It means, I can't get value if I check the first box. Could you help me? I guess it is something related with input type=hidden name=data[Matricula][h2] id=MatriculaH2_ value= / autogenerated part of code. Thank you Fernando. Vitoria, BRAZIL. 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: RadioButton on Form
Thats correct. But I solved it with jQuery $(TD#colunah2 #MatriculaH2_).remove(); :-D thank you. 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Recursive find but not in all models
Hi. I have a lot of relations between Users and another models. Like: User hasMany Download User belongsTo Company Company hasMany Product Download hasMany Type So I wanna use the find method, like $this-User-find('first', array('conditions'=bla bla bla)); But, it returns me ALL the data contained in Company, Product, etc... I don't want this. I just want the recursive find enters the Download table. Do someone have the idea of how can I do that? Thank you. 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Is it possible to write common code in one function and i have to call that function when i was required
Maybe you can do something like this: APP_CONTROLLER: function _mycode(){ $x = 8; $y = 10; return $x + $y; } USERS CONTROLLER: function something(){ echo $this-_mycode(); } function something_else(){ echo $this-_mycode(); } Bye 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Inflections on CakePHP Interactive Bake Shell
Well, it should. When i used those 1.2.x versions in my projects I had no problem with that. But nowadays, I`m full of headaches of trying to make Bake Shell recognize my Inflections in bootstrap.php (1.3 version). I don`t know if this is a problem of the core or what, but I prefer to make my Model manually and then, bake all those controller and views. Bye. On Wed, Apr 7, 2010 at 4:22 PM, Lucca Mordente luccamorde...@gmail.comwrote: Hello there! Does the Bake Shell use the app inflections.php rules? I want to add some inflection rules, but the Bake Shell can't recognize them. The other hand, the app does, perfectly. Thank you! 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe, reply using remove me as the subject. 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Paginator Helper - escape not working
Hi everyone. My Paginator Helper is not working properly. Check out my code: ?php echo $this-Paginator-prev(' anterior', array(), null, array('class'='disabled'));? *OUTPUT: OK* ?php echo $this-Paginator-next('próximo ', array(), null, array('class' = 'disabled'));? *OUTPUT: NOTHING (blank string)* * * ?php echo $this-Paginator-next('proacute;ximo ', array('escape'=false), null, array('class' = 'disabled'));? *OUTPUT: proacute;ximo [should output 'próximo ']* With image: ?php echo $this-Paginator-prev($this-Html-image('app_arrow_left.png', array('title'='Paacute;gina anterior')), array('escape'=false), '', array('class'='disabled'));? *OUTPUT: **img src=/img/app_arrow_left.png title=Pamp;aacute;gina anterior alt= /* *SHOULD OUTPUT: an image* I mean, the option 'escape'=false is not working as it should be. I am using 1.3 RC3 version, but it had already happend with me in the 1.2.x versions. I had the solution changing the core paginator.php, but i don`t like to do that. Have anyone had this same problem? Thank you. FERNANDO - BRASIL. 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: ACL Component GOOD Tutorial, anyone?
I am already having the same problem [?] Lot of tutorials, lot of knowledge but nothing that really explain everything about that. 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 To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en 361.gif
Is it possible? Many domains, the same application
Hello everyone. My name is Fernando. I`m from Brazil. This is my first message in the group. I have one question about cake-solutions. Let me explation what i mean. Imagine that i have the table Websites which contains 5 fields. id int(5) name varchar(100) domain varchar (255) country varchar(50) stylesheet varchar(40) Lets consider also, that i have 3 rows in the table (actually, the table will have thousands of lines), but its only an example: id name domain country stylesheet 1 PAULhttp://www.paul.com BRASIL 31.css 2 JOHNhttp://www.john.com USA9.css 3 JACKhttp://www.jack.com CANADA 322.css In my system, i have installed my cake like this way (imagine windows only for example - my app will be placed in a linux). c:\cake [this is the core] c:\www\allsites [this is the app folder] Let me say also that all domains (paul.com, john.com, jack.com) points to the same folder (c:\www\allsites) So, very easy to understand. Now is my question: When the visitor comes into whatever site, is cake able to load information from the database according to the typed URL? I mean: if i type www.john.com or john.com is that possible to do something that recognizes the URL and retrive all the Websites table information and all the related table only from id number 2 (which is john) and place the stylesheet 9.css into the rendered page? Has someone done any system like that which has only one app folder for many sites at the same time? This system will receive thousands of visits per day. Thank you Fernando --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: TCPDF and Cake PHP
Hello everybody, Thanks very much everybody helps me. I follow all steps that qwanta said and the pdf generate works! In my view I put: ?php App::import('Vendor','xtcpdf'); $tcpdf = new XTCPDF(); $textfont = 'freesans'; // looks better, finer, and more condensed than 'dejavusans' $tcpdf-SetAuthor(KBS Homes Properties a http://kbs-properties.com;); $tcpdf-SetAutoPageBreak( false ); $tcpdf-setHeaderFont(array($textfont,'',20)); $tcpdf-xheadercolor = array(150,0,0); $tcpdf-xheadertext = 'Test'; $tcpdf-xfootertext = 'Copyright © %d KBS Homes Properties. All rights reserved.'; // Now you position and print your page content // example: $tcpdf-SetTextColor(0, 0, 0); $tcpdf-SetFont($textfont,'B',20); $tcpdf-Cell(0,14, Hello World, 0,1,'L'); // ... // etc. // see the TCPDF examples $tcpdf-Output('filename.pdf', 'I'); ? Thanks again (specially qwanta and modfather)!!! see you! On 1 dez, 20:18, modfather [EMAIL PROTECTED] wrote: You might try and remove echo from your last line of code and leave it as: $tcpdf-Output('filename.pdf', 'D'); I don't know how your routes are set up but you might try 127.0.0.1/cake/myapp/teacher/viewpdf/1 - you are missing the action from your url. On Dec 1, 10:34 pm, Fernando Mendonça [EMAIL PROTECTED] wrote: Hi everybody, I'm trying to generate some pdfs files with Cake PHP and TCPDF with Bakery Tutorial of this address:http://bakery.cakephp.org/articles/view/creating-pdf-files-with-cakep... I did everything like this tutorial and I wrote in one of my controller (teacher_controller.php) the follow code: function __view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Teacher.', true)); $this-redirect(array('action'='index')); } $this-set('teacher', $this-Teacher-read(null, $id)); } function viewPdf($id = null) { if (!$id) { $this-Session-setFlash('Sorry, there was no property ID submitted.'); $this-redirect(array('action'='index'), null, true); } //Configure::write('debug',0); // Otherwise we cannot use this method while developing $id = intval($id); $property = $this-__view($id); // here the data is pulled from the database and set for the view if (empty($property)) { $this-Session-setFlash('Sorry, there is no property with the submitted ID.'); $this-redirect(array('action'='index'), null, true); } $this-layout = 'pdf'; //this will use the pdf.ctp layout $this-render(); } I created the view (viewPdf.ctp) too: ?php App::import('Vendor','xtcpdf'); $tcpdf = new XTCPDF(); $textfont = 'freesans'; // looks better, finer, and more condensed than 'dejavusans' $tcpdf-SetAuthor(KBS Homes Properties athttp://kbs-properties.com;); $tcpdf-SetAutoPageBreak( false ); $tcpdf-setHeaderFont(array($textfont,'',40)); $tcpdf-xheadercolor = array(150,0,0); $tcpdf-xheadertext = 'KBS Homes Properties'; $tcpdf-xfootertext = 'Copyright © %d KBS Homes Properties. All rights reserved.'; // Now you position and print your page content // example: $tcpdf-SetTextColor(0, 0, 0); $tcpdf-SetFont($textfont,'B',20); $tcpdf-Cell(0,14, Hello World, 0,1,'L'); // ... // etc. // see the TCPDF examples echo $tcpdf-Output('filename.pdf', 'D'); ? But when I try to acess: 127.0.0.1/cake/myapp/teacher/1 the message Sorry, there is no property with the submitted ID. appears. I know this message has to appears when nothing is set to $property, but I thing I'm doing this. Anybody Can help me? Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
TCPDF and Cake PHP
Hi everybody, I'm trying to generate some pdfs files with Cake PHP and TCPDF with Bakery Tutorial of this address: http://bakery.cakephp.org/articles/view/creating-pdf-files-with-cakephp-and-tcpdf I did everything like this tutorial and I wrote in one of my controller (teacher_controller.php) the follow code: function __view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Teacher.', true)); $this-redirect(array('action'='index')); } $this-set('teacher', $this-Teacher-read(null, $id)); } function viewPdf($id = null) { if (!$id) { $this-Session-setFlash('Sorry, there was no property ID submitted.'); $this-redirect(array('action'='index'), null, true); } //Configure::write('debug',0); // Otherwise we cannot use this method while developing $id = intval($id); $property = $this-__view($id); // here the data is pulled from the database and set for the view if (empty($property)) { $this-Session-setFlash('Sorry, there is no property with the submitted ID.'); $this-redirect(array('action'='index'), null, true); } $this-layout = 'pdf'; //this will use the pdf.ctp layout $this-render(); } I created the view (viewPdf.ctp) too: ?php App::import('Vendor','xtcpdf'); $tcpdf = new XTCPDF(); $textfont = 'freesans'; // looks better, finer, and more condensed than 'dejavusans' $tcpdf-SetAuthor(KBS Homes Properties at http://kbs-properties.com;); $tcpdf-SetAutoPageBreak( false ); $tcpdf-setHeaderFont(array($textfont,'',40)); $tcpdf-xheadercolor = array(150,0,0); $tcpdf-xheadertext = 'KBS Homes Properties'; $tcpdf-xfootertext = 'Copyright © %d KBS Homes Properties. All rights reserved.'; // Now you position and print your page content // example: $tcpdf-SetTextColor(0, 0, 0); $tcpdf-SetFont($textfont,'B',20); $tcpdf-Cell(0,14, Hello World, 0,1,'L'); // ... // etc. // see the TCPDF examples echo $tcpdf-Output('filename.pdf', 'D'); ? But when I try to acess: 127.0.0.1/cake/myapp/teacher/1 the message Sorry, there is no property with the submitted ID. appears. I know this message has to appears when nothing is set to $property, but I thing I'm doing this. Anybody Can help me? Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Date format in Grid
Anybody? On 11 out, 15:26, Fernando Mendonça [EMAIL PROTECTED] wrote: Hi again guys, I'm with another problem. I need to change dedateformatthat appears in my grid. I was reading the manual and I try to use the TimeHelper but it didn't work. Look please my view Reserve, page index.ctp: td ?php echo $time-format($format= 'd-m-Y', $reserve['Reserve'] ['reserve_date']); ? /td td ?php echo $reserve['Reserve']['reserve_time']; ? /td I´ve just wrote this... Anybody can help me? Thanks again --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Date format in Grid
Hi Writing: ?php echo $time-format($format = 'd-m-Y', $reserve['Reserve'] ['reserve_date']); ? in my index.ctp page the date in grid disappears. This line didn't work. On 15 out, 15:39, teknoid [EMAIL PROTECTED] wrote: What do you mean by didn't work? On Oct 15, 1:17 pm, Fernando Mendonça [EMAIL PROTECTED] wrote: Anybody? On 11 out, 15:26, Fernando Mendonça [EMAIL PROTECTED] wrote: Hi again guys, I'm with another problem. I need to change dedateformatthat appears in my grid. I was reading the manual and I try to use the TimeHelper but it didn't work. Look please my view Reserve, page index.ctp: td ?php echo $time-format($format= 'd-m-Y', $reserve['Reserve'] ['reserve_date']); ? /td td ?php echo $reserve['Reserve']['reserve_time']; ? /td I´ve just wrote this... Anybody can help me? Thanks again --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Date in another language
Thank you very much. This problem was solved. ;) Thanks again On 9 out, 10:45, Simonas Juodelis [EMAIL PROTECTED] wrote: I don't know if this have changed in recent vesions (I use older one - 1663), but when I need to translate some application to another language I do this way ( for example for my (lithuanian) language): create directory cake/app/locale/lit/LC_MESSAGES/ put here file default.po contents of this file should be like this: msgid January msgstr Sausis msgid February msgstr Vasaris .. and so on. This works for me. Hope this helps. br, Simonas. Fernando Mendonça wrote: Hi, I didn't define translation of months. How can I do that? I've just created the two directories: cake\myappdir\locale\pt_br I don't know what I have to write in this file (default.po). On 9 out, 09:41, Simonas Juodelis [EMAIL PROTECTED] wrote: I see that months are defined in forms helper, on line 01658 (http://api.cakephp.org/1.2/form_8php-source.html#l01658) and it should be translated. Have you defined translation of months in your language translation (*.po) files? br, Simonas, Fernando Mendonça wrote: Hello I'm using cakephp cake_1.2.0.7296-rc2 This version is not the newest? Thanks On 9 out, 08:27, Simonas Juodelis [EMAIL PROTECTED] wrote: Hi, what version on CakePHP you are using? I'm asking, because months were translated into other languages only in recent versions. Probably you are using old version. Please try downloading newest version of CakePHP. br, Simonas. Fernando Mendonça wrote: Hello everybody, I'm trying to change the values of my date´s SELECT but it's not working. I need the values like January, February appears in Portuguese in to SELECT. I already put setlocale(LC_ALL, pt_BR.utf-8); in my bootstrasp.php in the application directory (myapplication/config/bootstrap.php) but it´s not working yet. Help me friends... Thanks! :o) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Date format in Grid
Hi again guys, I'm with another problem. I need to change de date format that appears in my grid. I was reading the manual and I try to use the TimeHelper but it didn't work. Look please my view Reserve, page index.ctp: td ?php echo $time-format($format = 'd-m-Y', $reserve['Reserve'] ['reserve_date']); ? /td td ?php echo $reserve['Reserve']['reserve_time']; ? /td I´ve just wrote this... Anybody can help me? Thanks again --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Date in another language
Hi, I didn't define translation of months. How can I do that? I've just created the two directories: cake\myappdir\locale\pt_br I don't know what I have to write in this file (default.po). On 9 out, 09:41, Simonas Juodelis [EMAIL PROTECTED] wrote: I see that months are defined in forms helper, on line 01658 (http://api.cakephp.org/1.2/form_8php-source.html#l01658) and it should be translated. Have you defined translation of months in your language translation (*.po) files? br, Simonas, Fernando Mendonça wrote: Hello I'm using cakephp cake_1.2.0.7296-rc2 This version is not the newest? Thanks On 9 out, 08:27, Simonas Juodelis [EMAIL PROTECTED] wrote: Hi, what version on CakePHP you are using? I'm asking, because months were translated into other languages only in recent versions. Probably you are using old version. Please try downloading newest version of CakePHP. br, Simonas. Fernando Mendonça wrote: Hello everybody, I'm trying to change the values of my date´s SELECT but it's not working. I need the values like January, February appears in Portuguese in to SELECT. I already put setlocale(LC_ALL, pt_BR.utf-8); in my bootstrasp.php in the application directory (myapplication/config/bootstrap.php) but it´s not working yet. Help me friends... Thanks! :o) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Date in another language
Hello everybody, I'm trying to change the values of my date´s SELECT but it's not working. I need the values like January, February appears in Portuguese in to SELECT. I already put setlocale(LC_ALL, pt_BR.utf-8); in my bootstrasp.php in the application directory (myapplication/config/bootstrap.php) but it´s not working yet. Help me friends... Thanks! :o) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Date in another language
Hello I'm using cakephp cake_1.2.0.7296-rc2 This version is not the newest? Thanks On 9 out, 08:27, Simonas Juodelis [EMAIL PROTECTED] wrote: Hi, what version on CakePHP you are using? I'm asking, because months were translated into other languages only in recent versions. Probably you are using old version. Please try downloading newest version of CakePHP. br, Simonas. Fernando Mendonça wrote: Hello everybody, I'm trying to change the values of my date´s SELECT but it's not working. I need the values like January, February appears in Portuguese in to SELECT. I already put setlocale(LC_ALL, pt_BR.utf-8); in my bootstrasp.php in the application directory (myapplication/config/bootstrap.php) but it´s not working yet. Help me friends... Thanks! :o) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help a Learner
Hello everybody, I've a problem... I'm starting to learn how to use CakePHP and I'm trying to write a new Action in one of my Controllers. I need to recuperate values sent by a View and validate them. The idea is: The user makes a reserve to one Official in one Date and Time. I've to verify if this reserve already exists in my database when he tries to make another one. So, I wrote this Action in Reserve Controller: function verifyReserve($official, $date, $time) { if($this-Reserve-query(SELECT COUNT(reserves.id) FROM reserves WHERE official_id='$official' AND reserve_date='$date' AND reserve_time='$time') != 0) { return true; } else { return false; } } And into the Action Add of the Reserve Controller I wrote this validade: if(($this-Reserve-verifyReserve($this-data['Reserve'] ['official_id'], $this-data['Reserve']['reserve_date'], $this- data['Reserve']['reserve_time'])) == true) { $this-Session-setFlash(Already exists an reserve for this official on this date and time.'); $this-set('officials', $this-Reserve-Official-generateList(null, 'name', null,'{n}.Offical.id','{n}.Official.name')); $this-set('customers', $this-Reserve-Customer-generateList(null, 'name', null,'{n}.Customer.id','{n}.Customer.name')); } However, when I try to make a reserve an error occurs: Query: verifyReserve Warning: SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'verifyReserve' at line 1 in C:\xampp\htdocs\cake \cake\libs\model\datasources\dbo_source.php on line 440 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\cake\cake\basics.php:697) in C: \xampp\htdocs\cake\cake\libs\controller\controller.php on line 447 Help me, please. Thanks :o) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: simple noob question - accessing model functions from bootstrap.php
I'm no Cake god either, but my first idea was to do it on AppController... Put this on app_controller.php, on the /app directory: ?php class AppController extends Controller { function beforeFilter() { $configModel = loadModel(configModelName); $parameters = $configModel-findAll(); foreach ($parameters as $parameter) define($parameter['Parameter']['name'], $parameter['Parameter'] ['value']); } } ? You just have to be careful that the constant value ( $parameter['Parameter']['value'] ) always evaluate to a scalar value (i.e., it's not an array or object). Greetings, Luiz F. On Dec 16, 2:21 pm, glastoveteran [EMAIL PROTECTED] wrote: Hi all, Sorry for the stupid question, but how can I access a model's function (.e.g. findAll) from bootstrap.php? i.e. I have configuration parameters stored in a db table and I want to set them as constants at startup time. My model name is Parameter (parameter.php). // something like $parameters = $this-model-Parameter-findAll(); foreach ($parameters as $parameter) { define($parameter['Parameter']['name'], $parameter['Parameter'] ['value']); } Thanks, Alex --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cake e IIS
Boa Tarde Galera, Alguém já usou o cake com IIS? Gostaria de saber como é a configuração do mod_rewrite. Tenho uma aplicação funcionando no apache quando coloco os arquivos no servidor não funciona. Att, Fernando. --~--~-~--~~~---~--~~ Recebeu esta mensagem porque está inscrito em Grupo Cake PHP Português do Grupos Google. Para enviar mensagens para este grupo, envie um email para cake-php-pt@googlegroups.com Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED] Para mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-PT -~--~~~~--~~--~--~---
Re: RES: Problemas Bake
O bake peca no sentindo de reconhecer o relacionamentos, pois pega somente pelo id. Vou fazer como o Daniel disse altero na mão! Se alguém souber de uma outra solução, poste por favor! Em 20/09/07, Haroldo Barbosa[EMAIL PROTECTED] escreveu: Helio Ricardo wrote: Eu desisti do bake faz tempo... Nos prende muito e acabamos gastando mais tempo do que ganhando... Faço os models e controllers (com scaf...) na mão e depois vou detalhando ... Ficou bem marápido de produzir aqui... Vlw, Hélio -Mensagem original- De: cake-php-pt@googlegroups.com [mailto:[EMAIL PROTECTED] Em nome de Haroldo Barbosa Enviada em: quinta-feira, 20 de setembro de 2007 12:35 Para: cake-php-pt@googlegroups.com Assunto: Re: Problemas Bake Daniel César wrote: Bem, esta associação pode ser feita a mão mesmo. no código do model categoria, voce deve inserir uma variavel $hasMany, e colocar os atributos indicando a tabela, e no model dica deve ser colocada uma variavel $belongsTo. Segue um exemplo em branco de como devem ser colocadas estas variaveis: var $hasMany = array( 'NomeAssociacao' = // Por padrão, o bake cria como sendo o nome do model associado, mas não há problema em mudar. array('className' = '',//Aqui deve-se colocar o nome da classe(model) que esta se associando. 'foreignKey' = '',// Aqui voce define qual o campo na tabela que será a chave estrangeira. 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'dependent' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ), ); var $belongsTo = array( 'NomeAssociacao' = array('className' = '', 'foreignKey' = '', 'conditions' = '', 'fields' = '', 'order' = '', 'counterCache' = '' ), ); Veja ai se entendeu. On 9/20/07, *Rafael Barbosa * [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: O padrão do cake é esse, é o que garante o funcionamento correto de tudo nele da forma mais fácil. Ele herdou tudo isso do Ruby On Rails. Mas existem formas de ir contra isso sim hehehe dá uma procurada na documentação e no próprio código do cake. Tem um atributo da classe model em que você define tanto o nome da tabela (caso o model não tenha o nome da tabela no singular) e o nome da chave primária. Em sistemas pequenos e médios é mais fácil seguir o padrão do cake. É uma mão na roda tremenda =) On 9/20/07, * Fernando Aires* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: O ruim e porque não fica personalizado...o cake so reconhece...id? Tulio, o que você tem a dizer? Qual a melhor solução? Em 20/09/07, Rafael Barbosa[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] escreveu: Tenta uitilizar id como chave primária e tabela_id como chave estrangeira. Por exemplo troque os campos cat_nu na tabela categoria por id, o campo dic_nu na tabela dica tbm. E troca o campo cat_nu na tabela dica por categoria_id On 9/20/07, Fernando Aires [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Estou criando minhas tabelas no dbdesigner. CREATE TABLE categoria ( cat_nu INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, cat_nome VARCHAR(50) NULL, PRIMARY KEY(cat_nu) ); CREATE TABLE dica ( dic_nu INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, cat_nu INTEGER UNSIGNED NOT NULL, dic_texto TEXT NULL, dic_titulo VARCHAR(200) NULL, PRIMARY KEY(dic_nu), INDEX dicas_FKIndex1(cat_nu) ); Mas quando estou executando o bake...ele não reconhece a associação. O que estou fazendo errado? Primeiro estou fazendo o model da categoria. Atenciosamente, Fernando. -- Rafael Barbosa Analista de Sistemas Web Gradua Networks -- Rafael Barbosa Analista de Sistemas Web Gradua Networks -- Atenciosamente, Daniel César Santos Porto Bachalerando em Ciencia
Function to format Date/Time for insertion on database
Hi there guys, I know what the subject may make it look like, but my question is not related to standard PHP functions like date(), strftotime(), and the like. What I'm looking for is a function (that would probably be provided by Cake) that would abstract the date formatting used in the underlying database. Right now I'm using MySQL. In my application, I'm fetching the birthdate of the user using separate select's for each field (day, month and year). Then, at the controller, I join these together by concatenating the year, month and day by the - character, that results in a MySQL compatible date format, and insert/update this into the database. However, I see that this format may not be compatible for other databases, and would require me to modify the concatenation method if in the future I decide to migrate the application to another database. So, what I'm asking for is if there's a function that, given a series of parameters respective to each date field, or a single parameter (like a timestamp) would return me a string with a date formatted in a way compatible with the underlying database. Is there such a thing on Cake? Thanks, Luiz --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Multiple form fields with the same name.
Sorry about the possibly newbie question, but I was searching for answers all over the web and find nothing, so here I go: When working with multiple form fields with the same name in PHP I was used to the syntax looking like this: input type=text name=fieldName[] value= / input type=text name=fieldName[] value= / input type=text name=fieldName[] value= / ... By this way, PHP would put all my fieldName fields in a single array inside the $_POST['fieldName'] variable. My question is how can I use the same type of functionality (multiple fields, same names) with cakePHP, is that possible? I'm currently using something like: input type=text name=Field/Name_1 value= / input type=text name=Field/Name_2 value= / input type=text name=Field/Name_3 value= / ... But this solution looks really bad and ugly for me... If I need to validate this fields in the cakePHP way, I would have to define every single validation rule... that's not cool too... any solution? Thanks in Advance. Fernando Kreigne. --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
highlight validations erros
hi, cake can hightlight form validation errors like ruby on rails? if it is possible, how to do this? tks --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
flash and FlashOut
what is the difrence betwen flash and FlashOut ? I'm usign $this-flash(my message,myurl,2), but it not redirects after 2 seconds to myurl, what is wrong? tks --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
findall in select tag
there is a helper to use the results by findall in a select tag? --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: redirect after a short delay
$this-($message, $url, 5 ) and change 'app/config/core.php' define('DEBUG', 0); eDevil escreveu: I've tried $this-flash but the problem is that it just shows the message. I want to render the page /app/views/users/logout.thtml and then redirect after 5 seconds. any suggestions? --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Scaffolding??
if u have a model correponding to the controller, it's all done. Luke escreveu: OK, I did what the manual said to do to use scaffolding. I put var $scaffolding inside my controller. Now what?? That manual just sort of stops there... what do I do now? --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: MySQL Question
I think that cake have SelectBySql() it's works at mssql I think that will work at mysql ... SELECT first_name + last_name as full_name from my table? Olivier Percebois-Garve escreveu: Well if it is mysql specific you could use DESCRIBE. With that you could then get the fieldname in the table and play with them in order to find first_ and last_ olivvv John Zimmerman [gmail] wrote: This is more of a MySQL question than a CakePHP question, but I thought I would ask here first. I did a little bit of searching on this but can't find any decent leads to the answer so far. I am hoping someone here just knows, as I don't know exactly how to refer to what I am trying to do. I am working with PHP 5, MySQL 5 and CakePHP 1.1.4.x. What I would like to know is this Is it possible to have a "virtual" or "composite" type field in MySQL that is basically two other fields put together? AND if this feature exists in MySQL is it useable with CakePHP? A simplistic example of this would be that in a table called 'users' I would have fields of 'first_name' and 'last_name'. What I would like to do is to be able to query for 'name' and get "first_name"."last_name". So basically... first_name = John last_name = Zimmerman when I query for 'name' I want to get "John Zimmerman" Any help is appreciated. --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Use another view
Render, was what I need.It's because, I don't want a view for Edit and a view for Add, the diference about the views in my case, are only 1 form field, and 1 shot descriptionso I will try to use the same view..tksOlivier Percebois-Garve escreveu: Hi See http://manual.cakephp.org/chapter/7 for Interacting with your Views - render() if you want to request in another controller use requestAction(). You might be confusing the MVC structure: There is function in the model and controller files, but not in the views (normally). Olivvv Fernando Andreacci wrote: If I have a funcion called function1, can I use a view called function2 to this function? -- Fernando AndreacciDesenvolvimento Setti Sistemas Ltda. Fone(47)3028-2445/> -- Fernando AndreacciDesenvolvimentoSetti Sistemas Ltda.Fone(47)3028-2445 --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Use another view
If I have a funcion called function1, can I use a view called function2 to this function? -- Fernando AndreacciDesenvolvimentoSetti Sistemas Ltda.Fone(47)3028-2445 --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
GooooooooooooooooaaaaaaaLLLLL
Brazil Hexa gwoo escreveu: paste your controller and view in the cakebin. http://cakephp.org/pastes/add or jump on irc http://irc.cakephp.org we can fix you up. --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
css rules
hey, I'm trying to use a css rule to set a footer.. div.footer { font-size: 13px; font-family: Arial; text-align: center; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 18px } note, I'm breaking the page with style="page-break-after:always;" So, my footer works well at my first page, but it did not appers at the second, third ... pages.. someone help me!!! I know, that it's not a cake question, but I'm using cake and I know that u r very cool people :) --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Ajax Form Serialization
form id="test" input type="text" name="ftest1" id="ftest1" / input type="text" name="ftest2" id="ftest2" / /form script alert(alert(Form.serialize(test)); /script ftest1=ftest1valueftest2=ftest2value will alert the input values... if they are not null so u can send this values trought url to do something without submit hydra12 escreveu: I'm about to show my ignorance, I'm afraid. I've found several references to serializing a form, but I don't really understand what this means. Can anybody help me out with an explanation? Thanks in advance! hydra12 --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Scaffold (prompt forms)
how to change the (promp/caption) of scaffold forms? --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
mssql limit not works
mssql limt in findall not works... always return... SELECT TOP 30 --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
scaffold validate erros
how to customize scaffold validate errors? X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.54.68.15 with SMTP id q15mr204676wra; Mon, 22 May 2006 12:48:10 -0700 (PDT) Return-Path: [EMAIL PROTECTED] Received: from setti.com.br (200.175.44.5.static.gvt.net.br [200.175.44.5]) by mx.googlegroups.com with ESMTP id v23si1148248cwb.2006.05.22.12.48.05; Mon, 22 May 2006 12:48:10 -0700 (PDT) Received-SPF: neutral (googlegroups.com: 200.175.44.5 is neither permitted nor denied by best guess record for domain of [EMAIL PROTECTED]) Received: (qmail 12050 invoked by uid 49); 22 May 2006 19:49:21 - Received: from [EMAIL PROTECTED] by web.setti.com.br by uid 89 with qmail-scanner-1.22 ( Clear:RC:1(192.168.0.202):. Processed in 0.038445 secs); 22 May 2006 19:49:21 - Received: from unknown (HELO ?192.168.0.202?) ([EMAIL PROTECTED]) by web.setti.com.br with SMTP; 22 May 2006 19:49:21 - Message-ID: [EMAIL PROTECTED] Date: Mon, 22 May 2006 16:46:12 -0300 From: Fernando [EMAIL PROTECTED] User-Agent: Thunderbird 1.5 (Windows/20051201) Mime-Version: 1.0 Content-Type: text/plain To: cake-php@googlegroups.com Subject: scaffold validate erros how to customize scaffold validate errors? --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---