Re: Are there performance overheads to RequestAction?
Thanks Felix, That's great info - I actually had bookmarked your blog post in my feeds to read later - wasn't sinking in when I tried reading it before - so I'll take a closer look now. all the best, -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 -~--~~~~--~~--~--~---
Re: Re: time helper displays time in 24 hour format.
I actually have my own MyTime that extends the time helper and has a formatTime function that takes a php format string as a param. On 6/28/06, Grant Cox <[EMAIL PROTECTED]> wrote: > > Copy the time.php helper from cake/libs/view/helpers to your > app/views/helpers folder, and then modify the niceShort function to use > "g" instead of "H" in the date() function calls. > > > > > --~--~-~--~~~---~--~~ 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: time helper displays time in 24 hour format.
Copy the time.php helper from cake/libs/view/helpers to your app/views/helpers folder, and then modify the niceShort function to use "g" instead of "H" in the date() function calls. --~--~-~--~~~---~--~~ 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: Questions from a newbie
On Jun 28, 2006, at 9:23 PM, Daniel King wrote: > How can I remove it? All of your views are encompassed in a layout. Cake's default layout is what you're seeing. Replace it by sticking in some HTML in a file at /app/views/layouts/default.thtml. Then stick in a special var to tell Cake where to place your views. It oughta look something like: -- 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: Questions from a newbie
On Jun 28, 2006, at 9:16 PM, Daniel King wrote: > Do I need to create a model and a controller for every page? Nope. Models just reflect data sources (usually database tables), and a controller is a way to manage the logic for a given model. > This needs > a table called "pages", but I don't need to store any data for > pages in > database. It needs a table, but doesn't store any data? That doesn't seem to make sense - I need a little clarification here. If your pages don't require any interaction with models, stick your views in the /app/views/pages folder and access them at example.com/ pages/viewName. > And if i create a page controller, Shall I have to get all > data in index page in the function "index" of the controller? > Categories and articles also have their own models and controllers. > and > how can I use them in the page controller's function "index"? If you want to include things from other models, there's lots of ways you can do it - add the model to the controller's $uses array. If you want your Banana in the ApplesController, add var $uses = ('Apple', 'Banana'); to get access to it. - you can use requestAction to pull in an entire rendered view from another controller. Check out the API for usage. Hope this helps some... -- J --~--~-~--~~~---~--~~ 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: Questions from a newbie
And I have another question. All my views are included in a CakePHP's "frame". Every view has a CakePHP's Logo and some links at the top and some little icons at the bottom. How can I remove 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 -~--~~~~--~~--~--~---
Questions from a newbie
Hello, I am a newbie. I have some questions to ask. I read "The Cake Blog Tutorial" and knew how to build a simple application like this example. But I don't know how to build some complexier applications, such as an "Article Manager". An "Article Manager" has these pages: Index Page, including list of the last several articles in every category, a list of categories and a list of top 10(for example) articles Article Page, including the article content, a list of categories, a list of other articles in the same category Every page has lots of informations. I don't know how to implement it with CakePHP. Do I need to create a model and a controller for every page? This needs a table called "pages", but I don't need to store any data for pages in database. And if i create a page controller, Shall I have to get all data in index page in the function "index" of the controller? Categories and articles also have their own models and controllers. and how can I use them in the page controller's function "index"? Sorry for my poor english, I wish you can understand my words. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
homepage controller = info from other controllers
Hello, I just started to learn Cake and I have a question: let's say I have users and messages controllers. They have some actions /users/* /messages/* etc. And I need to put some information about users and messages into homepage /. What do I need to create for this homepage - another controller and view? Please explain. I didn't found such info in the manual. --~--~-~--~~~---~--~~ 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: HABTM searches
for order (from the API documentation), it could use others parameters, for example:Model::find($conditions=null, $fields=null, $order=null, $recursive=null)string $order; SQL ORDER BY conditions (e.g. "price DESC") $this->User->Profile->findById("4", null, "Profile.dx")and for the retrieve the State detail of the user, could use the variable $recursive=2 (or =3) in the model class. 2006/6/28, davide <[EMAIL PROTECTED]>: Good afternoon.I have 4 tables: users, states, profiles and profiles_users (modelextract at the end)I would like to extract all users that has a particular profile.Searching thought the list archive I found[1] the solution $this->User->Profile->findById("4");This works pretty fine but it doesn't sort the records and doesn'tretrieve the State detail of the user.I would like to achieve the same result as of this query select a.surname as surname, a.name as name, c.dx as state, d.dx as profilefrom users as a join profiles_users as b on (b.user_id=a.id) join profiles as d on (b.profile_id = d.id) left join states as c on (a.state_id = c.id)where b.profile_id = 4 and d.dt_end_val >= current_dateorder by a.surname, a.name;is there some cake-way for doing this or should I have to use the findBySQL?Thanks in advanceByeDavide1. http://groups.google.com/group/cake-php/browse_thread/thread/50dd8e4461e34a81/8dbf01196906aaec/* * app/models/user.php */class User extends AppModel{ var $name="User"; var $belongsTo = array("State"); var $hasAndBelongsToMany = array("Profile" => array( "conditions " =>"Profile.dt_end_val >= CURRENT_DATE", "order" => "Profile.dx" ) );/* * app/models/state.php */ class State extends AppModel{ var $name = "State"; var $displayField = "dx"; var $hasMany = array("User"=>array("limit"=>"5"));/* * app/models/profile.php */class Profile extends AppModel{ var $name="Profile"; var $displayField = "dx"; var $hasAndBelongsToMany = array("User"); -- Ariel Santana --~--~-~--~~~---~--~~ 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: Fix for "Warning: mysql_connect(): Can't connect to local MySQL server through
is sure that the service of mysql this getting up, because seems to be a problem of connection with the mysql server. in linux is:/etc/init.d/mysql startor verify if the proccess is running: ps aux | grep mysqlmysql 5815 0.9 6.9 127008 17712 pts/0 Sl 22:50 0:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock 2006/6/28, Jim Plush <[EMAIL PROTECTED]>: I tried to post on an older topic but google doesn't you do anythingover 30 days. Anyway, I know this will be of use to someone sometimewhen trying to use bake.php on OSX. If you get the error:"Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) inopen up a terminal and make a soft link from tmp to var/mysql likebelow, it should now work just fine$ sudo mkdir /var/mysql$ sudo ln -s /tmp/mysql.sock /var/mysql/ --~--~-~--~~~---~--~~ 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 QUESTION: code continues executing after this->redirect()?
Thanks to all for the helpful responses. Adding exit(0) fixed my problem, and I will also consider a return. Jim http://www.biochartonline.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 -~--~~~~--~~--~--~---
Fix for "Warning: mysql_connect(): Can't connect to local MySQL server through
I tried to post on an older topic but google doesn't you do anything over 30 days. Anyway, I know this will be of use to someone sometime when trying to use bake.php on OSX. If you get the error: "Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in open up a terminal and make a soft link from tmp to var/mysql like below, it should now work just fine $ sudo mkdir /var/mysql $ sudo ln -s /tmp/mysql.sock /var/mysql/ --~--~-~--~~~---~--~~ 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: md5 field - modify field from controller
DJ Spark wrote: > might be on a beforeSave() callback or in the controller itself. Oh, you won't want to do it on a beforeSave either, as that will md5 the password every time you save the object, even when what's already stored on the object is a MD5 hash. So do it in the controller, when you know you have a plain text password. --~--~-~--~~~---~--~~ 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: md5 field - modify field from controller
To update the "logged" attribute, just set the appropriate id and save the right data. $this->User->id = $this->Session->read( "YourUserIDSessionVar" ); $this->User->save( array('logged'=>'0') ); And BlenderStyle - I don't think a small update like this will pose any kind of performance problem. By the time you've got hundreds of users logging in and out each second you'll have many other performance issues. --~--~-~--~~~---~--~~ 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: Routing, Replacing PagesController, and URL Replacement
John Zimmerman [gmail] wrote: > You could however rename your display() function to index() instead and > have /docs/home, /docs/otherpage. That's a good idea, I'll probably just do that. I just wish I could use the PagesController instead but it gets pissed when you try to use 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 relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
Fear not young baker. Our goal is to make constant improvements that will make your life easier, while keeping Cake flexible and extendable. Keep up with the changelogs and announcements. Also, have a look at the milestone pages on trac to see where we are heading. We have a lot planned and everyone needs to keep up. In any case, we are here along with the rest of the great community to have fun and bake. Also, if you have a chance to get on IRC (http://irc.cakephp.org) we can fix up quick problems like this in no time, which is part of that saving time/make life easier idea. Much better than getting frustrated or waiting for hours for someone to reply. Bake on. --~--~-~--~~~---~--~~ 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 relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
Well, when I turned on DEBUG 2, the problem was incredibly obvious. vg2_ is a prefix used for all the tables. In version 1.0.1 I had to put that manually in the joinTable field of the HABTM declaration. I guess that has been changed now (a good thing) but I never thought about that. Thanks for all your help gwoo. With this new level of debugging I think I should be able to avoid errors like this from now on. For some reason I thought that the default setting was to have debugging at maximum... which is obviously a bad assumption to make. Anyway, sorry if I wasted your time, and thank you for helping me out. After initially being blown away by how well Cake worked, I was starting to get discouraged, but now my faith has been restored. --~--~-~--~~~---~--~~ 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 relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
is vg2 a prefix? Anyway, hopefully you have DEBUG 2 in core.php that will show you what Cake is trying to do when it saves. you may need to override redirect to see the queries though because scaffolding uses Session flash. just put in the controller function redirect(){} --~--~-~--~~~---~--~~ 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 relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
Hi, I have pasted the code as you requested. Here is the URL: http://cakephp.org/pastes/show/cbfc44ce19eca448f74e9cb9441657ce 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: Model relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
@jobu can you paste all your models in http://cakephp.org/pastes/add 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: Model relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
Hello, I have just tested with the latest nightly build I could find: cake_nightly_27.06.2006 (1.1.6.3178) There is no change. The HABTM relationships still do not work, as in 1.1.3 and 1.1.5. Nice new look on the scaffolding 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: PLEASE HELP WITH ajax link
I fixed the problem. All i had to do was fix the ajax->link link('Delete', 'listing_editallkeywords/' . $data[$i]['Keyword']['id'], array('update'=>'tasks_done', 'after' => 'new Effect.Fade(\'done_' . $data[$i]['Keyword']['id'] . '\');')); ?> 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 -~--~~~~--~~--~--~---
time helper displays time in 24 hour format.
The time helper is displaying time in 24 hour format when I use $time->niceShort. How do I make it format in 12 hour format? --~--~-~--~~~---~--~~ 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: md5 field - modify field from controller
ivan wrote: > I also need to change when logout is called the stat of logged from 1 > to 0, without any view in the way. logged is a field in the user table. Let me get this straight. Everytime someone logs in you change the logged field in your users table to 1 and then when they logout you change the logged field to 0. If you want to make sure your users are logging out this would be the way to do it. However, if you just want to check if they're logged in or not and you don't care if they actually click a logoout link you can use $this->Session->check('User') where User is created when you do $this->Session->write('User'=>'blah'). I think I may be messing that up but if you go to http://manual.cakephp.org there's a tutorial on authentication that's pretty good. If you write to the database everytime someone logs in or out your performance may begin to suffer a bit depending on how big your site is. --~--~-~--~~~---~--~~ 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: md5 field - modify field from controller
before saving , set the password as $this->data['Model']['passwordfield'] = md5($this->data['Model']['passwordfield']); might be on a beforeSave() callback or in the controller itself. spark On 6/28/06, ivan <[EMAIL PROTECTED]> wrote: > > Hi > > I need to save a field encoded md5. Let's say I have user and password, > so i want to save the user as comes from the view, but, the password > want to md5 first. how to do it? > > I also need to change when logout is called the stat of logged from 1 > to 0, without any view in the way. logged is a field in the user table. > > thanks in advance > > Ivan > > > > > -- [web] http://synapsisdi.com.br [livesets] http://djspark.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 -~--~~~~--~~--~--~---
md5 field - modify field from controller
Hi I need to save a field encoded md5. Let's say I have user and password, so i want to save the user as comes from the view, but, the password want to md5 first. how to do it? I also need to change when logout is called the stat of logged from 1 to 0, without any view in the way. logged is a field in the user table. thanks in advance Ivan --~--~-~--~~~---~--~~ 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 relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
test on the latest nightly: http://cakephp.org/downloads --~--~-~--~~~---~--~~ 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: Are there performance overheads to RequestAction?
Hey admataz, from my experience the performance overhead from requestAction can be significant when you have more then 5-7 of such calls for each action you execute. However, this definitely depends on the work-load that is caused by the actions/views themselfs, so I would need to do a series of benchmarks in order to figure out how much overhead is caused by requestAction itself. What I can tell you for sure, is that I've written up a solution for my plugin based cms(toolbox) called SpliceIt!, that has it's own way to exchange data between controllers and that performance increased by a good amount after implementing it. I basically added a new variable to my AppController that's called $apis (var $apis) and I can use it like var $models, but the stuff that get's loaded are specific Controllers of other plugins that are only ment for data exchange with other plugins, I call them ApiControllers. Just take a look at this, if you are interested in it: http://www.thinkingphp.org/2006/06/24/welcome-to-the-dark-side-of-plugins-in-cakephp/ right now it's still a bit experimental, but works like a charm. I would love to see a similar thing integrated into the cake core and I'll try to talk to phpnut_ about it, but I don't have too much hope that'll actually be part of cakephp soon ; ). Therefor, you should stay with requestAction and maybe make use of cache() as much as you can for right now. Best Regards, Felix Geisendörfer -- http://www.thinkingphp.org http://www.fg-webdesign.de admataz schrieb: Hi all, >From some of the research I've done and few experiments I've tried with CakePHP, I've discovered that RequestAction in combination with Elements is an extremely useful and flexible way of embedding modular dynamic content on pages controllers. However, a few comments I have read in this list suggest there is an overhead and possible performance hit when using RequestAction. Can someone clarify or confirm? Thanks for all the tasty treats. CakePHP is really working well for me. -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 -~--~~~~--~~--~--~---
Re: View cache
AD7six ha scritto: > > I think* that cache does work with layouts or elements at this time. I think too :( --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Model relationships broken in 1.1.3 and 1.1.5 - working in 1.0.1
Hello, I am not sure if this is a bug in the new versions, or if something is wrong in my code, but I have some models set up that work fine in 1.0.1 but are broken in newer versions. The newer versions are having problems with some of the HABTM relationships. In the new versions, Cake does seem to understand that two models should be connected, since when editing a model in the scaffolding, a multiple select box is created with the right options. However, no matter what I choose from that select box, nothing gets entered into the database, and information already in the DB from the older version is not properly read when viewing a model. The setup I have is kind of complicated. I am building a shopping cart with the following 5 models: Cart Product ProductOption (Such as size, colour, etc) ProductOptionValue (Such as small, medium, large or red, blue, brown, etc.) ProductOrder (Contains information about an order a customer made, and which options and option values they picked) Rather than post all of the code here, I have put all the models up here: http://www.inthehouse.com/cakeDebug/models.txt Currently the controllers are as basic as possible, including nothing more than a $name variable and $scaffold. All the relationships other than the HABTM relationships are working fine. The HABTM relationships are not being correctly understood by the view and edit pages in the scaffolding, and using the findAll() function similarly fails to find models that are related through HABTM. Here is a list of all the relationships in plain English, for easier reference: Cart: hasMany: ProductOrder Product hasMany: ProductOrder HABTM: ProductOptionValue, ProductOption ProductOption HABTM: Product hasMany: ProductOptionValue ProductOptionValue belongsTo: ProductOption HABTM: Product, ProductOrder ProductOrder belongsTo: Cart, Product HABTM: ProductOptionValue If anyone could help me with this I would be very grateful. I am pretty much a newbie to Cake, so I have no idea if the problem I am having is with my code, or if this is a genuine issue with the newer versions. --~--~-~--~~~---~--~~ 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: stats for cakephp
bracchetto ha scritto: > i want to register the visits of my site, i try some script but i > didn't found one that i like. > why not to start a project of stats for cakephp? Why don't send a cookie the first time user open your site ? if(!mycookie_exists) { send_cookie() $User->addvisit($userdata) } else { //nothing } put a simil code in your beforeFilter If you want Cake Controller has log method too .. check out TFM :P http://manual.cakephp.org/chapter/7 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
PLEASE HELP WITH ajax link
//Error Missing Method in AdvertisersController You are seeing this error because the action advertisers is not defined in controller AdvertisersController Notice: this error is being rendered by the app/views/errors/missing_action.thtml view file, a user-customizable error page for handling invalid action dispatches. Fatal: Create Method: in file : app/controllers/advertisers_controller.php Error: Unable to execute action advertisers in AdvertisersController //controller: advertisers_controller.php function listing_editallkeywords($deleteKeyword_id = null) { $data = $this->Keyword->findAll($criteria="account_id = '" . $this->Xauth->getId() . "'", $fields=null, $this->order, $this->show, $this->page); //ListingID ($id) is invalid. if (empty($data)) { $this->redirect('/advertisers/listing_viewlisting/'); } if ($deleteKeyword_id) { $this->Keyword->del($deleteKeyword_id); } $paging['style'] = 'ajax'; $paging['link'] = '/bare/advertisers/listing_editallkeywords/?show='.$this->show.'&sort='.$this->sortBy.'&direction='.$this->direction.'&page='; $paging['count'] = $this->Keyword->findCount($criteria="account_id = '" . $this->Xauth->getId() . "'",'50'); $paging['show'] = array('10','25','50'); $paging['page'] = $this->page; $paging['limit'] = $this->show; $paging['direction'] = $this->direction; $this->set('paging',$paging); $this->set('data',$data); $this->render(); } //view: listing_editallkeywords '; ?> Delete link('Delete', 'advertisers/listing_editallkeywords/' . $data[$i]['Keyword']['id'], array('update'=>'tasks_done', 'after' => 'new Effect.Fade(\'done_' . $data[$i]['Keyword']['id'] . '\');')); ?> Keyword: Bid Amout:$ input('Keyword/bid_' . $data[$i]['Keyword']['id'], array('type' => 'text', 'size' => '6', 'maxlength' =>'6', 'value' => $data[$i]['Keyword']['bid'])) ?> --~--~-~--~~~---~--~~ 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 to cake, running without mod_rewrite
Hi! I'm pretty new here too but have also had some problems getting Cake working without mod_rewrite being available. So might be able to help. If you have uncommented define ('BASE_URL', env('SCRIPT_NAME')); from core.php you must all make sure the 3 .htaccess files are removed from from the cake install folders /cake_1.1.5.3148 /app /app/webroot On my install I found that once this was done there was a problem with the links being generated incorrectly from the base url which I managed to fix by changing //define ('BASE_URL', env('SCRIPT_NAME')); to define ('BASE_URL', 'http://'.env('HTTP_HOST').'/index.php'); in core.php presumably you could also try define ('BASE_URL', 'http://'.env('HTTP_HOST').'/index.php?') I think this problem may also relate to https://trac.cakephp.org/ticket/812 cheers --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Are there performance overheads to RequestAction?
Hi all, >From some of the research I've done and few experiments I've tried with CakePHP, I've discovered that RequestAction in combination with Elements is an extremely useful and flexible way of embedding modular dynamic content on pages controllers. However, a few comments I have read in this list suggest there is an overhead and possible performance hit when using RequestAction. Can someone clarify or confirm? Thanks for all the tasty treats. CakePHP is really working well for me. -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 -~--~~~~--~~--~--~---
Re: stats for cakephp
no.. sorry for my english, i don't speak it very well. I ask if there is a project for stats on 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: stats for cakephp
The question is would the caching of pages make it easier or harder to build a statistics package for 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 -~--~~~~--~~--~--~---
stats for cakephp
i want to register the visits of my site, i try some script but i didn't found one that i like. why not to start a project of stats for 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: View cache
Hi AD7six, How are you testing this. When I run a view I still see the sql trace at the bottom which makes me think that it's not running (with debug=2). I _do_ see the file in the folder, but even with debug =0 I don't really experience any speed up. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Saving to 2 models
ahhh so simple :) 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: Saving to 2 models
On 6/28/06, sicapitan <[EMAIL PROTECTED]> wrote: > Notice: Undefined property: CompaniesController::$User in > C:\Program > Files\xampp\htdocs\eApproval\app\controllers\companies_controller.php > on line 31 > > Line 31 being $this->User->save... hi sicaptan I guess it should be : $this->Company->User->save( ... because your controller is Companies, it only builds the "Company" model by default (which has a User model inside because of the association). to use $this->User directly, you must set var $uses = array("Company","User"); in CompaniesController. clement --~--~-~--~~~---~--~~ 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: Saving to 2 models
$this->arrCompany['data']['Company'] = $this->params['data']['Company']; $this->arrUser['data']['Users'] = $this->params['data']['User']; $this->Company->save($this->arrCompany['data']); $this->User->save($this->arrUser['data']); Hmm ok so I know this doesn't work for Users only, but the company is saved. I get this: Notice: Undefined property: CompaniesController::$User in C:\Program Files\xampp\htdocs\eApproval\app\controllers\companies_controller.php on line 31 Line 31 being $this->User->save... Am I in the right place here? I know my Users is linked to my company in my model, is the correct way to do this from the users controller instead? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cake test suite problems / not detected by bake script
I'm using the most recent versions of CakePHP (1.1.5.3148) and the test suite (1.0.0.5) but when I run the bake script it says "Cake test suite not installed" though I am able to force it make the unit test. However when I go test it out by visiting /tests/ I get the following error:- Warning: opendir(d:\www\cake\app\tests\core\groups): failed to open dir: Invalid argument in d:\www\cake\app\tests\lib\test_manager.php on line 189 Fatal error: Couldn't open d:\www\cake\app\tests\core\groups in d:\www\cake\app\tests\lib\test_manager.php on line 191 I followed the instructions in the wiki so I'm not sure what I'm doing wrong. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
HABTM searches
Good afternoon. I have 4 tables: users, states, profiles and profiles_users (model extract at the end) I would like to extract all users that has a particular profile. Searching thought the list archive I found[1] the solution $this->User->Profile->findById("4"); This works pretty fine but it doesn't sort the records and doesn't retrieve the State detail of the user. I would like to achieve the same result as of this query select a.surname as surname, a.name as name, c.dx as state, d.dx as profile from users as a join profiles_users as b on (b.user_id=a.id) join profiles as d on (b.profile_id = d.id) left join states as c on (a.state_id = c.id) where b.profile_id = 4 and d.dt_end_val >= current_date order by a.surname, a.name; is there some cake-way for doing this or should I have to use the findBySQL? Thanks in advance Bye Davide 1. http://groups.google.com/group/cake-php/browse_thread/thread/50dd8e4461e34a81/8dbf01196906aaec /* * app/models/user.php */ class User extends AppModel{ var $name="User"; var $belongsTo = array("State"); var $hasAndBelongsToMany = array("Profile" => array( "conditions " => "Profile.dt_end_val >= CURRENT_DATE", "order" => "Profile.dx" ) ); /* * app/models/state.php */ class State extends AppModel{ var $name = "State"; var $displayField = "dx"; var $hasMany = array("User"=>array("limit"=>"5")); /* * app/models/profile.php */ class Profile extends AppModel{ var $name="Profile"; var $displayField = "dx"; var $hasAndBelongsToMany = array("User"); signature.asc Description: OpenPGP digital signature
Re: Design an hirearchy?
Using prototype or the stripped down version in moo.fx, you could do : document.getElementsByClassName('objective').each( function(element){ element.onclick = function() { //you code } } } ); also don't forget to let a correct behavior if javascript is disabled. olivvv [EMAIL PROTECTED] wrote: > Hi all, > > now, I have a table that contains an hierarchy made like this: > > - objective > - goal (field 'father_id' = objective_id) > - practice (field 'father_id' = goal_id) > > now, how can I draw it in my view? I mean, everyone of these above has > a "applicabile" field that is an enum like Y or N; I want a checkbox > near all these elements and if I click on a father, for example to > uncheck it, every child unchecks its box. I need Javascript? Please > help...it's driving me mad!! > > Alberto > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Design an hirearchy?
Hi all, now, I have a table that contains an hierarchy made like this: - objective - goal (field 'father_id' = objective_id) - practice (field 'father_id' = goal_id) now, how can I draw it in my view? I mean, everyone of these above has a "applicabile" field that is an enum like Y or N; I want a checkbox near all these elements and if I click on a father, for example to uncheck it, every child unchecks its box. I need Javascript? Please help...it's driving me mad!! Alberto --~--~-~--~~~---~--~~ 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: Rails-like testing methods in the TestSuite
ate wrote: > Thus far we've tended to favor pure-PHP configuration, or INI-based > formats where better suited. See paths.php and tags.ini.php in > cake/config/ to get an idea. Thanks Nate. I'll consider having different file types that can be used as fixtures. I imagine YAML and raw PHP should both be nice and straightforward, at least. Mark --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Saving to 2 models
I had a search and couldn't find anything explicit with the current version so I thought I'd ask. I have a 'users' and 'companies' model: class User extends AppModel { var $name = 'User'; var $belongsTo = array('Group','Company'); var $recursive = 3; } class Company extends AppModel { var $name = 'Company'; var $hasMany = 'User'; } I have a form in a view /companies/add_company/ which has both company information, and user information on it which I want to save down at the same time. In my 'Companies' controller: function add_company() { if (!empty ($this->params['data'])) { if ($this->Company->save($this->params['data'])) { $this->set('data', $this->Company->findAll()); $this->render('index', 'ajax'); } else { // do nothing } } $this->autoLayout = NULL; } This saves the company information correctly but of course the user information is not. Do I need to reformat the params['data'] to something like: $this->arrCompany['data'] = $this->params['data']['Company']; $this->arrUser['data'] = $this->params['data'][User']; then save: $this->Company->save($this->arrCompany['data'])) $this->User>save($this->arrUser['data'])) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: mysql_connect error when baking model
i had the same problem (was using a basic easyphp install) - upgrade to latest php - just be sure to have the php on the windows path - the php.ini MUST NOT have those custom easyphp variables, since they cannot be interpreted by php alone. I think the php.ini also must be copied to the php folder. - uncomment the mysql extension on the php.ini if you upgrade from php 4 to 5 , the extensions folder changed. hope it helps :) spark On 6/28/06, den1jay <[EMAIL PROTECTED]> wrote: > > how shall i get the php cli version with mysql support? I mean from > where. I am on windows and i can't even compile my own. > > > > > -- [web] http://synapsisdi.com.br [livesets] http://djspark.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 -~--~~~~--~~--~--~---
Newbie to cake, running without mod_rewrite
Hi, I have installed cake 1.1.5.3148 on a linux server with php 5.1.2. I do not know the apache version or configuration on the server however. I installed cake in the top level of my folder structure for my website as follows : /app cake vendors index.php I did not make any changes to the directories as defined in any of the config files. Based on this excerpt from the cake manual : "... If the Cake welcome page looks a little funny (no images or css styles), it probably means mod_rewrite isn't functioning on your system ...". I presumed that indeed mod_rewrite was not enabled and/or not running on the server. I therefore proceeded to modify the app/config/index.php file and uncommented the line : define ('BASE_URL', env('SCRIPT_NAME')); That fixed the welcome page so it looked as expected. I set up the mysql connection and the welcome page informed me that it could find the connection and connected to the database fine. I proceeded to follow the "blog" tutorial (adding the table to the db, adding a "Post" model, a "PostsController" controller - with an index function - and finally adding a view). However I found some issues when attempting to view the new posts page : 1. If I navigate to www.mysite.com/index.php I see the welome page as expected. 2. If I navigate to www.mysite.com/posts/index I get a page not found (this was expected after reading in this group about when you do not use mod_rewrite). 3. If I navigate to www.mysite.com/index.php/posts/index I get a page not found. This was unexpected as it looks like this in the manual in the section about when you do not use mod_rewrite. 4. After some headaches I tried www.mysite.com/index.php?posts/index and got the page that lists the blog posts. It listed 2 posts as expected. 5. Upon clicking on one of the posts, I noticed that the url it resolved to was "www.mysite.com/index.php/posts/view/1". Unfortunately, as you can see from point 3, this does not work in my case (www.mysite.com/index.php?posts/view/1 does work however). So, due to point 5, my question is : how do I get cake to not produce links that look like www.mysite.com/index.php/controller/action and rather produce them like www.mysite.com/index.php?controller/action ? Thankyou for any time you can devote to this, John K. --~--~-~--~~~---~--~~ 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: Mutliple database & Session into model
Thanks for the advice! I'll test this one very soon and I'll let you know! Alberto --~--~-~--~~~---~--~~ 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 multiple dic update ..again, sorry to bother
Thanks, I will have a look but that does not answer my question :-) --~--~-~--~~~---~--~~ 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: CakePHP and wizards
Actually, I am already storing it in a session. I am using the following code for session storage: if (isset($this->data['save'])) { $this->Company->set($this->data); $_SESSION['company'] = $this->Company; } So, the problem still comes down to overwriting the contents of the first form submission with the input from the second form submission. I guess I can use the storeData() method mentioned above to store the data in individual objects for each step of the wizard. However, this means that I will have to combine these objects together to form a correctly formatted $data object if I want to enable automatic storage to the database with the save() command, which is fine by me, but I was just wondering if there was a cleaner way of doing this in CakePHP. Thanks for the suggestions. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Getting a rendered action without using requestAction
Is there a way of getting an action's (from the same controller) rendered view without using requestAction()? Say you have a FooController: class FooController extends AppController { function someAction() { ... } function otherAction() { $this->set('someActionOutput', $this->someAction()); } } How can i make someAction() return the rendered view so i can do what i do in otherAction()? Is there some other way of doing it (without requestAction())? Thanks in advance. -- Gonçalo Marrafa <[EMAIL PROTECTED]> --~--~-~--~~~---~--~~ 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: CakePHP and wizards
I have found the Post/Redirect/Get model for developing wizards and have found it to be a good approach. I wrote a basic introduction in the Wiki here: http://wiki.cakephp.org/tutorials:building_a_web_wizard There are a couple of links in there to other info for this design pattern. It covers using sessions for persistence which is what I think that you will need to solve your problem. Hope this helps. Regards, Langdon StinkyTofu wrote: > I am having trouble writing a simple 3-step Wizard. Basically, I am > trying to figure out the best way to temporary save form inputs in the > model, without writing it to the database until the user finishes step > 3 of the wizard and clicks on the Finish button. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: mysql_connect error when baking model
how shall i get the php cli version with mysql support? I mean from where. I am on windows and i can't even compile my own. --~--~-~--~~~---~--~~ 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: CakePHP and wizards
> imho, you are not overwriting the data with $this->Company->set. the > problem is, that unfortunately after rendering your second page the > model object and its data is gone. There are no persistent objects in > CakePHP unless you store it to the database. One solution will be to > store your data in the session. yep. store it in a session, perhaps writing a function a bit like set: function storeData ($step='step1', $data) { $this->Session->write($step, $data); } or similar your only other alternative would be to have hidden fields for the previous steps data in each new step... hth 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: CakePHP and wizards
imho, you are not overwriting the data with $this->Company->set. the problem is, that unfortunately after rendering your second page the model object and its data is gone. There are no persistent objects in CakePHP unless you store it to the database. One solution will be to store your data in the session. --~--~-~--~~~---~--~~ 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: observeField and Javascript error
try moving the code $ajax->observeField at the bottom (after the DIV users_list and after the input searchfield) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---