inserting date
I am trying to insert date into database. fieldname: dob type: date (y:m:d) views code: dayOptionTag('Client/d', $value = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true);?> monthOptionTag('Client/m', $value = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true)?> yearOptionTag('Client/y', $value = null, $minYear = null, $maxYear = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true)?> In the controller i have the code, $this->Client->save($this->data); 1. How do i save date, month, year in one field? 2. The controller has many drop down (select tag), whose data is coming from different tables. While saving should i have to say as $this-Client->save? The class has been declared as, class ClientsController extends AppController 3. As i have allready mentioned the controller code contains many dropdown tag. example : $this->set('City', $this->City->generateList( null, "city_id ASC", null, "{n}.City.city_id", "{n}.City.city") ); The page loads very slowly, is there anyother solution for 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?hl=en -~--~~~~--~~--~--~---
Re: navigation
I don't really want to deal with users and groups. I have no need for groups in this application at all. Basically just visitors/users/admin basically, visitors have no login information users have been authenticated and have admin flag set to 0 admins have been authenticated and have an admin flag set to 1 or something like that I guess i could use the same idea as you said. THe problem is how do i get that data to a global view.. thats what i'm working on I'm guessing in my default template i can echo some variable and then i just have to make sure that every controller actually sets something for that variable. Basically i just want to know what the best way of doing that is.. I don't want to add an element to every view though.. that seems ugly.. but may have to do. On May 29, 1:54 pm, "Tane Piper" <[EMAIL PROTECTED]> wrote: > If you use a similar idea to othAuth, and put users into groups - you > could show a menu either based on the users group, or the access > level. > > Some psudocode would be like: > > if ($this->User->level = 0) > { > output ('login')} else if ($this->User->level = 100) { > >output (' regular menu')} else if ($this->User->level = 200) { > >output ('admin menu') > > } > > Tane > > On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > I have a website and i want to use a specific navigation menu but i > > want the links to depend on the state.. Basically there are 1 of the > > different navigation menus i want to render, > > 1. no user logged in > > 2. regular user logged in > > 3. admin user logged in > > > Currently i have a user model and the appropriate controllers and > > views. I figured out how to enforce authentication and what not on the > > pages, however i am unsure what a good way of supplying the navigation > > menu would be for each. > > > Any ideas? I was thinking some kind of a ocmponent or something but > > i'm not sure how to use those.. > > > 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?hl=en -~--~~~~--~~--~--~---
Re: CakePHP php5?
I for one have on at least 2 occasions had my hide saved by cakephp's php4 support. On both occasions, I discovered that the target server was php4. Before my cakephp days this kind of a thing could have taken days or weeks to fix! With cake, a quick search and replace and we were set. -- Nathan Garza AshLeaf Media | Director of Technology Innovations _ www.ashleafmedia.com | [EMAIL PROTECTED] | 832.514.5726 On 5/29/07, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > > On 5/29/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > > That guy needs PHP4, this host needs PHP4, but no one is saying > > that I need a PHP4 support. This is the same scenario happened when > > PHP4 is released. It's always better to move upwards whether it's PHP > > or CakePHP (how many people are going to stick to 1.1 for instance?) > > > > Again, you're missing the point. CakePHP runs just fine on PHP 5. > There is nothing stopping you from using PHP 5's new stuff with > CakePHP. Sadly, many people are reluctant to upgrade to PHP 4 for > reasons to do with hosting (scared to switch) or comfort level (scared > that they won't understand PHP 5). My boss feels that CakePHP suffers > because it has to support PHP 4 and that somehow it can't compete > against Zend Framework because it's PHP 5 only. This is, of course, a > load of shit. > > So, I put the following to you: provide an example of where CakePHP > is being held back by having to support PHP 4 or shut the hell up > about it. Documented proof would be nice, not just personal opinion. > > Even if all you do is move your existing app to PHP 5, you will see a > benefit in performance. It has been my own personal experience that > the only apps that might have to be tweaked to run under PHP are those > doing weird stuff with PHP 4's object model. I run WordPress for my > blogs, which is supposedly a PHP 4 only application, with PHP 5. > Haven't run into any problems yet. > > -- > Chris Hartjes > > My motto for 2007: "Just build it, damnit!" > > @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?hl=en -~--~~~~--~~--~--~---
Re: Sessions Issue
Hi Chris, The debug is set to 2. The set up is WAMP where I experience this issue. However, just to make sure that this happens on Linux box or not, I booted into Linux and it works fine in linux. So I don't know if its CakePHP issue or its WAMP configuration issue. Let me know. Ketan On May 29, 10:07 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 5/29/07, Ketan Patel <[EMAIL PROTECTED]> wrote: > > > > > When the form is posted, in expected input, I am not able to see the > > session variable alpha which I had set during the intial view. Can > > someone point me in right direction what's wrong? > > > I know that session variable is set because when I look into database > > for session entry, I do see the variable 'alpha' declared as 15 in the > > data column. But somehow it is not shown when the form is posted or > > read is requested! > > I keep saying to myself "people read the manual, Chris, they really do". > > What debug level do you have your application set to? If it's 0 then > you are probably seeing cached data. > > -- > Chris Hartjes > > My motto for 2007: "Just build it, damnit!" > > @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?hl=en -~--~~~~--~~--~--~---
Re: Sessions Issue
On 5/29/07, Ketan Patel <[EMAIL PROTECTED]> wrote: > > When the form is posted, in expected input, I am not able to see the > session variable alpha which I had set during the intial view. Can > someone point me in right direction what's wrong? > > I know that session variable is set because when I look into database > for session entry, I do see the variable 'alpha' declared as 15 in the > data column. But somehow it is not shown when the form is posted or > read is requested! I keep saying to myself "people read the manual, Chris, they really do". What debug level do you have your application set to? If it's 0 then you are probably seeing cached data. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @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?hl=en -~--~~~~--~~--~--~---
Sessions Issue
I am using CakePHP 1.2.0.5146. I am trying to write a session variable using $this->Session->write('alpha',15); in users_controller.php for "add" action as follows: function add() { $success = false; if(!empty($this->data)) { $this->cleanUpFields(); $user_input = $this->data['User']['verify']; echo 'User input is : '.$user_input; echo 'Expect input is : '.$this->Session->read('alpha'); $success = true; } if (!$success) { $this->Session->write('alpha',15); } } When the form is posted, in expected input, I am not able to see the session variable alpha which I had set during the intial view. Can someone point me in right direction what's wrong? I know that session variable is set because when I look into database for session entry, I do see the variable 'alpha' declared as 15 in the data column. But somehow it is not shown when the form is posted or read is requested! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Debugging Cake app via DBG or Zend Debugger
On 5/29/07, Ming <[EMAIL PROTECTED]> wrote: > > Hi there, > > I wonder if anybody here can do me a favor by sharing his/her > experience in debugging a Cake app by DBG (if you are using PhpED) or > Zend Debugger ( if you are using Zend Studio or PDT). > I've used Komodo and XDebug to take a look at what's going on and didn't have any problems setting breakpoints etc. Maybe you should ask this question on a Zend Studio mailing list? -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @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?hl=en -~--~~~~--~~--~--~---
Debugging Cake app via DBG or Zend Debugger
Hi there, I wonder if anybody here can do me a favor by sharing his/her experience in debugging a Cake app by DBG (if you are using PhpED) or Zend Debugger ( if you are using Zend Studio or PDT). I have troubles in debugging, esp, breakpoints I set seem not work properly. I am not sure if it because of mod_rewrite setting or something else. While trying to debug only the app, I always 'dive' into the framework's codes 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?hl=en -~--~~~~--~~--~--~---
Re: The Slimfast Challange (or help me slim down my controller)
The best place to put this, I find, is in a copy of app_controller.php. You place the copy into your app folder and add your beforeFilters() etc. This way you don't have to write that function in every single controller. Throw this into it and see how it does for you: class AppController extends Controller { //public $ext = ".php"; //public $helpers = array('Html', 'Javascript', 'Ajax'); function beforeFilter() { $level_check = $this->othAuth->group('level'); if (!empty($level_check)) { $this->level = $level_check; } else { $this->level = 0; } } } Now, everytime a controller tries to run a "filter" this function is called, no matter what controller it is. If you want to limit the controllers that call this, name it another function and you will have to call it manually from the controller that you want to use it. On May 29, 11:27 am, Walker Hamilton <[EMAIL PROTECTED]> wrote: > function beforeFilter() > { >$level_check = $this->othAuth->group('level'); > if (!empty($level_check)) > { > $this->level = $level_check; > } else { > $this->level = 0; > } > > } > > then in your functions just grab $this->level when you need to. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
GoDaddy Subdomain Woes
OK. Here's my issue if anyone can help. I have created a subdomain, adcamp that relates to the url adcamp.midnightfury.info. The host is GoDaddy. I have pointed the root directory to /adcamp/app/webroot and the full directory structure is /home/content/d/e/t/dethriderr/html/adcamp/app/webroot. If you view the source of adcamp.midnightfury.info the css tag is href="/app/webroot/css/default.css" . I am using the default core files for 1.12 and have only adjusted the core file to disable mod_rewrite. I am using echo $html->css('default'); in my default layout. Also, webroot . 'favicon.ico';?> equates to href="/app/webroot/favicon.ico" .Any suggestions? -- Thanks, Ron Chaplin =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= T73 Software & Design www.t73-softdesign.com We'll make all of your wildest e-Commerce dreams come true! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: > > Slightly bad karma to reply to one's own post so soon, but after > continuing to investigate, > I'd like to provide a solution for the mail archives. I just didn't fully > understand the route handling up until this point, but the light is starting > to go on for me. I have subsequently found 2 ways it can be done: > > 1) Less agreeable way: change the cake distro libs/router.php around line > 147, adding: > > $this->connect('/csv/:controller/:action/*', > array('webservices' => 'Csv')); > > 2) More agreeable, add to the application app/config/routes.php > > $Route->connect('/csv/:controller/:action/*', array('webservices' > => 'Csv')); > > I am well aware that CSV is not a webservice as such but I want the CSV > output availability to be consistent with the XML approach. Is your requirement strictly CSV or can it be an actual Excel file? I found this article recently at bakery.cakephp.org (which I plan on using) to create an XLS file from database records: http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database If it's strictly CSV what you need, then it won't help, but I think what klonae said is probably the simplest way. klonae: just wondering, shouldn't the header() calls be made just before the foreach begins? - Gonzalo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: navigation
If you use a similar idea to othAuth, and put users into groups - you could show a menu either based on the users group, or the access level. Some psudocode would be like: if ($this->User->level = 0) { output ('login') } else if ($this->User->level = 100) { output (' regular menu') } else if ($this->User->level = 200) { output ('admin menu') } Tane On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I have a website and i want to use a specific navigation menu but i > want the links to depend on the state.. Basically there are 1 of the > different navigation menus i want to render, > 1. no user logged in > 2. regular user logged in > 3. admin user logged in > > Currently i have a user model and the appropriate controllers and > views. I figured out how to enforce authentication and what not on the > pages, however i am unsure what a good way of supplying the navigation > menu would be for each. > > Any ideas? I was thinking some kind of a ocmponent or something but > i'm not sure how to use those.. > > 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?hl=en -~--~~~~--~~--~--~---
Re: noob: Sorting results from 15min blog tutorial
by changing this: function index() { $this->set('posts', $this->Post->findAll()); } to this: function index() { $this->set('posts', $this->Post->findAll(null, null, 'Post.modified DESC')); } You'll find all these options in the manual, Models chapter http://manual.cakephp.org/chapter/models 'Retrieving Your Data' Easy, isn't it ? Spark On 5/29/07, loopymonkey <[EMAIL PROTECTED]> wrote: > > I've tried a few basic tutorials for cakephp but all the tutorials > create results that are out of order. I'm still learning but thought > someone could point me in the right direction as far as learning what > code I can add in order to make the posts index list things by date > correctly. I would like to have most recent at top. > > http://manual.cakephp.org/appendix/blog_tutorial > was the tutorial i tried that presets results unsorted. > > thanks for your time! > > > > > -- [livesets] http://djspark.com.br/ [web] http://synapsisdi.com.br --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
/me bangs himself over the head several times and decides he should stop answering emails on his blackberry or really read emails through first before deciding to answer I actually do have some code lying about that outputs to CSV from a database - although I've not used it in cake yet, its just an old class I wrote which could be plugged in as a vendor. But at the moment I'm hurtling down the M8 on a bus so I won't have access to it until later. Tane On 5/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > Do'h ignore that last message - I read CSV as CVS :) > > Yea, I agree with chris - this doesn't sound like a service, you could > probably create a component/helper that can do the work for you. I'd > say read the file one line at a time, explode each comma seperated > value into an array and save it to the db. > > I was actually looking at this today as part of something else I > wanted to do (use XSL-FO to covert xsl and csv files to PDF on > upload). > > There might even be a class on PHPclasses.com that you could put in > your vendor dir, could save on a lot of code. > > Tane > > > On 5/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > > Hello fellow Embra Cake developer :) > > > > I'm not 100% sure, but if your not tied to CVS, check out Trac for > > running a backend SVN server. There is an XML-RPC plugin for it that > > allows you to make calls to it. > > > > I'm not sure on the source side, but it definetly let's you make calls > > to the ticket tracker - adding/viewing/editing tickets. That's how > > Mylar for Eclipse works, and it ties in nicely. > > > > Tane > > http://webrocket.wordpress.com > > > > > > On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: > > > I have successfully used the XML webservice to export my records in > > > that form as well as a regular html view just by varying the url > > > > > > The manual describes webservices as "rss, xml, rest, soap, xmlrpc" > > > (Section 4 Advanced routing > > http://manual.cakephp.org/chapter/configuration) > > > > > > I know CSV is not strictly a webservice, but I would dearly love to add > it > > > to this list as the consumers on my app expect to be able to paste into > > > a spreadsheet, and this would be very convenient in terms of consistency > > > > > > Can anyone point me in the right direction of how I do this? > > > > > > I tried following the pattern for xml (items/xml/view.thtml, > > > layouts/xml/default.thtml etc) > > > but each time I try to go to a URL like http:///csv/items/view/1234 > > > ... I get an error about a missing CSV controller. I suspect I just need > > to > > > update some file > > > or configuration or route to sort this out > > > > > > Am I missing something obvious? > > > Howard > > > > > > -- > > > -- > > > Howard Glynn [ [EMAIL PROTECTED] ] > > > Edinburgh, UK > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: > I am well aware that CSV is not a webservice as such but I want the CSV > output availability to be consistent with the XML approach. > > Cheers, Howard You are overcomplicating what appears to me (at least) a simple solution. Why can't you just create a csv controller with actions that read in the data, format it into CSV and then spit it out via a view. Am I missing something? You're doing all this nonsense with routes, etc, to gain what exactly? -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @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?hl=en -~--~~~~--~~--~--~---
Re: Validation $this->invalidate doesnt work....
I had the same problem. You must be using cake 1.2. It looks like 1.2 doesnt use html helper for forms anymore. Use formHelper class For information look at the following link: http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2 and for in depth look at the functions and what not to validate with look here: http://cakebaker.42dh.com/2007/01/03/validation-with-cakephp-12/ On May 29, 6:14 am, Eppo <[EMAIL PROTECTED]> wrote: > The following: > Cant figure out why validation not working... > > This is what i have; > In my model 'User': > class User extends AppModel{ > var $name = 'User'; > var $useTable = 'clients'; > > var $validate = array( > 'name' => array(array('rule' => array('minLength', > 3),'message'=>'No > name'))); > > function beforeValidate(){ > if(!isset($this->data['User']['gender'])){ > $this->invalidate('gender', 'No gender selected'); > return false; > } > return true;index > } > ?> > > In my view: > radio('User/gender', array('m', 'v'), '?');?> > tagErrorMsg('User/gender', 'No gender > selected'); ?> > > But no errors are displayed > When I do this in my controller: pr($this); There is an array : > [validationErrors] => Array( > [gender] => No gender selected > ) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
navigation
I have a website and i want to use a specific navigation menu but i want the links to depend on the state.. Basically there are 1 of the different navigation menus i want to render, 1. no user logged in 2. regular user logged in 3. admin user logged in Currently i have a user model and the appropriate controllers and views. I figured out how to enforce authentication and what not on the pages, however i am unsure what a good way of supplying the navigation menu would be for each. Any ideas? I was thinking some kind of a ocmponent or something but i'm not sure how to use those.. 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?hl=en -~--~~~~--~~--~--~---
noob: Sorting results from 15min blog tutorial
I've tried a few basic tutorials for cakephp but all the tutorials create results that are out of order. I'm still learning but thought someone could point me in the right direction as far as learning what code I can add in order to make the posts index list things by date correctly. I would like to have most recent at top. http://manual.cakephp.org/appendix/blog_tutorial was the tutorial i tried that presets results unsorted. thanks for your time! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
Slightly bad karma to reply to one's own post so soon, but after continuing to investigate, I'd like to provide a solution for the mail archives. I just didn't fully understand the route handling up until this point, but the light is starting to go on for me. I have subsequently found 2 ways it can be done: 1) Less agreeable way: change the cake distro libs/router.php around line 147, adding: $this->connect('/csv/:controller/:action/*', array('webservices' => 'Csv')); 2) More agreeable, add to the application app/config/routes.php $Route->connect('/csv/:controller/:action/*', array('webservices' => 'Csv')); I am well aware that CSV is not a webservice as such but I want the CSV output availability to be consistent with the XML approach. Cheers, Howard --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: using select tag
hey! thanks alot for the help,will try it out once i get back to work tom. But im guessing this solves my problem. Thanks mate! Cheers! Kashyap On May 30, 12:44 am, Walker Hamilton <[EMAIL PROTECTED]> wrote: > look into using the form->input function. > (http://api.cakephp.org/1.2/class_form_helper.html#83ef190e216e07fb0a7... > ) > > 'type'=>'select' > 'options'=>$optionsArr > > then in your controller make optionsArr using generateList > (http://api.cakephp.org/1.2/class_model.html#27ff9de8aaff38950bee5f4ff... > ) > > Google search & API lookup are your friends! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: using select tag
look into using the form->input function. ( http://api.cakephp.org/1.2/class_form_helper.html#83ef190e216e07fb0a77acc9014bb90d ) 'type'=>'select' 'options'=>$optionsArr then in your controller make optionsArr using generateList ( http://api.cakephp.org/1.2/class_model.html#27ff9de8aaff38950bee5f4ffb22b4d1 ) Google search & API lookup are your friends! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
using select tag
Hi! I need to populate my drop down list with only owners and only incharge users from my users table. The Users table username,password,first_name,owner,incharge,etc. where owner and incharge are boolean fields to render the user as an owner or incharge or both. How do i populate the dropdown list based on this condition?i.e using the selectTag --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: using simplepie as a helper
If simplepie is a Class, you could include it in your vendor directory, and then write a helper for it: Function myfunc() { vendor('simplepie'); $spie =& new simplepie; $spie->function('foo','bar'); } Tane On 5/29/07, sixlaneve <[EMAIL PROTECTED]> wrote: > > Just wondering, is there any way to use simplepie as a helper? > > basically > > in a page I have multiple feeds to parse, I thought it could be easier > to use a helper. > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
using simplepie as a helper
Just wondering, is there any way to use simplepie as a helper? basically in a page I have multiple feeds to parse, I thought it could be easier to use a helper. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
Do'h ignore that last message - I read CSV as CVS :) Yea, I agree with chris - this doesn't sound like a service, you could probably create a component/helper that can do the work for you. I'd say read the file one line at a time, explode each comma seperated value into an array and save it to the db. I was actually looking at this today as part of something else I wanted to do (use XSL-FO to covert xsl and csv files to PDF on upload). There might even be a class on PHPclasses.com that you could put in your vendor dir, could save on a lot of code. Tane On 5/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > Hello fellow Embra Cake developer :) > > I'm not 100% sure, but if your not tied to CVS, check out Trac for > running a backend SVN server. There is an XML-RPC plugin for it that > allows you to make calls to it. > > I'm not sure on the source side, but it definetly let's you make calls > to the ticket tracker - adding/viewing/editing tickets. That's how > Mylar for Eclipse works, and it ties in nicely. > > Tane > http://webrocket.wordpress.com > > > On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: > > I have successfully used the XML webservice to export my records in > > that form as well as a regular html view just by varying the url > > > > The manual describes webservices as "rss, xml, rest, soap, xmlrpc" > > (Section 4 Advanced routing > http://manual.cakephp.org/chapter/configuration) > > > > I know CSV is not strictly a webservice, but I would dearly love to add it > > to this list as the consumers on my app expect to be able to paste into > > a spreadsheet, and this would be very convenient in terms of consistency > > > > Can anyone point me in the right direction of how I do this? > > > > I tried following the pattern for xml (items/xml/view.thtml, > > layouts/xml/default.thtml etc) > > but each time I try to go to a URL like http:///csv/items/view/1234 > > ... I get an error about a missing CSV controller. I suspect I just need > to > > update some file > > or configuration or route to sort this out > > > > Am I missing something obvious? > > Howard > > > > -- > > -- > > Howard Glynn [ [EMAIL PROTECTED] ] > > Edinburgh, UK > > > > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: The Slimfast Challange (or help me slim down my controller)
function beforeFilter() { $level_check = $this->othAuth->group('level'); if (!empty($level_check)) { $this->level = $level_check; } else { $this->level = 0; } } then in your functions just grab $this->level when you need to. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: using create in cake 1.2
create - creates a new instance of the model, this is especially helpful if you are wanting to 'insert' more then one entry at a time, like looping though a form that allows one to add more then one user at a time (for example) It is also useful to clear the information from a model like if you do a read earlier in the method code you might want to 'reset' it before you 'save' your new data (like you might read the information from one user because you use it in a 'child' user (I do this when I have to do a ModelName->find() to get an id for an existing record) When in doubt and you are inserting, I would say use create, it can't hurt and it can only help On 5/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > What is the reason for using create in cake 1.2 > I am using cake 1.2 because it seems to have a lot of extra > functionality, however i am making an application with information i > learned from tutorials taht were for 1.1. > I have updated my forms to use FormHelper instead of the html helper > methods. And i read someone say that the new cake uses create. I > would guess that creates the object first or something. for instance, > i have some code: > > if ($this->User->save($this->data['User'])) > { > $this->flash('Your user information has > been updated.','/users'); > } > } > > would i do a create and then a save? It seems to work as is, but i'm > wondering what the reason for using create before save would be. > Thanks in advance. > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
This may or may not help. it's not exactly what you want to do, but I don't have much use for CSV. I needed to be able to allow site managers to generate and download an excel spreasheet of user records from the database. In the controller: function excel() { $this->layout = 'excelfile'; $data = $this->Alum->findAll('', array('first_name', 'last_name', 'email'), 'last_name ASC'); $this->set('data', $data); } The excel.thtml view: The excel layout file: This allows them to download a .xsl file by clicking a link that calls the excel function. On May 29, 11:15 am, "Howard Glynn" <[EMAIL PROTECTED]> wrote: > I have successfully used the XML webservice to export my records in > that form as well as a regular html view just by varying the url > > The manual describes webservices as "rss, xml, rest, soap, xmlrpc" > (Section 4 Advanced routinghttp://manual.cakephp.org/chapter/configuration) > > I know CSV is not strictly a webservice, but I would dearly love to add it > to this list as the consumers on my app expect to be able to paste into > a spreadsheet, and this would be very convenient in terms of consistency > > Can anyone point me in the right direction of how I do this? > > I tried following the pattern for xml (items/xml/view.thtml, > layouts/xml/default.thtml etc) > but each time I try to go to a URL likehttp:///csv/items/view/1234 > ... I get an error about a missing CSV controller. I suspect I just need to > update some file > or configuration or route to sort this out > > Am I missing something obvious? > Howard > > -- > -- > Howard Glynn [ [EMAIL PROTECTED] ] > Edinburgh, UK --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
Hello fellow Embra Cake developer :) I'm not 100% sure, but if your not tied to CVS, check out Trac for running a backend SVN server. There is an XML-RPC plugin for it that allows you to make calls to it. I'm not sure on the source side, but it definetly let's you make calls to the ticket tracker - adding/viewing/editing tickets. That's how Mylar for Eclipse works, and it ties in nicely. Tane http://webrocket.wordpress.com On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: > I have successfully used the XML webservice to export my records in > that form as well as a regular html view just by varying the url > > The manual describes webservices as "rss, xml, rest, soap, xmlrpc" > (Section 4 Advanced routing http://manual.cakephp.org/chapter/configuration) > > I know CSV is not strictly a webservice, but I would dearly love to add it > to this list as the consumers on my app expect to be able to paste into > a spreadsheet, and this would be very convenient in terms of consistency > > Can anyone point me in the right direction of how I do this? > > I tried following the pattern for xml (items/xml/view.thtml, > layouts/xml/default.thtml etc) > but each time I try to go to a URL like http:///csv/items/view/1234 > ... I get an error about a missing CSV controller. I suspect I just need to > update some file > or configuration or route to sort this out > > Am I missing something obvious? > Howard > > -- > -- > Howard Glynn [ [EMAIL PROTECTED] ] > Edinburgh, UK > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: CakePHP - Multiple database connection, NOT working
eeroxasjr: I am currently using multiple databases, and initially had some troubles. In addition to what Samuel said, I also explicitly added the persistent => false element to the array that isn't there initially. After adding this, it worked fine for me. On May 28, 11:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Good Morning! > > I can't seem to find a solution for this bug... > > I've got a 'Fatal error: Cannot redeclare class dbosource in /home/ > imperium/devel/chowking/cake/libs/model/datasources/dbo_source.php on > line 38' error... > > I'm accessing a Model in a different database, and this is what I get. > > Hope anyone could help me... > > :(( --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Upload a File with CakePHP 1.2.0.5137alpha
Hi to everybody! I want to upload a file that I choose from a field of a form. How can I do this action? With the previous stable Version of Cake I do this, with the aid of this extension: http://www.reversefolds.com/articles/show/filehandler With this new version the controller always say to me that I don't give to it the file. In particular I want to upload an image. Help me, please :D Thanks Ps. Sorry for my bad English! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Upload a File with CakePHP 1.2.0.5137alpha
Hi to everybody! I want to upload a file that I choose from a field of a form. How can I do this action? With the previous stable Version of Cake I do this, with the aid of this extension: http://www.reversefolds.com/articles/show/filehandler With this new version the controller always say to me that I don't give to it the file. In particular I want to upload an image. Help me, please :D Thanks Ps. Sorry for my bad English! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to enable a CSV webservice?
On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote: > Am I missing something obvious? Well, given that CSV isn't a standard web service, you are missing the obvious. :) You'll have to create a csv controller that passes the data to your csv template. Should be very simple. Of course, I can say that because I don't have to write it. :) -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @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?hl=en -~--~~~~--~~--~--~---
How to enable a CSV webservice?
I have successfully used the XML webservice to export my records in that form as well as a regular html view just by varying the url The manual describes webservices as "rss, xml, rest, soap, xmlrpc" (Section 4 Advanced routing http://manual.cakephp.org/chapter/configuration) I know CSV is not strictly a webservice, but I would dearly love to add it to this list as the consumers on my app expect to be able to paste into a spreadsheet, and this would be very convenient in terms of consistency Can anyone point me in the right direction of how I do this? I tried following the pattern for xml (items/xml/view.thtml, layouts/xml/default.thtml etc) but each time I try to go to a URL like http:///csv/items/view/1234 ... I get an error about a missing CSV controller. I suspect I just need to update some file or configuration or route to sort this out Am I missing something obvious? Howard -- -- Howard Glynn [ [EMAIL PROTECTED] ] Edinburgh, UK --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
The Slimfast Challange (or help me slim down my controller)
Hey folks, I have several functions in my controllers that are breaking the DRY convention - at the moment, in each one that needs to check the users level does so at the top of the method. Here is an example: function index($post_index_limit='1',$post_index_order='DESC', $post_index_cachetime = '1 hour') { $level_check = $this->othAuth->group('level'); if (!empty($level_check)) { $level = $level_check; } else { $level = 0; } // Overide paginate limit, may need to change $this->cacheAction = $post_index_cachetime; $this->passedArgs['limit'] = $post_index_limit; $this->passedArgs['order'] = array('Post.post_date' => $post_index_order, 'Post.created' => $post_index_order); $this->set('posts', $this->paginate(null, array('Post.published'=>1, 'Post.frontpage' => 1 ,'Post.access_level' => '<= ' . $level ))); } What I have tried to far is to move the level check into the model, and return the value of level, then in my controller I tried this: $this->set('posts', $this->paginate(null, array('Post.published'=>1, 'Post.frontpage' => 1 ,'Post.access_level' => '<= ' . $this->Post->checklevel() ))); But then I get the error that the group method is not accessable - so a controller seems to not be accessable from a model. Can anyone see a way I can move this code into my app model (or app controller - which I also couldn't get to work). I think once I get this the first time, it should help me slim down a lot of my code. Thanks, Tane --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: CakePHP php5?
On 5/29/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > That guy needs PHP4, this host needs PHP4, but no one is saying > that I need a PHP4 support. This is the same scenario happened when > PHP4 is released. It's always better to move upwards whether it's PHP > or CakePHP (how many people are going to stick to 1.1 for instance?) > Again, you're missing the point. CakePHP runs just fine on PHP 5. There is nothing stopping you from using PHP 5's new stuff with CakePHP. Sadly, many people are reluctant to upgrade to PHP 4 for reasons to do with hosting (scared to switch) or comfort level (scared that they won't understand PHP 5). My boss feels that CakePHP suffers because it has to support PHP 4 and that somehow it can't compete against Zend Framework because it's PHP 5 only. This is, of course, a load of shit. So, I put the following to you: provide an example of where CakePHP is being held back by having to support PHP 4 or shut the hell up about it. Documented proof would be nice, not just personal opinion. Even if all you do is move your existing app to PHP 5, you will see a benefit in performance. It has been my own personal experience that the only apps that might have to be tweaked to run under PHP are those doing weird stuff with PHP 4's object model. I run WordPress for my blogs, which is supposedly a PHP 4 only application, with PHP 5. Haven't run into any problems yet. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @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?hl=en -~--~~~~--~~--~--~---
Re: CakePHP php5?
Also, think of down the road; 1.2 apps currently being developed will at some point "feel" like 1.1 apps that are being developed right now, as the new bleeding edge cake will probably be 2.x... "Legacy Support" or "backwards-compatibility" or whatever term you choose to use, is without a doubt huge and very significant. From another perspective, there's another reason why a lot of web hosts still offer 4 that maybe wasn't mentioned here: app support. A lot of people have big apps written in php4 that are not easily moved to 5 and won't go with a web host that doesn't support 4. I get the notion of "moving forward", but I think the point Nate, Felix and others are trying to make is that supporting php 4 is not "stunting" CakePHP's ability to perform, or to be scalable, or whatever On May 29, 3:22 am, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > > That guy needs PHP4, this host needs PHP4, but no one is saying > > that I need a PHP4 support. This is the same scenario happened when > > PHP4 is released. It's always better to move upwards whether it's PHP > > or CakePHP (how many people are going to stick to 1.1 for instance?) > > You *really* need to listen to the other folks. I'm working on one of > the biggest cake apps around (300db tables, ~70 controllers, etc.). And > guess what? It's 1.1. The reason for this is that the project was > started about ~6 month ago when 1.2 was not where it's now and the team > decided it would not be worth to the pain to constantly stay in sync > with HEAD and deal with early adopter issues. And now guess further. > This application won't magically convert itself to 1.2 and that is not > because we don't want it to, but because we'll have to refactor > thousands and thousand lines of code done in ~5000 svn commits. So yes, > people will stick to CakePHP 1.1, PHP4 (the project I mentioned is php5) > and other old technologies and will highly appreciate any support going > into them. Now of course when you are starting a new project and it's > not all that big I'm somebody who also favors the usage of cutting edge > technology. But get real, for a really big app you need to rely on > technologies that are somewhat proven to work depending on the > environment you are working in. Of course, as a startup made up of a > couple guys living on Pizza, Coke and Hope you can make the craziest > choices and go with a Lisp-Haskell-HomebrewDB-Hybrid application or > whatever. That's because you'll either fail or be lucky enough to > discover a powerful combination that exceeds your wildest expectations. > But please give the rest of a world a brief moment to catch up with you > and don't make their life harder then necessary by promoting a no-legacy > support doctrine. > > Thanks a lot, Felix > --http://www.thinkingphp.orghttp://www.fg-webdesign.de > > R. Rajesh Jeba Anbiah wrote: > > > On May 29, 11:22 am, haj <[EMAIL PROTECTED]> wrote: > > >> PHP4 support is one of the most important features and advantages and > >> selling point of cakePHP. > > > That guy needs PHP4, this host needs PHP4, but no one is saying > > that I need a PHP4 support. This is the same scenario happened when > > PHP4 is released. It's always better to move upwards whether it's PHP > > or CakePHP (how many people are going to stick to 1.1 for instance?) > > >> This is not for some CS student's research > >> homework. Work in the field and realise a significance of PHP4 > >> support. > > >Ok. > > > -- > > > > Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.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?hl=en -~--~~~~--~~--~--~---
Validation $this->invalidate doesnt work....
The following: Cant figure out why validation not working... This is what i have; In my model 'User': array(array('rule' => array('minLength', 3),'message'=>'No name'))); function beforeValidate(){ if(!isset($this->data['User']['gender'])){ $this->invalidate('gender', 'No gender selected'); return false; } return true; } ?> In my view: radio('User/gender', array('m', 'v'), '?');?> tagErrorMsg('User/gender', 'No gender selected'); ?> But no errors are displayed When I do this in my controller: pr($this); There is an array : [validationErrors] => Array( [gender] => No gender selected ) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
move private subversion repository to CakeForge
Hi, I created a project on CakeForge for a product I developed in my own subversion repository. Now I would like to move my own repository into CakeForge keeping all revisions (using svnadmin dump > DUMPFILE and svnadmin load < DUMPFILE). svnadmin load does not work on remote repositories and I can't seem to login to CakeForge using ssh. Is there a solution to this? 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?hl=en -~--~~~~--~~--~--~---
Re: manage different applications on same cake installation
On 29 mayo, 14:01, rtanz <[EMAIL PROTECTED]> wrote: > so from the manual i understand that i should make the whole domain at > as a single cakephp application. Now if I also have other non cakephp > applications running on my server these should also go into the / > path_to_cake_nstall/app/webroot folder without being affected right? > > thanks If you are using a dev style install, and want 2 applications side by side, it's about this simple: extract cake to your server, copy the app folder paste the copy of the app folder alongside it's original and rename it (to say foo). go to the url /foo. It's a much better idea to use a production style setup - some reading which may be of interest: http://www.noswad.me.uk/MiBlog/ProductionSetup hth, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: manage different applications on same cake installation
so from the manual i understand that i should make the whole domain at as a single cakephp application. Now if I also have other non cakephp applications running on my server these should also go into the / path_to_cake_nstall/app/webroot folder without being affected right? 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?hl=en -~--~~~~--~~--~--~---
Re: manage different applications on same cake installation
ok thanks On May 29, 12:30 pm, "Siegfried Hirsch" <[EMAIL PROTECTED]> wrote: > 2007/5/29, rtanz <[EMAIL PROTECTED]>: > > > so how should they be organised, for example in the views folder i > > require and index.html for both projects so they cannot coexist > > together unless i change one of the filenames which i would not like > > to do. Can i separate them neatly into folders? and how can i achieve > > that thanks > > Read:http://manual.cakephp.org/chapter/installing > the part "Production setup" > I have just done that and have the applications in different subdomains and > the /cake/ is only installed once. You just have to set the following > DEFINES > > /app/webroot/index.php (partial, comments removed) > if (!defined('ROOT')) > { > define('ROOT', dirname(dirname(dirname(__FILE__; > > } > > if (!defined('APP_DIR')) > { > define ('APP_DIR', basename(dirname(dirname(__FILE__; > > } > > if (!defined('CAKE_CORE_INCLUDE_PATH')) > { > define('CAKE_CORE_INCLUDE_PATH', ROOT); > > } > > in your /app/webroot/index.php, which you have for every of your apps. > > -- > Siegfried Hirsch > hhS - Welserstr. 1 - 81373 München - (089) 5484 3564 - > skype:shirschhttp://gadgetgui.de/http://www.rss-blogger.dehttp://www.newsbee.deNewsBee > 2 - customized RSS solutions --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: manage different applications on same cake installation
2007/5/29, rtanz <[EMAIL PROTECTED]>: > > so how should they be organised, for example in the views folder i > require and index.html for both projects so they cannot coexist > together unless i change one of the filenames which i would not like > to do. Can i separate them neatly into folders? and how can i achieve > that thanks Read: http://manual.cakephp.org/chapter/installing the part "Production setup" I have just done that and have the applications in different subdomains and the /cake/ is only installed once. You just have to set the following DEFINES /app/webroot/index.php (partial, comments removed) if (!defined('ROOT')) { define('ROOT', dirname(dirname(dirname(__FILE__; } if (!defined('APP_DIR')) { define ('APP_DIR', basename(dirname(dirname(__FILE__; } if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', ROOT); } in your /app/webroot/index.php, which you have for every of your apps. -- Siegfried Hirsch hhS - Welserstr. 1 - 81373 München - (089) 5484 3564 - skype:shirsch http://gadgetgui.de / http://www.rss-blogger.de http://www.newsbee.de NewsBee 2 - customized RSS solutions --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: manage different applications on same cake installation
so how should they be organised, for example in the views folder i require and index.html for both projects so they cannot coexist together unless i change one of the filenames which i would not like to do. Can i separate them neatly into folders? and how can i achieve that thanks On May 29, 4:48 am, Travis Cline <[EMAIL PROTECTED]> wrote: > On May 28, 1:19 pm, rtanz <[EMAIL PROTECTED]> wrote: > > > hi i have recently installed cake and would like to test several > > applications to try the framework out and learn it, however i am not > > sure how to organise my stuff. what is the suggested way to organise > > folders and filees on a cake installation, is it better to just create > > a new cake folder for each new project or can i put all projects into > > one cake folder? > > It depends. > Unless you know you need to run separate cake versions for different > apps just place them all at the same directory level as the cake dir. > This makes pulling core updates much more simple. > > -- > Travis --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Country
> if i try, > $this->set('country', $data). pr($data); > > only blank array is displayed. > > further i want to know how to display it in the views. > Nearly there: // Set the country array to something the view can access. IN YOUR CONTROLLER: $this->set('country',$data); // IN YOUR VIEW: (this assumes you've got debug on, which is anybody's guess). Regards! -Toby --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Country
Thanx for replying. I tried, $data = $this->Country->findAll(); print_r($data); all the countrynames are being displayed. if i try, $this->set('country', $data). pr($data); only blank array is displayed. further i want to know how to display it in the views. On 5/29/07, majna <[EMAIL PROTECTED]> wrote: > > > > $data = $this->Country->generateList(); # (countries table have name > and id fields) > $this->set('country', $data). > pr($data); > > > On May 29, 10:06 am, cake_learner <[EMAIL PROTECTED]> wrote: > > I want to populate a select tag with country names. The names are in > > the database. The code i have written is: > > > > models: client.php > > > > > class Client extends AppModel > > { > >var $name='Client';} > > > > ?> > > > > models: country.php > > > class Country extends AppModel > > { > >var $name='Country'; > > > > } > > > > ?> > > > > controllers: > > > > > class ClientsController extends AppController > > { > > var $name = 'Clients'; > > > > var $uses = array('Clients', 'Country'); > > > >function index() { > > > >if (!empty($this->data)) > > { > > if ($this->Client->save($this->data)) > > { > > $this->flash('Your post has been saved.','/clients/ > > register2'); > > } > > } > > > >} > > > >function register2() > >{ > > // echo $this->Country; getting error: > >} > > > > } > > > > ?> > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Country
Hi cake_learner, I suggest you test the Country Select List Helper [1]. I think it is approximately what you are seeking. Greetings from Catalonia. [1] http://bakery.cakephp.org/articles/view/country-select-list-helper --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: so many queries--intentional??
On 29 mayo, 10:46, "R. Rajesh Jeba Anbiah" <[EMAIL PROTECTED]> wrote: > On May 29, 12:32 pm, AD7six <[EMAIL PROTECTED]> wrote: > > > On 29 mayo, 09:10, "R. Rajesh Jeba Anbiah" > > > >FWIW, I do not question the need to run the queries. But, my > > > question is that why it can't be optimized. With the better join > > > query, we can have a single query that serves the purpose, instead of > > > about 60 queries. > > > Consider what would happen if you had some of your blogs are > > associated with a large number (relative to your limit) of tags/ > > categories/comments. You can't apply a limit to the number of > > associated items, but also you can't even know how many results from > > your primary table will be returned. > > Thanks for your explanation. But, it's getting crazy; 50-100 queries > (unbind isn't helpful as I need the relevant data) often force me to > handcode the queries. Does this ticket apply https://trac.cakephp.org/ticket/2448 ? If so perhaps at some point your queries will be reduced. In the absence of any details, if each query gives you info that isn't already duplicated and you _need_ it, I think that's simply the way it (has to?) works. hth, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Country
$data = $this->Country->generateList(); # (countries table have name and id fields) $this->set('country', $data). pr($data); On May 29, 10:06 am, cake_learner <[EMAIL PROTECTED]> wrote: > I want to populate a select tag with country names. The names are in > the database. The code i have written is: > > models: client.php > > class Client extends AppModel > { >var $name='Client';} > > ?> > > models: country.php > class Country extends AppModel > { >var $name='Country'; > > } > > ?> > > controllers: > > class ClientsController extends AppController > { > var $name = 'Clients'; > > var $uses = array('Clients', 'Country'); > >function index() { > >if (!empty($this->data)) > { > if ($this->Client->save($this->data)) > { > $this->flash('Your post has been saved.','/clients/ > register2'); > } > } > >} > >function register2() >{ > // echo $this->Country; getting error: >} > > } > > ?> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: so many queries--intentional??
On May 29, 12:32 pm, AD7six <[EMAIL PROTECTED]> wrote: > On 29 mayo, 09:10, "R. Rajesh Jeba Anbiah" > >FWIW, I do not question the need to run the queries. But, my > > question is that why it can't be optimized. With the better join > > query, we can have a single query that serves the purpose, instead of > > about 60 queries. > > Consider what would happen if you had some of your blogs are > associated with a large number (relative to your limit) of tags/ > categories/comments. You can't apply a limit to the number of > associated items, but also you can't even know how many results from > your primary table will be returned. Thanks for your explanation. But, it's getting crazy; 50-100 queries (unbind isn't helpful as I need the relevant data) often force me to handcode the queries. I still believe, something can be done here. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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?hl=en -~--~~~~--~~--~--~---
Country
I want to populate a select tag with country names. The names are in the database. The code i have written is: models: client.php models: country.php controllers: data)) { if ($this->Client->save($this->data)) { $this->flash('Your post has been saved.','/clients/ register2'); } } } function register2() { // echo $this->Country; getting error: } } ?> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: so many queries--intentional??
The most important is that you only ask for what you need and make a good use of $conditions,$fields,$recursive,$limit and bindModel() unbindModel(); On May 29, 9:32 am, AD7six <[EMAIL PROTECTED]> wrote: > On 29 mayo, 09:10, "R. Rajesh Jeba Anbiah" > > > > <[EMAIL PROTECTED]> wrote: > > On May 28, 6:29 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:> On 5/28/07, > > R.RajeshJebaAnbiah<[EMAIL PROTECTED]> wrote: > > > > I'm getting so many queries in index action of controller, say for a > > > > typical blog project with categories, comments and tags, I'm getting > > > > so many queries in blogs/index which is having > > > > $this->Blog->recursive = 0; > > > > $this->set('blogs', $this->paginate()); > > > > This is normal behaviour, and is required for Cake's Models to do > > > their associative data mapping magic. > > > > > >FWIW, I do not question the need to run the queries. But, my > > question is that why it can't be optimized. With the better join > > query, we can have a single query that serves the purpose, instead of > > about 60 queries. > > Consider what would happen if you had some of your blogs are > associated with a large number (relative to your limit) of tags/ > categories/comments. You can't apply a limit to the number of > associated items, but also you can't even know how many results from > your primary table will be returned. > > hth, > > AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: so many queries--intentional??
On 29 mayo, 09:10, "R. Rajesh Jeba Anbiah" <[EMAIL PROTECTED]> wrote: > On May 28, 6:29 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:> On 5/28/07, > R.RajeshJebaAnbiah<[EMAIL PROTECTED]> wrote: > > > I'm getting so many queries in index action of controller, say for a > > > typical blog project with categories, comments and tags, I'm getting > > > so many queries in blogs/index which is having > > > $this->Blog->recursive = 0; > > > $this->set('blogs', $this->paginate()); > > > This is normal behaviour, and is required for Cake's Models to do > > their associative data mapping magic. > > > >FWIW, I do not question the need to run the queries. But, my > question is that why it can't be optimized. With the better join > query, we can have a single query that serves the purpose, instead of > about 60 queries. Consider what would happen if you had some of your blogs are associated with a large number (relative to your limit) of tags/ categories/comments. You can't apply a limit to the number of associated items, but also you can't even know how many results from your primary table will be returned. hth, AD --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: CakePHP php5?
> > That guy needs PHP4, this host needs PHP4, but no one is saying > that I need a PHP4 support. This is the same scenario happened when > PHP4 is released. It's always better to move upwards whether it's PHP > or CakePHP (how many people are going to stick to 1.1 for instance?) You *really* need to listen to the other folks. I'm working on one of the biggest cake apps around (300db tables, ~70 controllers, etc.). And guess what? It's 1.1. The reason for this is that the project was started about ~6 month ago when 1.2 was not where it's now and the team decided it would not be worth to the pain to constantly stay in sync with HEAD and deal with early adopter issues. And now guess further. This application won't magically convert itself to 1.2 and that is not because we don't want it to, but because we'll have to refactor thousands and thousand lines of code done in ~5000 svn commits. So yes, people will stick to CakePHP 1.1, PHP4 (the project I mentioned is php5) and other old technologies and will highly appreciate any support going into them. Now of course when you are starting a new project and it's not all that big I'm somebody who also favors the usage of cutting edge technology. But get real, for a really big app you need to rely on technologies that are somewhat proven to work depending on the environment you are working in. Of course, as a startup made up of a couple guys living on Pizza, Coke and Hope you can make the craziest choices and go with a Lisp-Haskell-HomebrewDB-Hybrid application or whatever. That's because you'll either fail or be lucky enough to discover a powerful combination that exceeds your wildest expectations. But please give the rest of a world a brief moment to catch up with you and don't make their life harder then necessary by promoting a no-legacy support doctrine. Thanks a lot, Felix -- http://www.thinkingphp.org http://www.fg-webdesign.de R. Rajesh Jeba Anbiah wrote: > On May 29, 11:22 am, haj <[EMAIL PROTECTED]> wrote: > >> PHP4 support is one of the most important features and advantages and >> selling point of cakePHP. >> > > That guy needs PHP4, this host needs PHP4, but no one is saying > that I need a PHP4 support. This is the same scenario happened when > PHP4 is released. It's always better to move upwards whether it's PHP > or CakePHP (how many people are going to stick to 1.1 for instance?) > > >> This is not for some CS student's research >> homework. Work in the field and realise a significance of PHP4 >> support. >> > >Ok. > > -- > > Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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?hl=en -~--~~~~--~~--~--~---
Re: so many queries--intentional??
On May 28, 6:29 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 5/28/07, R.RajeshJebaAnbiah<[EMAIL PROTECTED]> wrote: > > I'm getting so many queries in index action of controller, say for a > > typical blog project with categories, comments and tags, I'm getting > > so many queries in blogs/index which is having > > $this->Blog->recursive = 0; > > $this->set('blogs', $this->paginate()); > > This is normal behaviour, and is required for Cake's Models to do > their associative data mapping magic. FWIW, I do not question the need to run the queries. But, my question is that why it can't be optimized. With the better join query, we can have a single query that serves the purpose, instead of about 60 queries. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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?hl=en -~--~~~~--~~--~--~---
Re: Unobtrusive JavaScript validations
On May 29, 9:03 am, Travis Cline <[EMAIL PROTECTED]> wrote: > On May 28, 8:07 am, "R.RajeshJebaAnbiah" > I'm a +1 for obtaining unobtrusive JS validation that falls back onto > the defined validation constraints in the models. Thanks for your support:) > It appears your patch covers a bit more than just serving up the > relevant JSON. > Maybe reducing it and cleaning it up would be beneficial. Yep, I did patch other things too. But, for JSON dumping it's extremely easy. > Also, consider the user-callbacks that can be used for more advanced > validation -- they can't exactly be described directly in JSON... > Because of this, It's potential that at least part of the validation > will have to be done with XHR. I still believe that JSON dumping is enough as the whole validation rules defined in PHP will going to be available to the client. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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?hl=en -~--~~~~--~~--~--~---
Re: CakePHP php5?
On May 29, 11:22 am, haj <[EMAIL PROTECTED]> wrote: > PHP4 support is one of the most important features and advantages and > selling point of cakePHP. That guy needs PHP4, this host needs PHP4, but no one is saying that I need a PHP4 support. This is the same scenario happened when PHP4 is released. It's always better to move upwards whether it's PHP or CakePHP (how many people are going to stick to 1.1 for instance?) > This is not for some CS student's research > homework. Work in the field and realise a significance of PHP4 > support. Ok. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.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?hl=en -~--~~~~--~~--~--~---