Re: order in hasOne associations not implemented?
hasOne associations are implemented via an SQL LEFT JOIN, which means you can use hasOne associated fields in your conditions or ordering automatically in calls to find/findAll. --~--~-~--~~~---~--~~ 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: install cakephp; Rootserver needed?
By 'root server' I'm assuming you mean 'root access,' and no, you don't need it to install. Ideally, you want to have only your /app/webroot/ directory publicly accessible, but in practical terms it really doesn't matter. You can just drop the entire install folder in your publicly accessible directory (which I would assume is /html from looking at it). --~--~-~--~~~---~--~~ 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: Model::read() : fetch the first level with conditional argument
Hey Felipe, If I understand you correctly, whenever you retrieve data about a MailList Model you would like to only grab the "Active" Email Models along with it. I think it is possible in defining your HABTM relationship to set conditions such as: "status = 'Active'" i.e. var $hasAndBelongsToMany = array ( 'Email' => array ( 'class' => 'Email', 'conditions' => 'status = \'Active\'' ) ); check this against the manual as I'm a little bit slow on this particular Sunday but I think you should be right. You can also do a similar thing with the bindModel() function to set these kind of conditions / relationships on the fly. Hope this helps, freedom On 02/09/06, Felipe Nascimento <[EMAIL PROTECTED]> wrote: > > Hi all, > > I have the following model objects: > > MailList hasManyAndBelongsTo Email > > The Email object has an "active" boolean attribute. In the page that > shows the details of a MailList and wanted to list only the active > Emails of that MailList. > > If I use MailList::read(null, $id), then I get all Emails in the > resulting query. How is a good way to solve this? Do I need to write a > specific SQL query and use query() to get only the active Emails from > a MailList?? Or is there a MailList->someMethod() that I can use? > > Tks > Felipe > > > > --~--~-~--~~~---~--~~ 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: newbie: Obfuscating a CakePhp project
That is flawed logic Chris. That is like saying why put a lock on your house if there is lock picking kits available and people that can pick your lock in 10 seconds. Because a lock on your house will prevent 99.9% of the people from breaking in. Besides if you are in the business of making web applications, especially for companies that have their own development departments, then you want to obfuscate your code to protect your intellectual property. This of course deals totally in the realm of paid for software development. >From what I can tell on SourceGuardian once you get it setup to work like you want it on your first project, that to run it on future projects would only take 5 minutes to setup and run. So, the protection of your intellectual property from 99.9% of people and it taking only 5 minutes to do is well worth the time and investment. Also Chris when developing web applications for companies that have people that understand coding, I run into this problem all the time. You make some code where they can see the actual coding. Then, they understand enough coding to get what is going on, but not actually fully understanding it. They either make changes or try to implement new features and then start calling you when things are broken. So, protecting your app from a companies DIY coders is also important. There off the soap box for intellectual property protection and companies DIY coders hacking up your code, but still blaming you since the code originated from you. Case in point is how many people ask for help and then you find out they have modified their core CakePHP installation. They still blame Cake developers for not including what they wanted instead of trying to understand the CakePHP way to do it. --~--~-~--~~~---~--~~ 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 Submit in Document with Multiple Forms?
if u can seend me thtml too please andrzejborkowski(att)gmail.com --~--~-~--~~~---~--~~ 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: Image uploading in FCKeditor?
Glad that you got it working. but I cant tell anything about your question... sorry [EMAIL PROTECTED] wrote: > Hi Olivier - I followed your instructions in your other post and I did > get it to work. Do you know why it works if you use > app/webroot/files/fck as the upload directory, but it doesn't work if > you use app/webroot/img? > > > > > > --~--~-~--~~~---~--~~ 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: Image uploading in FCKeditor?
Hi Olivier - I followed your instructions in your other post and I did get it to work. Do you know why it works if you use app/webroot/files/fck as the upload directory, but it doesn't work if you use app/webroot/img? --~--~-~--~~~---~--~~ 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: order in hasOne associations not implemented?
how does something that hasOne have ordering? perhaps what you are looking for is a hasMany with an ordering and a limit of 1 On 9/2/06, Evan <[EMAIL PROTECTED]> wrote: > > I defined my model with this association: > > class Topic extends AppModel > { > var $name = 'Topic'; > > var $hasOne = array( > 'LatestPost'=> array( > 'className' => 'Post', > 'order' => 'LatestPost.created DESC' > ) > ); > } > > And yet I get this on the SQL debug: > > SELECT `LatestPost`.`id`, `LatestPost`.`title`, `LatestPost`.`content`, > `LatestPost`.`topic_id`, `LatestPost`.`user_id`, > `LatestPost`.`created`, `LatestPost`.`modified` FROM `posts` AS > `LatestPost` WHERE 1 = 1 AND `LatestPost`.`topic_id` = '13' > > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
order in hasOne associations not implemented?
I defined my model with this association: class Topic extends AppModel { var $name = 'Topic'; var $hasOne = array( 'LatestPost'=> array( 'className' => 'Post', 'order' => 'LatestPost.created DESC' ) ); } And yet I get this on the SQL debug: SELECT `LatestPost`.`id`, `LatestPost`.`title`, `LatestPost`.`content`, `LatestPost`.`topic_id`, `LatestPost`.`user_id`, `LatestPost`.`created`, `LatestPost`.`modified` FROM `posts` AS `LatestPost` WHERE 1 = 1 AND `LatestPost`.`topic_id` = '13' --~--~-~--~~~---~--~~ 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: request for a tutorial
Hi ralph, Probably, I mean't both, simplifying code and optimizing performance. But given the status of my project, I think right now I am more concerned with simplifying the code. I was able to achieve some degree of simplification by creating a method in App_model class that check if the records exists or not. If not then save the data and return its id otherwise retreive the appropriate record and return its id. Regards Bingo --~--~-~--~~~---~--~~ 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: Should I relate the ACL tables to other tables in my DB?
I have decided to go with phpgacl and use that instead of cakes ACL. I am very new to Cake and ACL for that matter, and maybe that's why I have had such a hard time figuring out how to use Cakes ACL. To other bakes who want to experiment with Cakes ACL i recogmmend this article: http://www.thinkingphp.org/2006/05/31/cakephp-and-acl-why-is-it-so-difficult/ It helped me clear up a few points. I think dbALCL takes a bit more experience with Cake than I have right now, and I have actually found it easier to integrate phpgacl into the cake app. --~--~-~--~~~---~--~~ 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: has many through associations
Cake 1.2 currently has limited support for 'through', but it is only functional for MySQL, and it only works for HABTM associations. There is no documentation on it, but it goes a little something like this: class Post extends AppModel { var $hasAndBelongsToMany = array("Author" => array("with" => "Authorship")); } Then, any join table fields will be selected into the Authorship association. And it only works for reading, not saving. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
install cakephp; Rootserver needed?
Hi there, my server supports php and 2 sql Databases. It is not a root server! Do I need one to install cakePHP? I don't know, which format I should install on the server. There are 3 different types: .tar.bz2 .tar.gz .zip When I enter my webspace I have 6 folders: /backup /files /html /log /phptmp /restore I cannot create a folder in this level. Where do I have to put which above mentioned file? Sorry for asking those basic questions. I searched already a lot but had not found answers, tutorials or anything concerning them. Cheers, Seb-el --~--~-~--~~~---~--~~ 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: newbie: Obfuscating a CakePhp project
M., I'm curious as to why you want to obfuscate your project? Personally, I don't think that you gain anything by obsfucating your PHP code. Why? I'd rather spend my time and effort on other things and not worrying about people stealing something I've built. Given the number of tools available on the internet to deobfuscate things, it seems pointless to me...and then what do you do if someone uses one of these things and now has a clear view of your source code? On 9/2/06, M <[EMAIL PROTECTED]> wrote: > > Hello, As I am shipping an application to a customer, I would like to > obfuscate my Cake Php project. > > Has anyone any suggestion on which product to use and which directories > to protect? > > Thanks, > > M. > > > > > -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: NON-CAKE files within cakephp framework.
okay. I took my old index page and called it test.thtml, moved it to /app/view/pages/test.thtml I copied /cake/lib/page_controller.php to /app/controllers/page_controller.php I then hit http://www.mysite.home/pages/test and I get: The requested URL /app/webroot/index.php was not found on this server. I can't see what the controller is missing... --~--~-~--~~~---~--~~ 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: newbie: Obfuscating a CakePhp project
SourceGuardian is another option. It does a good job at obfuscating and is pretty easy to install (it actually runs as a PHP extension). The good thing is you can set timeout for your code (demo) and some other things that may be of use. Typically common things available to the desktop programmer, but not to the web programmer like the demo code, timeout periods, etc. --~--~-~--~~~---~--~~ 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: NON-CAKE files within cakephp framework.
John, I didn't see your reply when I made my second post but it contains a wealth of information for newbies.. thanks VERY much and I will try and follow some of what you said. Can't promise I won't be back with more lame questions though :-) --~--~-~--~~~---~--~~ 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: request for a tutorial
Optimizing = simplifying? I'm assuming you don't mean optimizing performance. --~--~-~--~~~---~--~~ 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: NON-CAKE files within cakephp framework.
thanks... If I understand what you correctly, I will create: /app/controllers/foos_controller.php class FoosController extends AppController { function show() { //not sure what goes here to display the html fragment I want //but i'll try and figure it out } } Won't cakephp barf because I don't have a 'foo' table in my db? Am I on the right track with the above? I meant that the cakephp manual assumes that all views have an associated model and controller. It's hard to grasp that coming from a legacy, spaghetti-code php tradition, or at least grasp it well enough to know what to do when your supposed view has no model and hence no need for a 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: NON-CAKE files within cakephp framework.
olivw, Is there any documentation or examples of using the pages controller? I looked at the API, and can probably go from there with some trial and error, but it would help to see a few words on how best to use it. I think it might be very useful to me. Thanks. --~--~-~--~~~---~--~~ 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: NON-CAKE files within cakephp framework.
On Sep 2, 2006, at 11:12 AM, Olivier Percebois-Garve wrote: > > 1. use the page controller. > 2.use elements or in the layout file. > 3.use the page controller. > 4. Dunno what "NON-CAKE files" are but again, just use the page > controller. > > olivvv > > globalnomad wrote: >> please help me with these newbie questions: >> >> 1) do I have to have a default.thtml for my entire site? because >> right >> now I just stuck my files as they are in webroot and I have no >> template >> or layout files. Is that bad cake? the reason for this is that I >> haven't gotten to data-driven pages yet. Place static pages in /app/views/pages and access them via /pages/ pageName. Keeping your site layout centralize will save you headaches later on. >> >> 2) what do you if you want repeatable sections of PURE html (eg >> headers >> and footers etc) in their own file? I just want to extract the >> and tags for all the static pages destined for >> display in a particular iframe into a separate file. Headers and footers would probably end up in the layout (/app/views/ layouts/default.thtml), but you can also use elements or requestAction () to bring things in. >> >> 3) Once you create a layout, how do you use it if it doesn't need a >> controller and a model because it isn't data-driven? what would you >> call the controller in that case? And how would you access the >> controller / layout? Just use the pages controller, meant to serve up static pages. Its a Cake core controller, so you shouldn't really need to edit it or see it it just serves up static pages, right? The layout used is the default layout, found in app/views/layouts/ default.thtml. >> >> 4) failing all the above, does anyone have a tutorial for using cake >> with NON-CAKE files please!! It really depends on what kind of files. For static HTML, remove any layout-related code and move it into a Cake layout, and put the HTML templates in /app/views/pages. For 3rd party classes, you can use the vendors folder, and include the files using vendors('nameOfFileWithoutDotPHP');. >> I get the mvc stuff but I just don't get >> how to use the framework for cases where there IS NO MODEL. In the controller, declare your $uses array as null. var $uses = null; -- John --~--~-~--~~~---~--~~ 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: has many through associations
I don't yet have a wide knowledge of all the possibilities in Cake, but I use an SQL VIEW to make multi-table joins easier. MySQL 5 supports SQL VIEWs. Creating the SQL VIEW is done in advance, from the MySQL command line or from any admin utility such as eskuel or phpmyadmin. A working example: CREATE VIEW courses_students_teachers_scheduleblocks AS SELECT concat(courses_students.course_id,courses_students.student_id,courses.teacher_id,courses.scheduleblock_id) AS id, courses.scheduleblock_id AS scheduleblock_id, courses.id AS course_id, courses.subject AS subject, teachers.id AS teacher_id, teachers.teacher_fname AS teacher_fname, teachers.teacher_lname AS teacher_lname, students.id AS student_id, students.lname AS student_lname, students.fname AS student_fname FROM courses_students, courses, students, teachers, scheduleblocks WHERE ((courses.id = courses_students.course_id) AND (courses_students.student_id = students.id) AND (courses.teacher_id = teachers.id) AND (scheduleblocks.id = courses.scheduleblock_id)); This view can then be used to simplify queries that might otherwise be repetitious and harder to understand. If desired, a model and controller, even a Cake view, can be built for such an SQL VIEW, just as for an ordinary table - Cake does not know the difference, since I've synthesized an id by concatenating the ids from all the real tables. I don't know whether this view could be updated. I haven't tried. --~--~-~--~~~---~--~~ 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: NON-CAKE files within cakephp framework.
1. use the page controller. 2.use elements or in the layout file. 3.use the page controller. 4. Dunno what "NON-CAKE files" are but again, just use the page controller. olivvv globalnomad wrote: > please help me with these newbie questions: > > 1) do I have to have a default.thtml for my entire site? because right > now I just stuck my files as they are in webroot and I have no template > or layout files. Is that bad cake? the reason for this is that I > haven't gotten to data-driven pages yet. > > 2) what do you if you want repeatable sections of PURE html (eg headers > and footers etc) in their own file? I just want to extract the > and tags for all the static pages destined for > display in a particular iframe into a separate file. > > 3) Once you create a layout, how do you use it if it doesn't need a > controller and a model because it isn't data-driven? what would you > call the controller in that case? And how would you access the > controller / layout? > > 4) failing all the above, does anyone have a tutorial for using cake > with NON-CAKE files please!! I get the mvc stuff but I just don't get > how to use the framework for cases where there IS NO MODEL. The cakephp > manual completely circumvents this issue but this is how most ppl will > convert their sites (slowly) to cakephp. > > :-( > > pls help... > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
NON-CAKE files within cakephp framework.
please help me with these newbie questions: 1) do I have to have a default.thtml for my entire site? because right now I just stuck my files as they are in webroot and I have no template or layout files. Is that bad cake? the reason for this is that I haven't gotten to data-driven pages yet. 2) what do you if you want repeatable sections of PURE html (eg headers and footers etc) in their own file? I just want to extract the and tags for all the static pages destined for display in a particular iframe into a separate file. 3) Once you create a layout, how do you use it if it doesn't need a controller and a model because it isn't data-driven? what would you call the controller in that case? And how would you access the controller / layout? 4) failing all the above, does anyone have a tutorial for using cake with NON-CAKE files please!! I get the mvc stuff but I just don't get how to use the framework for cases where there IS NO MODEL. The cakephp manual completely circumvents this issue but this is how most ppl will convert their sites (slowly) to cakephp. :-( pls help... --~--~-~--~~~---~--~~ 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: Image uploading in FCKeditor?
did you looked at that ? http://groups.google.fr/group/cake-php/browse_thread/thread/de6ecd314cb7597/22aa22e717f6e456?lnk=gst&q=fck&rnum=2#22aa22e717f6e456 [EMAIL PROTECTED] wrote: > Does anyone have image uploading working with FCKeditor 2.3.1 and > CakePHP 1.1.7.3363? I followed the tutorial but it still doesn't work: > > http://wiki.cakephp.org/tutorials:online_editor-fckeditor?s=fckeditor > > The FCKeditor seems to work great with Cake except for image uploading. > > > > > > --~--~-~--~~~---~--~~ 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: open_basedir restriction in effect Help Needed
Judging by the path, I'm thinking you might be hosted on Media Temple. If that's the case, here's how I fixed my open_basedir problem... Log into the shell. Within your site's domain folder (/var/www/vhosts/begreennow.com/) is another folder called "conf." Inside that folder is a file called "httpd.include." Use a text editor to open that file (I used vi). Once inside that file, you'll see Apache configurations for your begreennow.com domain, as well as any subdomains you might have for it. There should be a line that says... php_admin_value open_basedir "/var/www/vhosts/begreennow.comBLAHBLAHBLAH" Comment out that line by putting a "#" at the beginning of it, and save the file. Make sure that you then reboot your server, and hopefully the problem will disappear. I don't really now why that setting exists, but it does. Hope this might have helped. --~--~-~--~~~---~--~~ 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: 1:many association where order is important
i think i finally got it working http://rafb.net/paste/results/P82ywU79.html probably hacky code, i'm way too tired, will cleanup later --~--~-~--~~~---~--~~ 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: best way to include common element
Hi Jon, hores ? ;) You are right that it isn't appropriate for all situations, for example My site map is constructed using this logic: function collectInfo() { loop here $SomeInfo[] = $this->requestAction ("/$AController/neverRenders"); end loop $this->set('data'$SomeInfo); } function neverRenders() { $this->autoLayout = false; $this->autoRender = false; return array('a'=>'value); // It returns a value! } The choice of approach should depend on if you want the data or the rendered view. As needlessly requesting the data, makes your code longer. Anyway as you were saying regarding horses ;) Cheers, AD7six --~--~-~--~~~---~--~~ 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: newbie: Obfuscating a CakePhp project
Make sure you only obfuscate you app/ folder. The source for everything in the cake/ directory must be provided Afaik this isn't the case with the MIT license used for CakePHP. However, if it would be true, all php files with the MIT license notice on top inside the app folder (~ /config/*, /webroot/index.php, ...) would need to be excluded from the obfuscation as well. -- http://www.thinkingphp.org http://www.fg-webdesign.de --~--~-~--~~~---~--~~ 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: Pulling data to the home page
Hi All, AJAX and requestAction are unrelated, my comment was wrt how to organise code. If you are using renderAction to pull info from another controller method, to then pass it to the view and be processed by an element - that's quite round the houses. I don't know if that /is/ what the intention was, which is why I asked 'why'. For clarification and an example of how requestAction can be used to organise things nice-n-easy see: http://groups.google.com/group/cake-php/browse_thread/thread/63689f6171aa5cf3/27b15a01b48a2acb?lnk=gst&q=AD7six&rnum=1#27b15a01b48a2acb HTH, AD7six --~--~-~--~~~---~--~~ 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: best way to include common element
> There is however this in the sidebar: > requestAction("/miBlog/tags/",array("return"=>true)); > ?> personally I prefer to not render directly in this kind of situation, becuase doing so ties the function up, and in this instance would mean that you couldn't use the data retrieval aspect of the function to say populate a selectTag in an edit form, though for a tag cloud it's a good idea. hores for courses really ;) jb -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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 Submit in Document with Multiple Forms?
Here is an example (it's a cake site) if you want the thtml files to see let me know off list, but this should get you started http://www.runningshopaz.com/contact/ Sam D On 9/2/06, jonathan <[EMAIL PROTECTED]> wrote: > > I am attempting to submit a form with the ajax->submit helper and it > doesn't submit. I used Firebug to confirm that nothing happens when I > hit the submit button. > > I checked my code with a known working example (Graham Bird's AJAX > tutorial) and the code is the same except my document has multiple > forms in it. Is this somehow interfering with the AJAX submit? Is > there a way to target the partcular form I need to use? > > Thanks for any input! > > Jonathan > > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Image uploading in FCKeditor?
Does anyone have image uploading working with FCKeditor 2.3.1 and CakePHP 1.1.7.3363? I followed the tutorial but it still doesn't work: http://wiki.cakephp.org/tutorials:online_editor-fckeditor?s=fckeditor The FCKeditor seems to work great with Cake except for image uploading. --~--~-~--~~~---~--~~ 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: problems using php include() within cakephp
Hi, thanks so much for the response.. it makes so much sense and yet leaves me completely confused. I guess you are saying i need a layout file eg. foo.thtml which has: right? The problem is that the site I am converting works is actually built up of several layers (divs), 2 of which have iframes within them. one iframe is for a set of submenu links, and the other is for displaying the link content, so I have no page refreshes - I change content for each iframe using javascript and innerHTML changes. it is the second iframe (the main content) for which I want a standard header and footer. these pages aren't data-driven (yet) - so how do I associate them with layouts - I have nothing to put in a model or controller yet? : The main page [EMAIL PROTECTED] wrote: > If you have header and footers that are common to multiple pages they > should be in the default layout. There really isn't the need to > include them as files anymore using the layout templates. > --~--~-~--~~~---~--~~ 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: best way to include common element
Hi Zoltan, There's more than one way to do what you want to acheive and rather than write too much I'll just use an example On this page: http://www.noswad.me.uk/MiBlog There is no direct reference to a tagcloud, There is however this in the sidebar: requestAction("/miBlog/tags/",array("return"=>true)); ?> (with an associated controller, model(s) and view). Cheers, AD7six --~--~-~--~~~---~--~~ 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: newbie: Obfuscating a CakePhp project
You could try Zend Guard. Make sure you only obfuscate you app/ folder. The source for everything in the cake/ directory must be provided as-is. Not sure how it works and never used it tho. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
AJAX Submit in Document with Multiple Forms?
I am attempting to submit a form with the ajax->submit helper and it doesn't submit. I used Firebug to confirm that nothing happens when I hit the submit button. I checked my code with a known working example (Graham Bird's AJAX tutorial) and the code is the same except my document has multiple forms in it. Is this somehow interfering with the AJAX submit? Is there a way to target the partcular form I need to use? Thanks for any input! Jonathan --~--~-~--~~~---~--~~ 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: Highlight invalid form fields
> Even when I used the FormHelper functions to generate my form, errors > weren't being highlighted - did I misunderstand, is it actually > supposed to do this or not? yes, it should - when I use the FormHelper (or HtmlHelper), a class of 'form_error' is added to any invalid elements, have a look in the source of your page. .form_error { border: red 1px solid; } if it's not then there's an error with your code somewhere (what version of cake are you using?). The class is added even if you aren't displaying 'tagErrorMessage' anyhere which is also handy. hth jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: Highlight invalid form fields
Damn, I feel stupid now. I made it work - the part of my code where I was validating my form wasn't the part I was actually changing (I have another section I was previously using for another purpose). So feel free to ignore this :/ --~--~-~--~~~---~--~~ 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: best way to include common element
> I'm putting together a project that has a list of product categories on > the top of several pages. The categories are stored in the database > (model ProductType). Now I'm thinking the best way to do this is to > make the part that displays the HTML a element view and then figure out > how to use a component to feed data to that element for display. Is > this the best way to do this or is there another way that this is > commonly done? create the element, then use request action to pass the data to it, eg: // /elements/product_categories.thtml foreach ($data as $row) { echo $row['name']; } // in a view echo $this->renderElement ('product_categories', array('data'=>$this->requestAction ('/products/list_categories')); // in ProductsController function list_categories () { return $this->Product->ProductCategories->generateList (); } you could also put the call to requestAction in the element, to make it more self contained hth jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: request for a tutorial
Hi Mandy and Schmidt, I was able to get going..but would appreciate if you can help me in optimizing my code Here is the my table structure Articles id title Keywords id title Articles_Keywords_Users id article_id keyword_id user_id // always 1 I created a simple view and here is the view code === view === labelTag('Article/title', 'Title');?> input('Article/title', array('size' => '60'));?> tagErrorMsg('Article/title', 'Please enter the Title.');?> labelTag('Keyword/list', 'Title');?> areaTag('Keyword/list', 25, 5 );?> tagErrorMsg('Keyword/list', 'Please enter Keywords.');?> submit('Add');?> and here is my controller method that handles the view === method add function add(){ if(empty($this->data)){ $this->render(); } else{ $message = ""; // extract article title $article = $this->data['Article']; $condition = array('title' => " = {$article['title']} ") //check if article exists or not. // if it exists get its id otherwise save and then get its id if($this->Article->hasAny($condition)){ $result = $this->Article->find($condition); $article['id'] = $result['Article']['id']; $message = $message + "Article: " . $article['title'] . " already exists" . ''; } else{ $this->Article->create(); if($this->Article->save(array('Article' => $article))){ //if successfully saved get its id // although next two lines doesn't make sense //but only after executing the below command // i was able to get id successfully $this->Article->execute("SELECT LAST_INSERT_ID() from articles"); $article['id'] = $this->Article->getLastInsertID(); $message = $message + "Article: " . $article['title'] . " successfully saved" . ''; }else{ die(); } } // handle comma separated keywords $list = $this->data['Keyword']['list']; unset($this->data['Keyword']['list']); $keys = explode(",", $list); foreach ($keys as $key){ // get each key $key = trim($key); $keyword = array(); $keyword['title'] = $key; $keyCondition = array('title' => " = {$key}"); //check if keyword is already present in the database // if not add it // otherwise get it ID if($this->Keyword->hasAny($keyCondition)){ $result = $this->Keyword->find($keyCondition); $keyword['id'] = $result['Keyword']['id']; $message = $message + $key . " already exists in database" . ''; }else{ $this->Keyword->create(); if($this->Keyword->save(array('Keyword' => $keyword))){ $this->Keyword->execute("SELECT LAST_INSERT_ID() from keywords"); $keyword['id'] = $this->Keyword->getLastInsertID(); $message = $message + 'Keyword : ' . $key . ' successfully saved '; } else{ $message = $message + 'Error: Unable to save keyword : ' . $key . ''; continue; } } //update joining table $this->ArticlesKeywordsUser->create(); $j
Highlight invalid form fields
Another query for you guys out there. I've been reading up on all the multiple validation techniques today - got that part figured out, so don't worry. What I was looking for is a simple way to highlight when a form field is invalid. Basically I want to be able to use a different CSS class for when an error occurs. I've looked into the FormHelper::isFieldError() - but that for some reason wasn't returning anything at all, not even a true or false value as I understand it's supposed to. Even when I used the FormHelper functions to generate my form, errors weren't being highlighted - did I misunderstand, is it actually supposed to do this or not? Maybe I'm just looking at things the wrong way. Ultimately what I want is a panel at the top of my form listing all the errors ($html->tagErrorMsg - that part works fine) - and each of the affected input fields to be given a red border. Any help please? On an unrelated subject, I love how simple it is to do the AJAX stuff with Cake :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
best way to include common element
Hello, I'm putting together a project that has a list of product categories on the top of several pages. The categories are stored in the database (model ProductType). Now I'm thinking the best way to do this is to make the part that displays the HTML a element view and then figure out how to use a component to feed data to that element for display. Is this the best way to do this or is there another way that this is commonly done? The reason I want to do it this way is that a user might be on different section (say the contact page using the ContactController which really would have nothing to do with the ProductType, just seems cleaner if I could have all that functionatity packed away inside a component instead of repeating similar code on several controller classes. Thanks, Zoltan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
newbie: Obfuscating a CakePhp project
Hello, As I am shipping an application to a customer, I would like to obfuscate my Cake Php project. Has anyone any suggestion on which product to use and which directories to protect? Thanks, M. --~--~-~--~~~---~--~~ 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: request for a tutorial
Hi Mandy and Schmidt, Thanks for all your reply..That makes sense to me, especially after carefully reading this discussion on the group http://groups.google.com/group/cake-php/browse_thread/thread/6547b2869f3cd9ad/4349906b4f18aa4d?lnk=gst&q=single+form&rnum=5#4349906b4f18aa4d I will try to combine what Mandy suggested with some suggestions in the above group discussion. But if I am following Mandy's suggestion, I still have two question. 1. What if you have three tables, User Country Country_user after you save data into user and country...you need to get id of both user and country...and save them in country_user Is there a way to get ID using requestAction...or should I use getLastInsertID 2. This question might be particularly for my case.. In the view if I want to know all the countries that the user visisted and for this I provide a text box where user can enter all the countries separated by comma...how can I handle this, since I cannot attach particular column to the textbox. I will need to explod the list and loop through it. So my question is what column name should be attached to it ...or I can just give a fake column name as it will only create an array and later process each country name individually in a loop If I get going, probably I can write a tutorial for others.. Thanks for all your help Regards, Bingo --~--~-~--~~~---~--~~ 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: has many through associations
I'm pretty sure Cake doesn't support directly what Evan is looking for here, from what I've read. It's like an extension of HABTM which can handle (effectively) a 3-table join, without having to play around so much. You could probably achieve the same effect with the recursive parameter, but it wouldn't be so neat: $this->Forum->Topics->Posts->findAll($condition); I'm not sure this would work, but either way, it would be easier to be able to do (as an example): $this->Forum->Posts->findAll($condition); To return all the Posts in a given Forum, rather than having that extra layer in there. Still, Cake's HABTM seems to be developing so maybe we'll see this feature soon. Evan, hope this is what you were asking for. --~--~-~--~~~---~--~~ 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: request for a tutorial
I think that is a good solution. And the problem with a tutorial on this is there are many different ways to skin the cat. The thing I like about this solution \ example given is that it keeps User code and Profile code seperate still. Instead of calling $this->Profile->save directly in your User controller. Now, 9 times out of 10 you aren't doing anything special, but if you ever needed to then you would want the seperated out add method in the Profile controller. So, that is a very good coding practice that is overlooked. Now in terms of the dispatcher I don't remember whether a direct method call or a requestaction is better in terms of least steps in dispatcher land. I think what most novice bakers need to focus on is good CakePHP coding practices. To make sure that you don't abuse the flexibility of CakePHP. --~--~-~--~~~---~--~~ 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: problems using php include() within cakephp
If you have header and footers that are common to multiple pages they should be in the default layout. There really isn't the need to include them as files anymore using the layout templates. If you have tiny segments of code that get used over and over in various places setup a method in a controller and you can call it from any other methods by requestaction, placing that result in a variable that you pass to the view and echo. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---