RE: Un-related models / functions
Thanks man :) Good looking out. -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of lowpass Sent: Tuesday, December 11, 2012 3:35 PM To: cake-php@googlegroups.com Subject: Re: Un-related models / functions keep "last" On Tue, Dec 11, 2012 at 1:53 PM, Advantage+ wrote: > Running nGinx on Ubuntu. No htaccess files used on nGinx. > > In my sites-available conf: > > if (!-e $request_filename) { > rewrite ^/(.+)$ /index.php?url=$1 last; > break; > } > > So remove the ?url=$1 or ?url=$1 last ? > > Thanks, > > Dave > -Original Message- > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On > Behalf Of lowpass > Sent: Tuesday, December 11, 2012 3:09 PM > To: cake-php@googlegroups.com > Subject: Re: Un-related models / functions > > On Mon, Dec 10, 2012 at 2:50 PM, Advantage+ wrote: >> >> Forbidden >> >> Error: The requested address >> '/products/feature?url=products%2Ffeature' was not found on this server. > > Cake throws a 404 on internal errors when debug = 0. Set debug to 2 to > see what the problem is. > >> And whats with the crazy url? > > It looks like you're running 2.x with 1.x mod_rewrite rules. Update > your webserver config or .htaccess, whichever you're using. Remove the "?url=$1" > part. > > -- > 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: Un-related models / functions
keep "last" On Tue, Dec 11, 2012 at 1:53 PM, Advantage+ wrote: > Running nGinx on Ubuntu. No htaccess files used on nGinx. > > In my sites-available conf: > > if (!-e $request_filename) { > rewrite ^/(.+)$ /index.php?url=$1 last; > break; > } > > So remove the ?url=$1 or ?url=$1 last ? > > Thanks, > > Dave > -Original Message- > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf > Of lowpass > Sent: Tuesday, December 11, 2012 3:09 PM > To: cake-php@googlegroups.com > Subject: Re: Un-related models / functions > > On Mon, Dec 10, 2012 at 2:50 PM, Advantage+ wrote: >> >> Forbidden >> >> Error: The requested address >> '/products/feature?url=products%2Ffeature' was not found on this server. > > Cake throws a 404 on internal errors when debug = 0. Set debug to 2 to see > what the problem is. > >> And whats with the crazy url? > > It looks like you're running 2.x with 1.x mod_rewrite rules. Update your > webserver config or .htaccess, whichever you're using. Remove the "?url=$1" > part. > > -- > 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: Un-related models / functions
Running nGinx on Ubuntu. No htaccess files used on nGinx. In my sites-available conf: if (!-e $request_filename) { rewrite ^/(.+)$ /index.php?url=$1 last; break; } So remove the ?url=$1 or ?url=$1 last ? Thanks, Dave -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of lowpass Sent: Tuesday, December 11, 2012 3:09 PM To: cake-php@googlegroups.com Subject: Re: Un-related models / functions On Mon, Dec 10, 2012 at 2:50 PM, Advantage+ wrote: > > Forbidden > > Error: The requested address > '/products/feature?url=products%2Ffeature' was not found on this server. Cake throws a 404 on internal errors when debug = 0. Set debug to 2 to see what the problem is. > And whats with the crazy url? It looks like you're running 2.x with 1.x mod_rewrite rules. Update your webserver config or .htaccess, whichever you're using. Remove the "?url=$1" part. -- 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: Un-related models / functions
On Mon, Dec 10, 2012 at 2:50 PM, Advantage+ wrote: > > Forbidden > > Error: The requested address '/products/feature?url=products%2Ffeature' was > not found on this server. Cake throws a 404 on internal errors when debug = 0. Set debug to 2 to see what the problem is. > And whats with the crazy url? It looks like you're running 2.x with 1.x mod_rewrite rules. Update your webserver config or .htaccess, whichever you're using. Remove the "?url=$1" part. -- 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: Un-related models / functions
Ok I copied exactly as described in the book. My default layout has : element('footer_feature_product', array('cache' => '+1 hour'));?> The element is: requestAction(array('controller' => 'products' ,'action' => 'feature'));?> Html->image('footer_block_1.jpg', array('alt' => 'Featured Product'));?> Featured Product Text->truncate($product['Product']['description'],$length=100,array ()));?> read more Controller: public function feature() { if (empty($this->request->params['requested'])) { throw new ForbiddenException(); } return $this->Product->find('first', array( 'Product.featured' => 1, 'contain' => false)); } Now on the index page no issues. Click login (hover over the link => users/login) but when I click login I get directed to products/feature with error message Forbidden Error: The requested address '/products/feature?url=products%2Ffeature' was not found on this server. And whats with the crazy url? From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Piotr Beschel Sent: Monday, December 10, 2012 5:31 AM To: cake-php@googlegroups.com Subject: Re: Un-related models / functions read about Controller::requestAction(string $url, array $options) http://book.cakephp.org/2.0/en/controllers.html W dniu poniedziałek, 10 grudnia 2012 03:35:05 UTC+1 użytkownik advantage+ napisał: I have a footer which has a featured product and recent news. What is the best way to call these actions getFeatured(), and getNews() when there is no related model to use as they are permanent "blocks" in the footer in default.ctp layout? Thanks, Dave -- 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: Un-related models / functions
read about Controller::requestAction(*string $url*, *array $options*) http://book.cakephp.org/2.0/en/controllers.html W dniu poniedziałek, 10 grudnia 2012 03:35:05 UTC+1 użytkownik advantage+ napisał: > > I have a footer which has a featured product and recent news. > > What is the best way to call these actions getFeatured(), and getNews() > when there is no related model to use as they are permanent "blocks" in the > footer in default.ctp layout? > > > > Thanks, > > Dave > -- 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.