Re: button wont display as it should
According to the docs http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html To create an image link specify the link destination using the url option in $htmlAttributes.: echo $this-Html-image(recipes/6.jpg, array( alt = Brownies, 'url' = array('controller' = 'recipes', 'action' = 'view', 6) )); On 2 Jun 2014, at 14:37, jagguy and...@itfutures.edu.au wrote: Hi, I simply want to display a button instead of a link but the button doesnt appear as I cant override the link display with htmlHelper In older versions of cake 2.x this does work. echo td .$this-Html-link('Edit', array('controller' = 'users', 'action' = 'editteacher/'.$item['User']['id']), array('class' = 'button')) .td; http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Is Cake Dead Or Just Catching Up?
On 12 Mar 2014, at 14:50, kdubya kenwin...@winanstech.com wrote: Also, judging by participation in the Google CakePHP group is not very valid either. StackOverflow seems to be more active now and the questions seem to be better. I agree, I asked a few questions on the Google group when I first got started with CakePHP, now I've more experience my questions are rarer but I often find the answers with a search on StackOverflow. Paul -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Accessing things in $this-request-data
It was indeed $this-request-data['Item']['category_id'] Thanks, just had a bit of a mind block! Paul On 4 Oct 2013, at 01:28, Simon Males s...@sime.net.au wrote: Throw in a debug($this-request-data) to see what data you have. Though it's likely: $this-request-data['Item']['category_id'] or $this-request-data('Item.category_id') On Fri, Oct 4, 2013 at 6:14 AM, Paul Willis paul.wil...@me.com wrote: In my ItemsController I'm editing an item and then want to redirect back to the category that the item is in but I'm not sure how to access the category_id that is in $this-request-data My controller function (edited down to the relevant lines only) is... public function admin_edit($id = null) { if ($this-request-is('post') || $this-request-is('put')) { if ($this- Item-save($this-request-data)) { $this-Session-setFlash(__('The Item has been saved')); $this-redirect(array('controller' = 'categories', 'action' = 'view', *)); } } } Where I have *** I need something like… $this-request- Item-category_id ...to pull the category_id out but I can't get the correct syntax to use The category_id is in there as it is being saved with all the other item data. I'm on CakePHP 2.3.x if that is relevant. Regards Paul -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out. -- Simon Males -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Accessing things in $this-request-data
In my ItemsController I'm editing an item and then want to redirect back to the category that the item is in but I'm not sure how to access the category_id that is in $this-request-data My controller function (edited down to the relevant lines only) is... public function admin_edit($id = null) { if ($this-request-is('post') || $this-request-is('put')) { if ($this- Item-save($this-request-data)) { $this-Session-setFlash(__('The Item has been saved')); $this-redirect(array('controller' = 'categories', 'action' = 'view', *)); } } } Where I have *** I need something like… $this-request- Item-category_id ...to pull the category_id out but I can't get the correct syntax to use The category_id is in there as it is being saved with all the other item data. I'm on CakePHP 2.3.x if that is relevant. Regards Paul -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Notice (8): Undefined variable:
On 27 Aug 2013, at 16:33, Diego Santos diegosantooo...@gmail.com wrote: $ this- set ('database', $ banks); Sets the variable $database that you need to echo in your view (not $banks) So a view like this ? echo $database ? Although I would avoid the word 'database' as your variable name altogether. Not saying it would cause any issue but I avoid any possible conflict words Paul -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cakephp 1.3 video tutorial
I found Andrew Perk's series to be very useful http://www.youtube.com/watch?v=nO9oSQhRa9s PW On 12 Mar 2013, at 14:54, Joseph zhu zhubujun...@gmail.com wrote: Hi there: I am a beginner for cakephp 1.3, I have a website built with cakephp 1.3, so I want to study it, and who has the cakephp 1.3 video tutorial, could you please recommend me some links? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Pagination
Yes my posts have many categories, probably categories would be called Tags in a regular blog setup. Anyway I followed your advice and moved my code to my CategoriesController and following the answer to a similar question here http://stackoverflow.com/questions/4627120/cakephp-1-3-paginating-habtm-related-data I specified my joins and everything is now working (the link is for 1.3 but it worked fine on 2.2) Thanks again for the help Cheers PW On 20 Nov 2012, at 05:38, Andras Kende and...@kende.com wrote: Paul, Sorry the code I gave earlier is not valid, my mistake... this is better for that specific: $posts = $this-paginate('Category'); OR $posts = $this-paginate($this-Post-Category); But now you mentioning HABTM which is something different…. So the reason for HABMT is that a single post can belong to multiple categories ? Andras On Nov 19, 2012, at 3:45 PM, Paul Willis paul.wil...@me.com wrote: And when I say I can't get it to work it is because using the code from Andras gives the error... Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'paginate' at line 1 SQL Query: paginate On 19 Nov 2012, at 23:41, Paul Willis paul.wil...@me.com wrote: Thanks for the replies but I can't seem to get any solution to work I wonder if it is because I stupidly missed a vital detail... My posts and categories are a HABTM relationship so I have no category_id in the posts table. I have a posts table, a categories table and a categories_posts table PW On 19 Nov 2012, at 22:22, lowpass zijn.digi...@gmail.com wrote: If your controller already declares a $paginate var it would be better to add the conditions to it rather than redeclare the entire array. Also, you can use the Post.category_id in the conditions. $this-paginate['conditions'] = array('Post.category_id' = $id); On Mon, Nov 19, 2012 at 4:15 PM, Andras Kende and...@kende.com wrote: something like this should work: public function category($id = null) { $this-paginate = array( 'conditions' = array( 'Category.id' = $id ) ); $posts = $this-Post-Category-paginate('Category'); //print_r($posts); // to test here ... $this-set(compact('posts')); } But since you paginating categories it may be better to do this from the categories controller.. Andras Kende http:///www.kende.com On Nov 19, 2012, at 12:57 PM, Paul Willis paul.wil...@me.com wrote: In my PostsController.php I have a function to find all the posts from a category… public function category($id = null) { $this-set('posts', $this-Post-Category-find('first', array( 'conditions' = array( 'Category.id' = $id ) ))); } This works fine and all my posts for the particular category are returned. However I obviously get every post in that category and so now I would like to use paginate but I'm not sure how to add it to the above function. PW -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit
Pagination
In my PostsController.php I have a function to find all the posts from a category… public function category($id = null) { $this-set('posts', $this-Post-Category-find('first', array( 'conditions' = array( 'Category.id' = $id ) ))); } This works fine and all my posts for the particular category are returned. However I obviously get every post in that category and so now I would like to use paginate but I'm not sure how to add it to the above function. PW -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Pagination
I'm not paging categories I'm trying to page posts that belong to a particular category PW On 19 Nov 2012, at 21:15, Andras Kende and...@kende.com wrote: something like this should work: public function category($id = null) { $this-paginate = array( 'conditions' = array( 'Category.id' = $id ) ); $posts = $this-Post-Category-paginate('Category'); //print_r($posts); // to test here ... $this-set(compact('posts')); } But since you paginating categories it may be better to do this from the categories controller.. Andras Kende http:///www.kende.com On Nov 19, 2012, at 12:57 PM, Paul Willis paul.wil...@me.com wrote: In my PostsController.php I have a function to find all the posts from a category… public function category($id = null) { $this-set('posts', $this-Post-Category-find('first', array( 'conditions' = array( 'Category.id' = $id ) ))); } This works fine and all my posts for the particular category are returned. However I obviously get every post in that category and so now I would like to use paginate but I'm not sure how to add it to the above function. PW -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Pagination
Thanks for the replies but I can't seem to get any solution to work I wonder if it is because I stupidly missed a vital detail... My posts and categories are a HABTM relationship so I have no category_id in the posts table. I have a posts table, a categories table and a categories_posts table PW On 19 Nov 2012, at 22:22, lowpass zijn.digi...@gmail.com wrote: If your controller already declares a $paginate var it would be better to add the conditions to it rather than redeclare the entire array. Also, you can use the Post.category_id in the conditions. $this-paginate['conditions'] = array('Post.category_id' = $id); On Mon, Nov 19, 2012 at 4:15 PM, Andras Kende and...@kende.com wrote: something like this should work: public function category($id = null) { $this-paginate = array( 'conditions' = array( 'Category.id' = $id ) ); $posts = $this-Post-Category-paginate('Category'); //print_r($posts); // to test here ... $this-set(compact('posts')); } But since you paginating categories it may be better to do this from the categories controller.. Andras Kende http:///www.kende.com On Nov 19, 2012, at 12:57 PM, Paul Willis paul.wil...@me.com wrote: In my PostsController.php I have a function to find all the posts from a category… public function category($id = null) { $this-set('posts', $this-Post-Category-find('first', array( 'conditions' = array( 'Category.id' = $id ) ))); } This works fine and all my posts for the particular category are returned. However I obviously get every post in that category and so now I would like to use paginate but I'm not sure how to add it to the above function. PW -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Pagination
And when I say I can't get it to work it is because using the code from Andras gives the error... Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'paginate' at line 1 SQL Query: paginate On 19 Nov 2012, at 23:41, Paul Willis paul.wil...@me.com wrote: Thanks for the replies but I can't seem to get any solution to work I wonder if it is because I stupidly missed a vital detail... My posts and categories are a HABTM relationship so I have no category_id in the posts table. I have a posts table, a categories table and a categories_posts table PW On 19 Nov 2012, at 22:22, lowpass zijn.digi...@gmail.com wrote: If your controller already declares a $paginate var it would be better to add the conditions to it rather than redeclare the entire array. Also, you can use the Post.category_id in the conditions. $this-paginate['conditions'] = array('Post.category_id' = $id); On Mon, Nov 19, 2012 at 4:15 PM, Andras Kende and...@kende.com wrote: something like this should work: public function category($id = null) { $this-paginate = array( 'conditions' = array( 'Category.id' = $id ) ); $posts = $this-Post-Category-paginate('Category'); //print_r($posts); // to test here ... $this-set(compact('posts')); } But since you paginating categories it may be better to do this from the categories controller.. Andras Kende http:///www.kende.com On Nov 19, 2012, at 12:57 PM, Paul Willis paul.wil...@me.com wrote: In my PostsController.php I have a function to find all the posts from a category… public function category($id = null) { $this-set('posts', $this-Post-Category-find('first', array( 'conditions' = array( 'Category.id' = $id ) ))); } This works fine and all my posts for the particular category are returned. However I obviously get every post in that category and so now I would like to use paginate but I'm not sure how to add it to the above function. PW -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Migrating from local host...Issues with CSS
The CSS not loading is a classic sign That your mod_rewrtie isn't working on he server http://book.cakephp.org/2.0/en/installation/advanced-installation.html PW On 11 Nov 2012, at 02:41, April april.deross...@gmail.com wrote: This is kicking my butt...I have migrated my application from my localhost to my server. I modified the database config and the application seems to be hitting the database correctly and it seems that my themed layout is being used correctly...HOWEVER, the themed css is not being utilized. I can't seem to figure it out... Here are my settings: class AppController extends Controller { public $view = 'Theme'; public $theme = 'default'; } In my controller: $this-layout = 'onecolumn'; In my view: ?php echo $this-Html-css('default'); ? !--[if IE 6] ?php echo $this-Html-css('default_ie6'); ? ![endif]-- My routes.php seems to be working since the URL is pulling up the correct layout and the database is populating the data...But the style and images are just not working. What am I doing wrong? How is it possible that the layout would be pulled correctly but the .css and img would not? Any help is much appreciated! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Routing
Hi I'm on CakePHP 2.2.x and I've built all my site links in the format... $this-Html-link( 'Contact', array('controller' = 'pages', 'action' = 'contact')); …which generates URLs like http://www.example.com/pages/contact and everything works. ie: /pages/contact shows my contact page. I've then added the line… Router::connect('/*', array('controller' = 'pages', 'action' = 'display')); …as the last rule in my routes file and so now I can use a URL like http://www.example.com/contact (without the /pages bit) and still get my contact page. All great so far. What I would like to do now is somehow set my links to generate the shortened URLs so $this-Html-link( 'Contact', array('controller' = 'pages', 'action' = 'contact')); generates a URL http://www.example.com/contact rather than http://www.example.com/pages/contact Is this possible? I'm struggling to find a way to do it. If it is can someone point me to an example? Regards PW -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Having trouble with /cake/app and htaccess
Most likely, if it was needed on the first one it will be needed on the other two… https://groups.google.com/d/topic/cake-php/el54U5xqnGc/discussion PW On 6 Nov 2012, at 16:03, heohni heidi.anselstet...@consultingteam.de wrote: Well, I need to add the RewriteBase / into my first htaccess. Now I see the homepage and all my date perfectly. But when I hit any link to pages like http://myproject.com/pages/imprint or http://myproject.com/objekts/search/q:Agrofinca I get again a error 500. Do I need to add the RewriteBase into the htaccess in /cake/app or /cake/app/ ? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: cakephp app as part of static site
Hi There's nothing particularly clever needs doing for this. I did exactly the same thing recently where we built a mini site to sit in a sub folder of the customer's existing site. The only 'issue' I had was I had to edit the standard .htaccess files slightly to set the RewriteBase path properly (which I got help from on this list) you might not even need to do this but what I ended up with was.. mysite.com/webapp/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /webapp RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule mysite.com/webapp/app/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /webapp/app/ RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule mysite.com/webapp/app/webroot/.htaccess IfModule mod_rewrite.c RewriteEngine On RewriteBase /webapp/app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule Cheers Paul On 23 Oct 2012, at 23:25, sso raja...@gmail.com wrote: Hi, I have kind of an unique situation. I have developed a cakephp app and need to deploy it to a shared server with content. I know generally we are supposed to have static content in webroot, but am not allowed to do so, as this application needs to be removed later on. its a shared hosting and i can't change DocumentRoot or any admin related settings. I can however add .htacces files. I have my files in the following order: /webapp /app /lib ... /webroot I guess you get the point. I was planning to deploy the entire 'webapp' folder along with the static site and have the login link so the people can come to the site as http://mysite.com/webapp/users/login. Unfortunately I do not know the correct way to do this. I hope to preserve the directory structure as-is so that someone coming after me can easily modify and delete it. Any help is appreciated. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Strange array when moved from test to live server.
I could be barking up the wrong tree but I recall something similar before, check your PHP and CakePHP versions on your XAMP and live servers. PW On 17 Oct 2012, at 15:04, PlanoCoder la...@lancebarron.com wrote: Good morning all I build a site on XAMP local server. There was no problem when testing. When i Uploaded the files to the live verio server my code no longer works. here is what i am talking about in my view file my code on the test server looks like this $key['Member']['username']; when i moved to the live server i have to change the code to $key[0]['username']; for cake to pull the data. Any idea why this is? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: html attributes on 'year' form helper
Thanks for the confirmation/suggestions I've used... echo $this-Form-input( 'published', array( 'type' = 'date', 'dateFormat' = 'Y', 'minYear' = date('Y'), 'maxYear' = date('Y') - 20, ) ); Cheers again for the tips Paul On 4 Oct 2012, at 10:08, euromark dereurom...@gmail.com wrote: use Form-input() and type=date + dateFormat=Y Am Donnerstag, 4. Oktober 2012 09:51:31 UTC+2 schrieb Mike Griffin: It seems that the year helper doesn't support html attributes. Looking at the API (http://api.cakephp.org/class/form-helper#method-FormHelperyear), it only accepts a small subset of the options that other form helper functions support. I guess this is because it returns a SELECT element and they normally join in with other elements. It looks like you will have to manually add the div and label around the year helper. Mike. On Thu, Oct 4, 2012 at 12:06 AM, Paul Willis paul@me.com wrote: Despite having read over the relevant sections of the book I can't seem to get the div stuff working properly with $this-Form-year form helper in 2.2.2 Any other standard input select like... echo $this-Form-input( 'category', array( 'type' = 'select', 'options' = $category, ) ); Produces HTML like this... div class=input select label for=ReportCategoryCategory/label select name=data[Report][category] id=ReportCategory option value=1Category1/option option value=2Category2/option /select /div I want to do the same with a 'year' select but the standard tag... echo $this-Form-year( 'published', 1990, date('Y'), array( 'empty' = false, ) ); …produces HTML without a label or div… select name=data[Report][published][year] id=ReportPublishedYear option value=20122012/option option value=20112011/option option value=20102010/option …etc… option value=19901990/option /select I've tried (along with other variations)... echo $this-Form-year( 'published', 1990, date('Y'), array( 'empty' = false, 'label' = 'Published', 'div' = array( 'class' = 'input select', 'id' = 'published', ) ) ); But I get a weird result… select name=data[Report][published][year] label=Published id=published div=input select option value=20122012/option option value=20112011/option option value=20102010/option …etc… option value=19901990/option /select I'm assuming I'm just getting the syntax messed up but can the 'year' form helper accept html attributes? Anyone see what I'm doing wrong here? Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake...@googlegroups.com. To unsubscribe from this group, send email to cake-php+u...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
html attributes on 'year' form helper
Despite having read over the relevant sections of the book I can't seem to get the div stuff working properly with $this-Form-year form helper in 2.2.2 Any other standard input select like... echo $this-Form-input( 'category', array( 'type' = 'select', 'options' = $category, ) ); Produces HTML like this... div class=input select label for=ReportCategoryCategory/label select name=data[Report][category] id=ReportCategory option value=1Category1/option option value=2Category2/option /select /div I want to do the same with a 'year' select but the standard tag... echo $this-Form-year( 'published', 1990, date('Y'), array( 'empty' = false, ) ); …produces HTML without a label or div… select name=data[Report][published][year] id=ReportPublishedYear option value=20122012/option option value=20112011/option option value=20102010/option …etc… option value=19901990/option /select I've tried (along with other variations)... echo $this-Form-year( 'published', 1990, date('Y'), array( 'empty' = false, 'label' = 'Published', 'div' = array( 'class' = 'input select', 'id' = 'published', ) ) ); But I get a weird result… select name=data[Report][published][year] label=Published id=published div=input select option value=20122012/option option value=20112011/option option value=20102010/option …etc… option value=19901990/option /select I'm assuming I'm just getting the syntax messed up but can the 'year' form helper accept html attributes? Anyone see what I'm doing wrong here? Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
CakePHP 2.2.2 and DebugKit don't play nice
I created a CakePHP 2.2.2 app. I did the basic installation steps, security salt, /tmp permissions etc. All the green bars on the home page. I added a MySQL database with a Reports table... CREATE TABLE `reports` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; I then baked a model, controller and views for the Reports table. Everything works fine as you would expect, I can add, edit and delete records. In the command line I cd into my app/Plugin and run... git clone -b master git://github.com/cakephp/debug_kit.git DebugKit As per the instructions I add CakePlugin::load('DebugKit'); To app/Config/bootstrap.php and add public $components = array('DebugKit.Toolbar'); to AppController.php. I refresh my page and I see the DebugKit tab. It works fine. However as soon as I add/edit or delete a record I get a Fatal error although the add/edit is saved to the database. For instance on edit as soon as I submit I see… Fatal Error Error: Call to a member function setFlash() on a non-object File: /Library/WebServer/Documents/MySites/debugtest/app/Controller/ReportsController.php Line: 66 Looking at line 66 in ReportsController I see the baked setFlash message line… $this-Session-setFlash(__('The report has been saved')); If I comment out the line then my app works fine again (obviously without the flash messages) If I leave the setFlash uncommented but comment out public $components = array('DebugKit.Toolbar'); from AppController.php (ie: turn off DebigKit) my app works fine. I've tried this setup twice now, with clean installs and setting up and it happened both times. When the error shows I looked in DebugKit and under the 'Request' tab 'Current Route' has a warning… Invalid argument supplied for foreach() [APP/Plugin/DebugKit/View/Helper/HtmlToolbarHelper.php, line 68] If I click the code button I see… $values[] = '(empty)'; } foreach ($values as $key = $value) { Where foreach ($values as $key = $value) { is line 68 in HtmlToolbarHelper.php The context button shows… $values = '(object)CakeRoute' $openDepth = (int) 0 $currentDepth = (int) 0 $doubleEncode = false $className = 'neat-array depth-0' $nextDepth = (int) 1 $out = 'ul class=neat-array depth-0' Has anyone got any ideas what is going on here? Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: CakePHP 2.2.2 and DebugKit don't play nice
Okay that fixed it. Thanks. Wasted a good bit of time on that :-( Paul On 2 Oct 2012, at 23:46, Andras Kende and...@kende.com wrote: Add Session to components in app controller Andras Kende 818-851-1177 and...@kende.com http://www.kende.com On Oct 2, 2012, at 13:57, Paul Willis paul.wil...@me.com wrote: I created a CakePHP 2.2.2 app. I did the basic installation steps, security salt, /tmp permissions etc. All the green bars on the home page. I added a MySQL database with a Reports table... CREATE TABLE `reports` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; I then baked a model, controller and views for the Reports table. Everything works fine as you would expect, I can add, edit and delete records. In the command line I cd into my app/Plugin and run... git clone -b master git://github.com/cakephp/debug_kit.git DebugKit As per the instructions I add CakePlugin::load('DebugKit'); To app/Config/bootstrap.php and add public $components = array('DebugKit.Toolbar'); to AppController.php. I refresh my page and I see the DebugKit tab. It works fine. However as soon as I add/edit or delete a record I get a Fatal error although the add/edit is saved to the database. For instance on edit as soon as I submit I see… Fatal Error Error: Call to a member function setFlash() on a non-object File: /Library/WebServer/Documents/MySites/debugtest/app/Controller/ReportsController.php Line: 66 Looking at line 66 in ReportsController I see the baked setFlash message line… $this-Session-setFlash(__('The report has been saved')); If I comment out the line then my app works fine again (obviously without the flash messages) If I leave the setFlash uncommented but comment out public $components = array('DebugKit.Toolbar'); from AppController.php (ie: turn off DebigKit) my app works fine. I've tried this setup twice now, with clean installs and setting up and it happened both times. When the error shows I looked in DebugKit and under the 'Request' tab 'Current Route' has a warning… Invalid argument supplied for foreach() [APP/Plugin/DebugKit/View/Helper/HtmlToolbarHelper.php, line 68] If I click the code button I see… $values[] = '(empty)'; } foreach ($values as $key = $value) { Where foreach ($values as $key = $value) { is line 68 in HtmlToolbarHelper.php The context button shows… $values = '(object)CakeRoute' $openDepth = (int) 0 $currentDepth = (int) 0 $doubleEncode = false $className = 'neat-array depth-0' $nextDepth = (int) 1 $out = 'ul class=neat-array depth-0' Has anyone got any ideas what is going on here? Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Is this a mod_rewrite issue?
Hi I can't get a brand new CakePHP installation working on a customer's server. The details of what is going on are below, including everything I've tried, but my conclusion is that it is probably something as simple as AllowOverride isn't set to 'all'. The guys who run the server only take instructions from the customer via a ticket system (fair enough) so it is a slow operation to get changes made or details of configs out of them etc. I'd like to have some facts to approach them with rather than go fishing. Is there something I can do to test this? The details…. We are creating a mini site within a subfolder on a customer's Apache/2.2.16 server. Their main website runs on... domain.com/ We have been given access to a subfolder... domain.com/oursite/ I dropped a basic phpinfo() index.php into the subfolder, surfed in and it displays fine. PHP 5.3.3 is installed and processes the page. phpinfo() suggests that the actual path to our folder is… /var/www/oursite I then dropped a cake php installation into the subfolder all contained in a directory called 'caketest'. This is basically an unstuffed download of CakePHP 2.2.2 but when I go in my browser to... domain.com/oursite/caketest/ I get the main website's 'page not found' If I go to... domain.com/oursite/caketest/app/webroot/ I see a Cake error page (with no CSS)… Missing Method in AppController Error: The action webroot is not defined in controller AppController Following the advanced installation suggestions on http://book.cakephp.org/2.0/en/installation/advanced-installation.html I've tried uncommenting the line… define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); ..in app/webroot/index.php I've tried defining the paths manually in app/webroot/index.php… define('ROOT', DS . 'var' . DS . 'www' . DS . 'oursite'); define('APP_DIR', 'caketest'); define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . 'oursite' . DS . 'caketest' . DS . 'lib'); I've tried adding… RewriteBase /var/www/oursite/caketest ...to each of the three .htaccess files with no change in the results. Nothing makes any difference to my results so any suggestions gratefully received Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Typo in the footer of these messages
I'm not sure who the admin is for this group but I just noticed that there's a typo: FacekBook just below in the auto added footer to messages to this group VVV -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Hello i need help in database schema ready
I agree knowing what the dataset is for might help with the answer. I don't know but I would have thought Units of Measurement are set per Country rather than by City? Paul On 27 Sep 2012, at 16:44, Jonathan Sundquist jsundqu...@gmail.com wrote: I guess I question what you would like this data set for. Looking at this from a large scale of the United States I know there are a number of city names that are duplicated across multiple states. Now I don't know if this is the same across the rest of the world but you may need to rethink what you are looking to implement. You may need to set up your relational table from countries to states/province to cities. Also a quick search of Google reveals this page. http://www.maxmind.com/app/worldcities which can be found on this thread http://forums.overclockers.com.au/showthread.php?t=899135 . On Thu, Sep 27, 2012 at 10:36 AM, Peter Nassef peter.nas...@gmail.com wrote: i need three table .sql content First: All Countries Secound: All Cities Related to Countries Third :Units Measurement On Thu, Sep 27, 2012 at 5:08 PM, Maliko V malikovinc...@gmail.com wrote: Can you elaborate what do you need exactly? Us to show you how u create this schema or model using bake ? VM Sent from iPhone smartphone On 2012-09-27, at 11:02 AM, Peter Nassef peter.nas...@gmail.com wrote: Hello cakephp member i need table content all country and all cities relate to this countries and other table content units measurement and Thanks :) -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- __ Peter Nassef Mob.:+2 0122 561 6354 E-mail: peter.nas...@gmail.com Web Designer, Developer: XHTML, CSS, jQuary, Ajax, JavaScript, PHP MySql -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Is this a mod_rewrite issue?
I tried editing my .htaccess in domain.com/oursite/caketest/ but it made no difference. Are your other two .htaccess files set to the default without RewriteBase being set? Paul On 27 Sep 2012, at 16:38, Ivan Rimac ivn...@gmail.com wrote: I had similar issue. You can try enter this into app/.htaccess file IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule And check if there is on your Auth component allowed to display home page. Hope this helps, Cheers 2012/9/27 Paul Willis paul.wil...@me.com Hi I can't get a brand new CakePHP installation working on a customer's server. The details of what is going on are below, including everything I've tried, but my conclusion is that it is probably something as simple as AllowOverride isn't set to 'all'. The guys who run the server only take instructions from the customer via a ticket system (fair enough) so it is a slow operation to get changes made or details of configs out of them etc. I'd like to have some facts to approach them with rather than go fishing. Is there something I can do to test this? The details…. We are creating a mini site within a subfolder on a customer's Apache/2.2.16 server. Their main website runs on... domain.com/ We have been given access to a subfolder... domain.com/oursite/ I dropped a basic phpinfo() index.php into the subfolder, surfed in and it displays fine. PHP 5.3.3 is installed and processes the page. phpinfo() suggests that the actual path to our folder is… /var/www/oursite I then dropped a cake php installation into the subfolder all contained in a directory called 'caketest'. This is basically an unstuffed download of CakePHP 2.2.2 but when I go in my browser to... domain.com/oursite/caketest/ If I go to... domain.com/oursite/caketest/app/webroot/ I see a Cake error page (with no CSS)… Missing Method in AppController Error: The action webroot is not defined in controller AppController Following the advanced installation suggestions on http://book.cakephp.org/2.0/en/installation/advanced-installation.html I've tried uncommenting the line… define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); ..in app/webroot/index.php I've tried defining the paths manually in app/webroot/index.php… define('ROOT', DS . 'var' . DS . 'www' . DS . 'oursite'); define('APP_DIR', 'caketest'); define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . 'oursite' . DS . 'caketest' . DS . 'lib'); I've tried adding… RewriteBase /var/www/oursite/caketest ...to each of the three .htaccess files with no change in the results. Nothing makes any difference to my results so any suggestions gratefully received Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Ivan Rimac mail: ivn...@gmail.com tel: +385 95 555 99 66 http://ivanrimac.com -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: Is this a mod_rewrite issue?
Okay, thanks for that. Unfortunately it doesn't fix my issue. Your setup is slightly different as you have your domain pointing to the root folder of your cake folder. That is usually how I have mine set up when I am controlling the server. However in this case on someone else's server I'm in a sub folder but it is accessed by users via the full path like this… domain.com/oursite/caketest I've decided to take the long route and put in a request to the customer to ask the webhost for full details of the setup, what AllowOverride is set to and hopefully a copy of the apache conf file so I can see what exactly is going on. Cheers Paul On 27 Sep 2012, at 17:02, Ivan Rimac ivn...@gmail.com wrote: Okay, this is my structure: domain.com/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule domain.com/app/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /app/ RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule domain.com/app/webroot/.htaccess IfModule mod_rewrite.c RewriteEngine On RewriteBase /app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule And it works fine for me. I have another site running cakephp as subdomain like sub.domain.com and it points to domain.com/subdomainfolder, where i cakephp app. There I have exactly the sam structure of .htaccess files, and it works with no problems. 2012/9/27 Paul Willis paul.wil...@me.com I tried editing my .htaccess in domain.com/oursite/caketest/ but it made no difference. Are your other two .htaccess files set to the default without RewriteBase being set? Paul On 27 Sep 2012, at 16:38, Ivan Rimac ivn...@gmail.com wrote: I had similar issue. You can try enter this into app/.htaccess file IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule And check if there is on your Auth component allowed to display home page. Hope this helps, Cheers 2012/9/27 Paul Willis paul.wil...@me.com Hi I can't get a brand new CakePHP installation working on a customer's server. The details of what is going on are below, including everything I've tried, but my conclusion is that it is probably something as simple as AllowOverride isn't set to 'all'. The guys who run the server only take instructions from the customer via a ticket system (fair enough) so it is a slow operation to get changes made or details of configs out of them etc. I'd like to have some facts to approach them with rather than go fishing. Is there something I can do to test this? The details…. We are creating a mini site within a subfolder on a customer's Apache/2.2.16 server. Their main website runs on... domain.com/ We have been given access to a subfolder... domain.com/oursite/ I dropped a basic phpinfo() index.php into the subfolder, surfed in and it displays fine. PHP 5.3.3 is installed and processes the page. phpinfo() suggests that the actual path to our folder is… /var/www/oursite I then dropped a cake php installation into the subfolder all contained in a directory called 'caketest'. This is basically an unstuffed download of CakePHP 2.2.2 but when I go in my browser to... domain.com/oursite/caketest/ If I go to... domain.com/oursite/caketest/app/webroot/ I see a Cake error page (with no CSS)… Missing Method in AppController Error: The action webroot is not defined in controller AppController Following the advanced installation suggestions on http://book.cakephp.org/2.0/en/installation/advanced-installation.html I've tried uncommenting the line… define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); ..in app/webroot/index.php I've tried defining the paths manually in app/webroot/index.php… define('ROOT', DS . 'var' . DS . 'www' . DS . 'oursite'); define('APP_DIR', 'caketest'); define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . 'oursite' . DS . 'caketest' . DS . 'lib'); I've tried adding… RewriteBase /var/www/oursite/caketest ...to each of the three .htaccess files with no change in the results. Nothing makes any difference to my results so any suggestions gratefully received Cheers Paul -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email
Re: Is this a mod_rewrite issue?
Unfortunately the quick tests in the link you provided require access to the server root (even if your site is in a subfolder), but I only have access to my subdirectory (and anything within that). I'll chase the web hosts now. However the quick test will be useful once they set AllowOverride to 'All' (assuming that is the problem) as it will help eliminate any issues with my Cake setup so thanks again. Paul On 27 Sep 2012, at 17:35, Ivan Rimac ivn...@gmail.com wrote: I think it is rewriting problem, try something like this: http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server If it is not, there's your problem :-) and if it is on, then you should google around for setting up .htaccess files and in what way to modify them. 2012/9/27 Paul Willis paul.wil...@me.com Okay, thanks for that. Unfortunately it doesn't fix my issue. Your setup is slightly different as you have your domain pointing to the root folder of your cake folder. That is usually how I have mine set up when I am controlling the server. However in this case on someone else's server I'm in a sub folder but it is accessed by users via the full path like this… domain.com/oursite/caketest I've decided to take the long route and put in a request to the customer to ask the webhost for full details of the setup, what AllowOverride is set to and hopefully a copy of the apache conf file so I can see what exactly is going on. Cheers Paul On 27 Sep 2012, at 17:02, Ivan Rimac ivn...@gmail.com wrote: Okay, this is my structure: domain.com/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule domain.com/app/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /app/ RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule domain.com/app/webroot/.htaccess IfModule mod_rewrite.c RewriteEngine On RewriteBase /app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule And it works fine for me. I have another site running cakephp as subdomain like sub.domain.com and it points to domain.com/subdomainfolder, where i cakephp app. There I have exactly the sam structure of .htaccess files, and it works with no problems. 2012/9/27 Paul Willis paul.wil...@me.com I tried editing my .htaccess in domain.com/oursite/caketest/ but it made no difference. Are your other two .htaccess files set to the default without RewriteBase being set? Paul On 27 Sep 2012, at 16:38, Ivan Rimac ivn...@gmail.com wrote: I had similar issue. You can try enter this into app/.htaccess file IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule And check if there is on your Auth component allowed to display home page. Hope this helps, Cheers 2012/9/27 Paul Willis paul.wil...@me.com Hi I can't get a brand new CakePHP installation working on a customer's server. The details of what is going on are below, including everything I've tried, but my conclusion is that it is probably something as simple as AllowOverride isn't set to 'all'. The guys who run the server only take instructions from the customer via a ticket system (fair enough) so it is a slow operation to get changes made or details of configs out of them etc. I'd like to have some facts to approach them with rather than go fishing. Is there something I can do to test this? The details…. We are creating a mini site within a subfolder on a customer's Apache/2.2.16 server. Their main website runs on... domain.com/ We have been given access to a subfolder... domain.com/oursite/ I dropped a basic phpinfo() index.php into the subfolder, surfed in and it displays fine. PHP 5.3.3 is installed and processes the page. phpinfo() suggests that the actual path to our folder is… /var/www/oursite I then dropped a cake php installation into the subfolder all contained in a directory called 'caketest'. This is basically an unstuffed download of CakePHP 2.2.2 but when I go in my browser to... domain.com/oursite/caketest/ If I go to... domain.com/oursite/caketest/app/webroot/ I see a Cake error page (with no CSS)… Missing Method in AppController Error: The action webroot is not defined in controller AppController Following the advanced installation suggestions on http://book.cakephp.org/2.0/en/installation/advanced-installation.html I've tried uncommenting the line… define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib'); ..in app/webroot/index.php I've tried defining
Re: Is this a mod_rewrite issue?
Okay scrap that. I realised I was making a mistake with my test. I tried again and got redirected to the external site as per my .htaccess rule so I guess AllowOverride must be set to All? So it does look like I need to figure out the issue in my .htaccess files for Cake Paul On 27 Sep 2012, at 17:55, Paul Willis paul.wil...@me.com wrote: Unfortunately the quick tests in the link you provided require access to the server root (even if your site is in a subfolder), but I only have access to my subdirectory (and anything within that). I'll chase the web hosts now. However the quick test will be useful once they set AllowOverride to 'All' (assuming that is the problem) as it will help eliminate any issues with my Cake setup so thanks again. Paul On 27 Sep 2012, at 17:35, Ivan Rimac ivn...@gmail.com wrote: I think it is rewriting problem, try something like this: http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server If it is not, there's your problem :-) and if it is on, then you should google around for setting up .htaccess files and in what way to modify them. 2012/9/27 Paul Willis paul.wil...@me.com Okay, thanks for that. Unfortunately it doesn't fix my issue. Your setup is slightly different as you have your domain pointing to the root folder of your cake folder. That is usually how I have mine set up when I am controlling the server. However in this case on someone else's server I'm in a sub folder but it is accessed by users via the full path like this… domain.com/oursite/caketest I've decided to take the long route and put in a request to the customer to ask the webhost for full details of the setup, what AllowOverride is set to and hopefully a copy of the apache conf file so I can see what exactly is going on. Cheers Paul On 27 Sep 2012, at 17:02, Ivan Rimac ivn...@gmail.com wrote: Okay, this is my structure: domain.com/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule domain.com/app/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /app/ RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule domain.com/app/webroot/.htaccess IfModule mod_rewrite.c RewriteEngine On RewriteBase /app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule And it works fine for me. I have another site running cakephp as subdomain like sub.domain.com and it points to domain.com/subdomainfolder, where i cakephp app. There I have exactly the sam structure of .htaccess files, and it works with no problems. 2012/9/27 Paul Willis paul.wil...@me.com I tried editing my .htaccess in domain.com/oursite/caketest/ but it made no difference. Are your other two .htaccess files set to the default without RewriteBase being set? Paul On 27 Sep 2012, at 16:38, Ivan Rimac ivn...@gmail.com wrote: I had similar issue. You can try enter this into app/.htaccess file IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule And check if there is on your Auth component allowed to display home page. Hope this helps, Cheers 2012/9/27 Paul Willis paul.wil...@me.com Hi I can't get a brand new CakePHP installation working on a customer's server. The details of what is going on are below, including everything I've tried, but my conclusion is that it is probably something as simple as AllowOverride isn't set to 'all'. The guys who run the server only take instructions from the customer via a ticket system (fair enough) so it is a slow operation to get changes made or details of configs out of them etc. I'd like to have some facts to approach them with rather than go fishing. Is there something I can do to test this? The details…. We are creating a mini site within a subfolder on a customer's Apache/2.2.16 server. Their main website runs on... domain.com/ We have been given access to a subfolder... domain.com/oursite/ I dropped a basic phpinfo() index.php into the subfolder, surfed in and it displays fine. PHP 5.3.3 is installed and processes the page. phpinfo() suggests that the actual path to our folder is… /var/www/oursite I then dropped a cake php installation into the subfolder all contained in a directory called 'caketest'. This is basically an unstuffed download of CakePHP 2.2.2 but when I go in my browser to... domain.com/oursite/caketest/ If I go to... domain.com/oursite/caketest/app/webroot/ I see a Cake error page (with no CSS)… Missing Method in AppController Error: The action webroot is not defined in controller
Re: Is this a mod_rewrite issue?
Success! It was indeed a matter of setting the RewriteBase path properly. I'm now seeing my default CakePHP page with CSS. This is what I ended up with... domain.com/oursite/caketest/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /oursite/caketest RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule domain.com/oursite/caketest/app/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /oursite/caketest/app/ RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule domain.com/oursite/caketest/app/webroot/.htaccess IfModule mod_rewrite.c RewriteEngine On RewriteBase /oursite/caketest/app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule Thanks again to Ivan for pointing me in the right direction Paul On 27 Sep 2012, at 18:02, Paul Willis paul.wil...@me.com wrote: Okay scrap that. I realised I was making a mistake with my test. I tried again and got redirected to the external site as per my .htaccess rule so I guess AllowOverride must be set to All? So it does look like I need to figure out the issue in my .htaccess files for Cake Paul On 27 Sep 2012, at 17:55, Paul Willis paul.wil...@me.com wrote: Unfortunately the quick tests in the link you provided require access to the server root (even if your site is in a subfolder), but I only have access to my subdirectory (and anything within that). I'll chase the web hosts now. However the quick test will be useful once they set AllowOverride to 'All' (assuming that is the problem) as it will help eliminate any issues with my Cake setup so thanks again. Paul On 27 Sep 2012, at 17:35, Ivan Rimac ivn...@gmail.com wrote: I think it is rewriting problem, try something like this: http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server If it is not, there's your problem :-) and if it is on, then you should google around for setting up .htaccess files and in what way to modify them. 2012/9/27 Paul Willis paul.wil...@me.com Okay, thanks for that. Unfortunately it doesn't fix my issue. Your setup is slightly different as you have your domain pointing to the root folder of your cake folder. That is usually how I have mine set up when I am controlling the server. However in this case on someone else's server I'm in a sub folder but it is accessed by users via the full path like this… domain.com/oursite/caketest I've decided to take the long route and put in a request to the customer to ask the webhost for full details of the setup, what AllowOverride is set to and hopefully a copy of the apache conf file so I can see what exactly is going on. Cheers Paul On 27 Sep 2012, at 17:02, Ivan Rimac ivn...@gmail.com wrote: Okay, this is my structure: domain.com/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule domain.com/app/.htaccess IfModule mod_rewrite.c RewriteEngine on RewriteBase /app/ RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] /IfModule domain.com/app/webroot/.htaccess IfModule mod_rewrite.c RewriteEngine On RewriteBase /app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule And it works fine for me. I have another site running cakephp as subdomain like sub.domain.com and it points to domain.com/subdomainfolder, where i cakephp app. There I have exactly the sam structure of .htaccess files, and it works with no problems. 2012/9/27 Paul Willis paul.wil...@me.com I tried editing my .htaccess in domain.com/oursite/caketest/ but it made no difference. Are your other two .htaccess files set to the default without RewriteBase being set? Paul On 27 Sep 2012, at 16:38, Ivan Rimac ivn...@gmail.com wrote: I had similar issue. You can try enter this into app/.htaccess file IfModule mod_rewrite.c RewriteEngine on RewriteBase / RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] /IfModule And check if there is on your Auth component allowed to display home page. Hope this helps, Cheers 2012/9/27 Paul Willis paul.wil...@me.com Hi I can't get a brand new CakePHP installation working on a customer's server. The details of what is going on are below, including everything I've tried, but my conclusion is that it is probably something as simple as AllowOverride isn't set to 'all'. The guys who run the server only take instructions from the customer via a ticket system (fair enough) so it is a slow operation to get changes made or details of configs out of them etc. I'd like to have some facts to approach them
Re: Problem with paths to files
As for troubleshooting ideas just look at the source of your resulting page. What is the path to the image that the browser is being given? How does that match to where you have your actual image stored? PW On 25 Sep 2012, at 09:16, Ivan Rimac ivn...@gmail.com wrote: Yes, put it in the webroot, img folder or anywhere else in the webroot, and before displaying sometimes you need to empty the cache from your browser to display it instantly. 2012/9/25 Maliko V malikovinc...@gmail.com Hello, the way I did it was to create the img folder in the app/webroot folder. Then regardless of where you insert the image i call the image using the img tag like this img src=/img/name_of_the_file / or you can use the image function by doing this : ?php echo $this-Html-image('name_of_the_file'); ? . Just make sure that your image is stored in app/webroot/img/ Hope this helps VM Sent from iPhone smartphone On 2012-09-24, at 2:16 PM, ShipSank sitc...@yahoo.com wrote: I am having a similar problem. I just created the '/img' folder but no matter what I put for the path in the view file (index.ctp), I cannot get the images to display. They just come out blank (and show the 'alt' text instead). Super frustrating! :) Any ideas? -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en.
Re: pass parametrs
http://book.cakephp.org/2.0/en/controllers.html#Controller::set Paul On 29 Aug 2012, at 19:59, Nareh Tarasyan narehtaras...@gmail.com wrote: How do you pass parameters from controlller to view? For example: echo a href=\magic.php?code=.$code.var=.$i.dif=.$dif.\ .$i. ./a; How to do it in cake? -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
Re: Missing Controller
This sounds more like a server config error than a cake problem. Have you checked you config for https is the same as the working http one (apart from the port obviously) PW On 5 Jul 2012, at 04:52, Luke wrote: Hi everyone, I'm new to cake. I've installed Cake into a subdirectory (http://server.com/my-admin/), and it's all working well! However, when I access the site via https instead of http I get an error: Missing Controller Error: My-adminController could not be found. Error: Create the class My-adminController below in file: app/Controller/My-adminController.php Any hints on how I can get the site to work under http AND https? Thanks, Luke -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't Connect to Database (CakePHP 1.3 - 2.1.3 Migration)
Hi I would suggest that your version of Microsoft SQL Server is too old. From the database.php default files... 1.3.15 * mssql - Microsoft SQL Server 2000 and higher, 2.1.3 * Database/Sqlserver - Microsoft SQL Server 2005 and higher Cheers Paul On 27 Jun 2012, at 19:26, Miles G wrote: Thanks for pointing that out cricket; however, I am still getting the same error message after fixing that. On Wednesday, June 27, 2012 11:15:16 AM UTC-5, cricket wrote: You have the port value as a string. Try removing the quotes. On Wed, Jun 27, 2012 at 10:23 AM, Miles G miles.g...@gmail.com wrote: Hi, I'm trying to figure out what possible problem could be causing me not to connect to my db on the 2.1.3 version. I connect just fine on the 1.3 version and the only big changes I notice in the database.php file is the difference of 'host' = 'mssql' in the 1.3 version compared to 'datasource' = in the 2.1.3 version. Here is a pastie.org link to get more info and see what happens for me as well as my database.php file for the different versions. http://pastie.org/4154510 Just to clarify, the new version was a fresh download where the only changes I made were the hashing security part in the core file and then modifying database.php. The database is on a separate computer using Microsoft SQL Server 2003 (on Windows 2003) and the OS where the project is stored is also on another computer with Windows 2003. There are 0 problems with connecting to the database on the 1.3 version just to say one more time! Let me know if you see something that could be causing this or if you need more information ! Thanks, Miles -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't Connect to Database (CakePHP 1.3 - 2.1.3 Migration)
Okay, just you said earlier The database is on a separate computer using Microsoft SQL Server 2003 (on Windows 2003) On 28 Jun 2012, at 15:08, Miles G wrote: My Microsoft SQL server is currently the 2005 version, but then again I wouldn't be surprised if that's too old as well? On Thursday, June 28, 2012 4:35:01 AM UTC-5, PaulW wrote: Hi I would suggest that your version of Microsoft SQL Server is too old. From the database.php default files... 1.3.15 *mssql - Microsoft SQL Server 2000 and higher, 2.1.3 *Database/Sqlserver - Microsoft SQL Server 2005 and higher Cheers Paul On 27 Jun 2012, at 19:26, Miles G wrote: Thanks for pointing that out cricket; however, I am still getting the same error message after fixing that. On Wednesday, June 27, 2012 11:15:16 AM UTC-5, cricket wrote: You have the port value as a string. Try removing the quotes. On Wed, Jun 27, 2012 at 10:23 AM, Miles G miles.g...@gmail.com wrote: Hi, I'm trying to figure out what possible problem could be causing me not to connect to my db on the 2.1.3 version. I connect just fine on the 1.3 version and the only big changes I notice in the database.php file is the difference of 'host' = 'mssql' in the 1.3 version compared to 'datasource' = in the 2.1.3 version. Here is a pastie.org link to get more info and see what happens for me as well as my database.php file for the different versions. http://pastie.org/4154510 Just to clarify, the new version was a fresh download where the only changes I made were the hashing security part in the core file and then modifying database.php. The database is on a separate computer using Microsoft SQL Server 2003 (on Windows 2003) and the OS where the project is stored is also on another computer with Windows 2003. There are 0 problems with connecting to the database on the 1.3 version just to say one more time! Let me know if you see something that could be causing this or if you need more information ! Thanks, Miles -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: mod_rewrite directive in http.conf
Yes I reloaded Apache, I actually rebooted the machine to be sure. I did a bit of experimenting with various setups. To eliminate anything I might have messed up I created a site from brand new CakePHP 2.1.3 install. The only changes I made were the standard things, change the Security.salt Security.cipherSeed in core.php and permissions on the app/tmp/ folder to fix the errors mentioned on the default install home page. I added a virtual host config for the site to apache... Directory /path/to/serverdocs/cakephp2/app/webroot/ Options All +MultiViews -ExecCGI -Indexes AllowOverride None IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,L] /IfModule /Directory I added the site to my hosts file I then rebooted the machine. I then visit my site on http://cakephp2 the default home page looks fine, the CSS is loading etc. I then duplicated app/View/Pages/home.ctp calling it tester.ctp When I visit http://cakephp2/pages/tester the page loads but the CSS doesn't and there is the message URL rewriting is not properly configured on your server Changing the rewrite rule to the old style… RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] And restarting Apache makes my tester page work (CSS loads) Setting allow override to All (rather than None) and restarting apache, my tester page works. Presumably I'm using the app/webroot/.htaccess whether I have the rewrite rule set to the new style or the old one Then I looked at app/webroot/.htaccess and see that the rewrite rule is... RewriteRule ^(.*)$ index.php [QSA,L] Which is different to the RewriteRule ^(.*)$ index.php/$1 [QSA,L] that is mentioned in http://book.cakephp.org/2.0/en/installation/advanced-installation.html#apache-and-mod-rewrite-and-htaccess Using this third option RewriteRule ^(.*)$ index.php [QSA,L] in my virtual host works fine with allow override on none… Directory /path/to/serverdocs/cakephp2/app/webroot/ Options All +MultiViews -ExecCGI -Indexes AllowOverride None IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] /IfModule /Directory Can you tell me what rewrite rule you have in your working config? Paul On 22 Jun 2012, at 01:31, lowpass wrote: Did you reload Apache? I do the same -- put the rewrite rules in a vhost.conf -- and it's working fine for me. Also, did you update index.php when you moved to 2.x? On Thu, Jun 21, 2012 at 6:13 AM, Paul Willis paul.wil...@me.com wrote: With CakePHP 1.x sites rather than use .htaccess files and associated performance hit on production machines I've always added a section to the apache virtual host config like this…. Directory /path/to/serverdocs/mysiteroot/app/webroot/ Options All +MultiViews -ExecCGI -Indexes AllowOverride None IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule /Directory Which has always worked fine. Now I am switching to 2.x I read that the .htaccess file has changed, comparing old and new the only change I see is that the rewrite rule has changed from... RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] to... RewriteRule ^(.*)$ index.php/$1 [QSA,L] …so I changed this in my virtual host config but it doesn't work - I get the classic mod_rewrite not working sign of a plain page with no CSS. The old 1.x way with index.php?url=$1 still seems to work fine with my 2.x site. So am I missing something here or should I stick with the old way? Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our
mod_rewrite directive in http.conf
With CakePHP 1.x sites rather than use .htaccess files and associated performance hit on production machines I've always added a section to the apache virtual host config like this…. Directory /path/to/serverdocs/mysiteroot/app/webroot/ Options All +MultiViews -ExecCGI -Indexes AllowOverride None IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] /IfModule /Directory Which has always worked fine. Now I am switching to 2.x I read that the .htaccess file has changed, comparing old and new the only change I see is that the rewrite rule has changed from... RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] to... RewriteRule ^(.*)$ index.php/$1 [QSA,L] …so I changed this in my virtual host config but it doesn't work - I get the classic mod_rewrite not working sign of a plain page with no CSS. The old 1.x way with index.php?url=$1 still seems to work fine with my 2.x site. So am I missing something here or should I stick with the old way? Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: how to wirte a code search users incakephp
Save the code you have posted as default.ctp in... app/views/layouts/default.ctp Replace the word HERE with the line... ?php echo $content_for_layout; ? Now when you go to… your_app.com/pages/contact …in your browser, Cake will put the content of contact.ctp into the default.ctp layout in place of ?php echo $content_for_layout; ? PW On 7 Jun 2012, at 11:24, gorgoro wicks wrote: I have no data to retrieve what i want to do is i have my default page with css and menu home about us contact product what i want is when i click on about us that the default page Layout stays the same and inside with the same css and menu to add content. example i have this as default page ?php echo $this-element('header'); ? body div id=container_wrapper div id=container_header div id=site_titleh1a href=#/a/h1/div div id=container_menu ?php echo $this-element('_menu'); ? /div !--_menu -- /div !-- end of header -- div id=container_middle /div !--- end of middle --- div id=container_main HERE div class=cleaner/div /div !-- end of main -- ?php echo $this-element('footer'); ? /div !-- end of wrapper -- /html i have create on pages folder about us.ctp contact.ctp pages and i have some content inside so then i want this view when i click about us on the menu to stay as it is BUT in container_main to have different content.The content of about us page and if i click contact the form to contact . what you write it sends to the page without the default page 2012/6/7 stork lubomir.st...@gmail.com 1. read this page http://book.cakephp.org/2.0/en/models/retrieving-your-data.html 2. be more specific -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: get some value from params
Do you mean you want to pull out the value for the _value key? $this-params['query']['_value'] On 4 Jun 2012, at 12:31, hoss7 wrote: i have cakephp 2.1.2 and when i am run: pr($this-params); i have this: akeRequest Object ( [params] = Array ( [plugin] = [controller] = subjectcats [action] = shahrlist [named] = Array ( ) [pass] = Array ( ) [isAjax] = ) [data] = Array ( ) [query] = Array ( [_id] = DocumentSubjectId [_name] = data[Document][subject_id] [_value] = 2 ) how can i get 2 ? from this result -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Hiding empty categories
I'm on CakePHP 1.3 On my products/index.ctp view I show a menu of categories and list all the products from the selected category. However I don't want to show categories where there are no products. Currently the data comes from my products_controller.php function index($id = 1) { $this-Product-recursive = 0; $this-set('currentcategory', $id); $this-set('products', $this-Product-find('all', array('conditions' = array('ProductCategory.id' = $id; $this-set('categories', $this-Product-ProductCategory-find('list', array('fields' = array('ProductCategory.id', 'ProductCategory.name'; } What is the best way to only find those categories with products? Cheers Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Hiding empty categories
On 3 Jun 2012, at 18:30, stork wrote: Add counterCache field to categories table and then use that field in find('list') conditions. http://book.cakephp.org/1.3/en/view/1033/counterCache-Cache-your-count Very quick and neat, thanks for that. I added the product_count field to my product_categories table. Then added 'counterCache' = true to my products model and... 'conditions' = array('ProductCategory.product_count ' = 0) …to my products_controller find Up and running. Paul -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
How to set the incoming $id to be the last post entered
Hi I'm on CakePHP 1.3 I have an action in my posts_controller.php that gets a list of latest posts and the data for a particular post if the $id is set... function mypage($id = null) { $this-Post-recursive = 0; $this-set('posts', $this-paginate()); $this-set('mainpost', $this-Post-read(null, $id)); } I then use this to display a column or recent posts and the main post if an $id is supplied. What I would like to do is set the incoming $id to be the last post entered if a specific $id isn't already set in the URL. ie: run this code if $id is null... $id = $this-Post-find('first', array('order' = array('Post.id DESC'))); But I'm not sure how to combine these two bits of code together in one function. Assuming that 's the right way to go about what I'm trying to achieve? PW -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Cache config in core.php
I'm looking into turning on caching for my 1.3.4 site. In the cookbook http://book.cakephp.org/view/1379/Cache-Helper-Configuration it says first uncomment and set Configure::Cache.check to true in core.php but that doesn't appear in my core.php Also while looking at core.php I noticed it's missing the closing ? php tag is this an error I should report or is this file closed somewhere else in the code? Paul Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
How to put ccs class and id tags in html helpers
Hi How do I put ccs 'class' and 'id' tags into html helpers? I have a image link like... a href=aboutimg src=want_to_know.png title=About us alt=About us width=83 height=78 //a The proper cakephp code for that would be... ?php echo $html-image('want_to_know.png', array('title' = 'About us', 'alt' = 'About us', 'width' = '83', 'height' = '78', 'url' = 'about')); ? But what about adding a css id or class tag like this... a href=aboutimg src=want_to_know.png title=About us alt=About us width=83 height=78 id=about_css //a What is the right way to do this in cake? Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---