Re: CakePHP plugin with static pages (PagesController in Plugin)
I know this is quite old, but I'm facing the same issue and google results brought me here.. So, which one could you say is the most suitable solution?.. the most conventional as you pointed or A? El sábado, 16 de marzo de 2013, 14:53:53 (UTC-3), Vanja Dizdarević escribió: > > See the title of the post? I went nearly mad searching for it!! So I made > it SEO friendly for any brothers-in-pain... > > Question: What is the "proper" way to serve static pages in a plugin? > > My basic idea was: "Oh, I'll just create the file in > *'app/Plugin/ContactManager/Views/Pages/introduction.ctp'* and it should > pop up in */contact_manager/pages/introduction or **/pages/* > *contact_manager/**introduction*" > > Got: > Error: MyFancyBoxerShorts.PagesController could not be found. > Error: Create the class PagesController below in file: . > > But I don't feel like creating a duplicate class name > > I even tried > //file: PluginName/Controller/PagesController.php > require_once(ROOT . DS . APP_DIR . DS . 'Controller' . DS . > 'PagesController.php'); > > But this fails, because the magic of Pages routing doesn't apply for > plugins. > > So, I have 2 possible solutions: > > *A: Create a PagesController inside my Plugin* > - CON: duplicates class name > - CON: Any PagesController overrides from the user's app are lost (like > layouts, helpers, markup parsers, tweaks) > - CON: requires plugin routing to achieve default pages/* (action: > display) functionality > > *B: Add the pages routing to plugin routes.php (more conventional)* > Create PluginName/PagesController.php // require_once(ROOT . DS . APP_DIR > . DS . 'Controller' . DS . 'PagesController.php'); > Add ONE of these in the routes.php > Router::connect('/:plugin/pages/*', array('controller' => 'pages', > 'action' => 'display')); // potentially unsafe if other plugins define the > same > Router::connect('/contact_manager/pages/*', array('controller' => 'pages', > 'action' => 'display', 'plugin' => 'ContactManager')); //the "suitable > solution" > Require the user to load routes with the Plugin. > > > While writing this, I have found the "suitable solution" (again), but I > will leave it here in case anyone ever searches for it. > > And I would honestly like your input on the *most conventional* way of > doing this seemingly default-ish routing behavior. > > > -- 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 https://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
How to Unique URL like myhost.com/username,myhost.com/pages,myhost.com/groups
Hi Team/Friends, i am new to cakePHP, i want implement unique URL like facebook username,pages,groups. like mydomain.com/demo (username) mydomain.com/testpage (pages) mydomain.com/cakephp (group) i have created three database tables(Users,Pages,Groups) and three controllers with respectably , how can display like above controllers routing. $routes->connect( ':slug/*', ['controller' => 'Users', 'action' => 'view'],[ '_name' => 'users','pass' => ['slug'] ]); $routes->connect( ':slug/*', ['controller' => 'Pages', 'action' => 'view'],[ '_name' => 'pages','pass' => ['slug'] ]); $routes->connect( ':slug/*', ['controller' => 'Group', 'action' => 'view'],[ '_name' => 'group','pass' => ['slug'] ]); only working first route only Please help me Unique URL implementation above three controllers Thank you -- 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: Custom helpers not available on error pages
$this->loadHelper() should do the trick On Monday, May 11, 2015 at 6:42:27 PM UTC+2, LDSign wrote: > > Ok, thanks :) > > How can I do this (overriding a core helper on these error pages)? > > Regards, > Frank > > Am Montag, 11. Mai 2015 18:25:25 UTC+2 schrieb LDSign: >> >> Hi >> >> Ive set up some custom error pages which include the main layout >> (including navigation) for e.g. "page not found" errors. In the >> header-element included I make use of a custom helper (MyTextHelper extends >> TextHelper). >> >> Unfortunatley this custom helper is not used in the error page resulting >> in a warning "call_user_func_array() expects parameter 1 to be a valid >> callback". >> >> How can I make this custom helper available on error pages? >> >> CakePHP 2.6.4 >> >> Thanks, >> Frank >> > -- 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: Custom helpers not available on error pages
Ok, thanks :) How can I do this (overriding a core helper on these error pages)? Regards, Frank Am Montag, 11. Mai 2015 18:25:25 UTC+2 schrieb LDSign: > > Hi > > Ive set up some custom error pages which include the main layout > (including navigation) for e.g. "page not found" errors. In the > header-element included I make use of a custom helper (MyTextHelper extends > TextHelper). > > Unfortunatley this custom helper is not used in the error page resulting > in a warning "call_user_func_array() expects parameter 1 to be a valid > callback". > > How can I make this custom helper available on error pages? > > CakePHP 2.6.4 > > Thanks, > Frank > -- 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: Custom helpers not available on error pages
If I remember correctly (some) Error pages do not load from app controller, so it is safer if for the error pages you explicitly load the helpers you need. On Monday, May 11, 2015 at 6:25:25 PM UTC+2, LDSign wrote: > > Hi > > Ive set up some custom error pages which include the main layout > (including navigation) for e.g. "page not found" errors. In the > header-element included I make use of a custom helper (MyTextHelper extends > TextHelper). > > Unfortunatley this custom helper is not used in the error page resulting > in a warning "call_user_func_array() expects parameter 1 to be a valid > callback". > > How can I make this custom helper available on error pages? > > CakePHP 2.6.4 > > Thanks, > Frank > -- 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.
Custom helpers not available on error pages
Hi Ive set up some custom error pages which include the main layout (including navigation) for e.g. "page not found" errors. In the header-element included I make use of a custom helper (MyTextHelper extends TextHelper). Unfortunatley this custom helper is not used in the error page resulting in a warning "call_user_func_array() expects parameter 1 to be a valid callback". How can I make this custom helper available on error pages? CakePHP 2.6.4 Thanks, Frank -- 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: Notice (8): Undefined variable: color [APP/Template\Pages\myshow.ctp, line 2]
Hi! Why are you abusing the pages controller for that? It doesn't support actions out of the box. Make yourself a new FooController and then you can have actions for your views. But the PagesController itself only supports view files only (no action for it) The error you get shows this pretty clearly Mark Am Donnerstag, 2. April 2015 16:40:17 UTC+2 schrieb Amit G: > > Hi, > > I am using CakePHP3.0 getting > > *Notice* (8): Undefined variable: color [*APP/Template\Pages\myshow.ctp*, > line *2*] > how can fix this error? > > Here is my full code: > > namespace App\Controller; > > use Cake\Core\Configure; > use Cake\Network\Exception\NotFoundException; > use Cake\View\Exception\MissingTemplateException; > class PagesController extends AppController > { > > /** > * Displays a view > * > * @return void|\Cake\Network\Response > * @throws \Cake\Network\Exception\NotFoundException When the view file > could not > * be found or \Cake\View\Exception\MissingTemplateException in debug > mode. > */ > public function display() > { > $path = func_get_args(); > > $count = count($path); > if (!$count) { > return $this->redirect('/'); > } > $page = $subpage = null; > > if (!empty($path[0])) { > $page = $path[0]; > } > if (!empty($path[1])) { > $subpage = $path[1]; > } > $this->set(compact('page', 'subpage')); > > try { > $this->render(implode('/', $path)); > } catch (MissingTemplateException $e) { > if (Configure::read('debug')) { > throw $e; > } > throw new NotFoundException(); > } > } > > public function myshow() { > $this->set('color', 'pink'); > > $this->render(); > } > } > > > > > src\Template\Pages\myshow.ctp > > echo $color; > > ?> > test > > > > -- 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.
Notice (8): Undefined variable: color [APP/Template\Pages\myshow.ctp, line 2]
Hi, I am using CakePHP3.0 getting *Notice* (8): Undefined variable: color [*APP/Template\Pages\myshow.ctp*, line *2*] how can fix this error? Here is my full code: redirect('/'); } $page = $subpage = null; if (!empty($path[0])) { $page = $path[0]; } if (!empty($path[1])) { $subpage = $path[1]; } $this->set(compact('page', 'subpage')); try { $this->render(implode('/', $path)); } catch (MissingTemplateException $e) { if (Configure::read('debug')) { throw $e; } throw new NotFoundException(); } } public function myshow() { $this->set('color', 'pink'); $this->render(); } } src\Template\Pages\myshow.ctp test -- 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: Best practice: using class on all pages
Okay, outputting an structure with an element is indeed very usefull. It can appear in multiple areas on the template files. I understand that I should do something like: echo $this->element('mainmanu', array( 'tree' => array(...), 'active' => array(...) )); The tree array holds the records and should be calculated with a given depth. The active array holds the parent nodes of the active node. So far so good I guess? But what do you exactly mean with getting the data with a request action? Sorry if this is a silly question :) -- 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: Best practice: using class on all pages
I would use element for rendering and request action to get the correct data for menu. On Monday, August 11, 2014 12:26:47 AM UTC+2, Sam Clauw wrote: > > I want to write a class that use a left value and a depth value so it can > print an output for a menu. I want it to be able in my CMS plugin > AND in my front-end pages. My question is: where should I put that class? > Some options I've been thinking on: > >1. Everything in AppModel.php (disadvantage: file will be too long if >there are other functions here). >2. Making a behavior and call it's functions in a helper. > > Is one of the above options OK to use, or is there a better way to do so? > -- 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.
Best practice: using class on all pages
I want to write a class that use a left value and a depth value so it can print an output for a menu. I want it to be able in my CMS plugin AND in my front-end pages. My question is: where should I put that class? Some options I've been thinking on: 1. Everything in AppModel.php (disadvantage: file will be too long if there are other functions here). 2. Making a behavior and call it's functions in a helper. Is one of the above options OK to use, or is there a better way to do so? -- 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 anyone else getting a "zend_mm_heap corrupted" error with Cake 3 such that pages never finish loading?
The issue with trying to update my PHP is that WAMP does not have a newer 64bit build, and the newer 64 bit builds that I can find are compiled with a different version of VC such that they likely won't play nicely. Is there any way to verify that it is a PHP bug? On Wednesday, March 12, 2014 12:35:38 AM UTC+7, José Lorenzo wrote: > > That is usually related to a PHP bug triggered by APC opcode caching. > Maybe try to update your PHP version? > > > -- 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 anyone else getting a "zend_mm_heap corrupted" error with Cake 3 such that pages never finish loading?
That is usually related to a PHP bug triggered by APC opcode caching. Maybe try to update your PHP version? On Monday, March 10, 2014 1:00:02 PM UTC+1, heavyKevy wrote: > > > I am using Windows 7 64 bit > WampServer Version 2.2 > Apache 2.4.2 > Php 5.4.3 > MySql 5.5.24 > Eclipse 3.0.2 > > The problem happens both when browsing within Eclipse (in development mode > and debugging) and when using Firefox. > > When I first began to use Cake 3, everything worked fine, but about 2 > weeks ago or so, the error started to occur and I have not been able to > determine what is causing it. > > Does anyone have a clue why this may be occurring, or what I may do to > make it stop? > Cake 2 still works fine. > -- 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.
Is anyone else getting a "zend_mm_heap corrupted" error with Cake 3 such that pages never finish loading?
I am using Windows 7 64 bit WampServer Version 2.2 Apache 2.4.2 Php 5.4.3 MySql 5.5.24 Eclipse 3.0.2 The problem happens both when browsing within Eclipse (in development mode and debugging) and when using Firefox. When I first began to use Cake 3, everything worked fine, but about 2 weeks ago or so, the error started to occur and I have not been able to determine what is causing it. Does anyone have a clue why this may be occurring, or what I may do to make it stop? Cake 2 still works fine. -- 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: 302 redirects of 404 pages
My guess: Look for 'this->redirect' in app_controller, then all the remaining controllers. If that fails, maybe routes.php On Sun, Dec 15, 2013 at 8:55 PM, Jason Page wrote: > Hi gents, > > I've inherited a site doing something SEO suicidal, but I can't for the > life of me find where it is doing this, and I'm not even that familiar with > PHP, so it's turning out to be a nightmare. It probably doesn't help that > the site is 4 years old or so and has barely been updated in that time. > > Every non existent page is 302 redirecting to the homepage. > > Where should I be looking for a problem like this? I started with the > htaccess but it doesn't seem to be there. I then found /cake/libs/error.php > but after completely replacing that file with the standard core file the > redirect is still happening and I assume that isn't basic functionality. > > I would really appreciate the help of some folks that know the system in > identifying this.. > > -- > 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.
302 redirects of 404 pages
Hi gents, I've inherited a site doing something SEO suicidal, but I can't for the life of me find where it is doing this, and I'm not even that familiar with PHP, so it's turning out to be a nightmare. It probably doesn't help that the site is 4 years old or so and has barely been updated in that time. Every non existent page is 302 redirecting to the homepage. Where should I be looking for a problem like this? I started with the htaccess but it doesn't seem to be there. I then found /cake/libs/error.php but after completely replacing that file with the standard core file the redirect is still happening and I assume that isn't basic functionality. I would really appreciate the help of some folks that know the system in identifying this.. -- 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.
CakePHP plugin with static pages (PagesController in Plugin)
See the title of the post? I went nearly mad searching for it!! So I made it SEO friendly for any brothers-in-pain... Question: What is the "proper" way to serve static pages in a plugin? My basic idea was: "Oh, I'll just create the file in * 'app/Plugin/ContactManager/Views/Pages/introduction.ctp'* and it should pop up in */contact_manager/pages/introduction or **/pages/**contact_manager/** introduction*" Got: Error: MyFancyBoxerShorts.PagesController could not be found. Error: Create the class PagesController below in file: . But I don't feel like creating a duplicate class name I even tried //file: PluginName/Controller/PagesController.php require_once(ROOT . DS . APP_DIR . DS . 'Controller' . DS . 'PagesController.php'); But this fails, because the magic of Pages routing doesn't apply for plugins. So, I have 2 possible solutions: *A: Create a PagesController inside my Plugin* - CON: duplicates class name - CON: Any PagesController overrides from the user's app are lost (like layouts, helpers, markup parsers, tweaks) - CON: requires plugin routing to achieve default pages/* (action: display) functionality *B: Add the pages routing to plugin routes.php (more conventional)* Create PluginName/PagesController.php // require_once(ROOT . DS . APP_DIR . DS . 'Controller' . DS . 'PagesController.php'); Add ONE of these in the routes.php Router::connect('/:plugin/pages/*', array('controller' => 'pages', 'action' => 'display')); // potentially unsafe if other plugins define the same Router::connect('/contact_manager/pages/*', array('controller' => 'pages', 'action' => 'display', 'plugin' => 'ContactManager')); //the "suitable solution" Require the user to load routes with the Plugin. While writing this, I have found the "suitable solution" (again), but I will leave it here in case anyone ever searches for it. And I would honestly like your input on the *most conventional* way of doing this seemingly default-ish routing behavior. -- 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: How to redirect two pages back?
Thanks, it works!. El lunes, 16 de abril de 2012 10:19:23 UTC+2, euromark escribió: > > @cricket > almost perfect - I would not pass the referer this way, though. creates > overhead > and then I don't think the else case inside the post() is necessary. > after a post the same post data will populate the inputs anyway. therefore > the Model.referer input should still have the same value. > no need to resend this variable to the view. > I also dont like to unnecessarily set defaults in the view. > > echo $this->Form->input('Model.referer'); > > public function add() { > > if ($this->request->is('post')) { > // validate ... > > if ($this->Model->save()) { > $referer = > !empty($this->request->data['Model']['referer']) > ? $this->request->data['Model']['referer'] > : '/';// or some other fallback route of > your choice > > $this->redirect($referer); > } > } else { > $this->request->data['Model']['referer'] > = $this->referer(); > } > } > > > you agree? > > > Am Montag, 16. April 2012 01:08:29 UTC+2 schrieb cricket: >> >> On first display of the form pass the referer to the view to add it to >> the form. >> >> echo $this->Form->input('Model.referer', array('value' => $referer)); >> >> public function add() { >> >> if ($this->request->is('post')) { >> >> $referer = isset($this->request->data['Model']['referer']) >> ? $this->request->data['Model']['referer'] >> : '/';// or some other fallback route of >> your choice >> >> // validate ... >> >> if ($this->Model->save()) { >> >> $this->redirect($referer); >> } >> else { >> // flash msg, log, etc. >> $this->set(compact('referer')); >> } >> } >> else { >> $this->set('referer', $this->referer()); >> } >> } >> >> >> You have to use the else block to set the view var because if the save >> failed it would overwrite it to the empty form. Likewise, you need to >> create the $referer method var before attempting to save so that it's >> available either way (to redirect or reset the view var). >> >> On Sun, Apr 15, 2012 at 4:15 PM, Daniel > >> wrote: >> > I am using the following code to go back a page, but the problem is >> > that the action is an "add" one so it just goes back to an empty "add" >> > form: >> > >> > if ($this->request->is('post')) { >> >// blah blah ... >> >if ($this->Inemail->save($this->request->data)) { >> >// blah blah ... >> >$this->redirect($this->referer()); >> > >> > I think what I need to do is go back two pages. Is this possible? >> > >> > Thanks. >> > >> > -- >> > 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+u...@googlegroups.com For more options, visit >> this group at http://groups.google.com/group/cake-php >> >> -- 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.
Related data when using pages controller
Just an fyi for anyone who may have an issue in 2.x when viewing a pr($this->Model->find('all'); from the pages controller, make sure that first letter is capitalized (which is what you should be doing anyway). lol I spent a few minutes trying to find out why the heck none of the relations were coming through, when the issue was that in the $uses array, I had specified the model with a lowercase instead of an uppercase, which as soon as I corrected that and updated the corresponding calls all was back to normal. Just wanna save someone some time if searching on this. -- 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: caching with pages and '/' route
I have a related problem, I think. I cannot figure out how to cache any of the pages in the Pages Controller. Particularly the homepage, which for me is also routed to '/'. On Tuesday, February 22, 2011 11:31:46 AM UTC-5, desig...@gmail.com wrote: > > Ok, So it's basically treating /home the same as /? > > So I need to NOT use the global Cache.check and setup the caching in > each controller as I have done before? > > Does this mean that I will have to copy the pages class from the core > to control the pages caching? > > d//t. > > On Feb 22, 3:39 pm, John Andersen wrote: > > The Dispatcher class has a method in which it checks for whether or > > not it should use a cached version of the URL, when the Cache.check > > configuration is set to true. > > > > So in your case it works as it should, you have told the Dispatcher to > > use cached versions. The Dispatcher uses "/home" whenever the "/" is > > specified. > > > > Enjoy, > >John > > > > On 22 Feb., 15:22, "designv...@gmail.com" > > wrote:> I have used caching before on controllers I have created and > it's not > > > been a problem, and it works fine for the controllers in this site. > > > > > I am familiar with setting the cache configuration options and > > > creating new ones in the core. > > > > > I am just stumped over this issue regarding caching pages and the '/' > > > route... I do not know where to set options for it. > > > > > Cheers, > > > > > d//t > > > > [snip] -- 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: Passing arguments to a Pages
Yes, I meant "display" not "view". I can show what I did for one of my own sites wit a modified PagesController to fetch content from the database. public function display($slug = null) { if (empty($slug)) { $slug = 'index'; } $data = $this->Page->find( 'first', array( 'fields' => array( 'Page.title', 'Page.slug', 'Page.content', ), 'conditions' => array('Page.slug' => $slug), 'recursive' => -1 ) ); if (empty($data)) { $this->cakeError('error404'); } else { $this->set(compact('data')); $this->_setPageTitle($data['Page']['title']); if ($slug == 'index') { $this->layout = 'index'; $this->render('index'); } } } On Mon, Aug 27, 2012 at 3:28 PM, Mariano C. wrote: > I have just one "problem". I used Page, cause I need no action, matter of > fact, i'm using default action (i.e. display) I should ovverride the default > display() and change on my need. It's possible? How could change it. > > Il giorno lunedì 27 agosto 2012 20:18:04 UTC+2, cricket ha scritto: >> >> And change your controller: >> >> public function view($slug = null) >> > -- > 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: Passing arguments to a Pages
I have just one "problem". I used Page, cause I need no action, matter of fact, i'm using default action (i.e. display) I should ovverride the default display() and change on my need. It's possible? How could change it. Il giorno lunedì 27 agosto 2012 20:18:04 UTC+2, cricket ha scritto: > > And change your controller: > > public function view($slug = null) > > -- 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: Passing arguments to a Pages
You could use SluggableBehavior in the Page model. Router::connect( '/clienti/:slug', array( 'controller' => 'pages', 'action' => 'view' ), array( 'slug' => '[-a-z]+' 'pass' => array('slug') ) ); And change your controller: public function view($slug = null) You could call it "regione" if you like but I like to use the generic "slug" to make it clear what it is. (I usually have several different slugs across my routes.) I included a leading hyphen in the regex so you can have regions like "emilia-romagna". Also, it expects the slugs to be all lowercase as this is what SluggableBehavior will do. On Sun, Aug 26, 2012 at 5:47 AM, Mariano C. wrote: > I've a page (i.e. under Pages directory) called dettaglio_regione.ctp. I > want to set URLs like http://.../clienti/[[regione]], so a working URL > should be something like http://.../clienti/Campania or > http://.../clienti/Sicilia and so on. > I need to grab the content of [[regione]]. How I've to set the route? > > -- > 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.
Passing arguments to a Pages
I've a page (i.e. under Pages directory) called dettaglio_regione.ctp. I want to set URLs like http://.../clienti/[[regione]], so a working URL should be something like http://.../clienti/Campania or http://.../clienti/Sicilia and so on. I need to grab the content of [[regione]]. How I've to set the route? -- 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: View Driven Pages
No replies? :( I hope the post is understandable. Does anyone have any input or comments on the idea? -- 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
View Driven Pages
Hi Bakers, It has been a while since I've been working with CakePHP, sad I know, but had other projects on the go. I've been working out for a while a different and more consistent method of routing requests and serving up pages. I would enjoy your response and thoughts on this. The objective is to have a universal way of rendering pages. Currently, the rendering process is different between a full page request, an element / requestAction process, an ajax update returning the render html, and a ajax update return just data which then updates the client side html using javascript. I'll illustrate this solution via an example. 1. A full page request comes in for /controllerA/actionB/. 2. Instead of the request going to ControllerA->ActionB(), the request goes to PageRendererX->RenderRequest(). 3. PageRendererX->RenderRequest() looks up the elements (with configuration variables) it needs to render for page /controllerA/actionB/ and what zones of the html it needs to render them in. 4. View renders the request by running through the zones and processing each allocated element. 5. Each element then fetches its data using requestAction and passing the required variables to the action. 6. Each action simple returns the data as usual and the element renders its portion of code. If this process was followed, it would allow the following: 1. Any element on the client side could be automatically ajax updateble. 2. Any element javascript code could update the html via an ajax data request. This simple routes to an AjaxRender controller on the server, which simply processes and returns the data similar to how requestAction would to an element. The process would most likely need a universal handler for the communications between client and server. For example, if a controller or element is adding javascript to the page, this needs to be understood by the handler, so it can insert/execute the javascript on the client side as needed. Using this process potentially will lead to simpler code, easier rendering capabilities, and leaves the rendering very adaptable. I have not considered the performance impact of this. What are your thoughts? -- 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: Pages and Auth
Fantastic! Only thing better than CakePHP is the community! Thank you so much! -- 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: Pages and Auth
Hi! I am also falling in love with it, so far as to become jealous already :) The authentication is what you did at your users pages. The authentication and authorization are different. Now you have to set up the authorization using some method, like controller/action authorization for example. And then during the check you redirect users to login if they are not yet logged in. But this has to be set up. If you want it simple, you add something like this to your app controller; public $components = array( 'Auth' => array( 'loginAction' => array( 'controller' => 'users', 'action' => 'login', ), 'loginRedirect' => array( 'controller' => 'users', 'action' => 'view', ), ); And it will automatically redirect users to users/login if they are not logged in. Then you use $this->Auth->allow() and $this->Auth->deny() in your controllers to control what methods are available to anonymous users. There are other alternatives but this is the most basic setup, I think. Cheers! On Saturday, 7 July 2012 23:20:59 UTC+2, David Lozzi wrote: > > Hi there, > > I'm new to CakePHP, and falling in love it with. A question on how this > all works. > > I have setup a route for admin, so domain/admin/news, and > domain/admin/users work. > > I have added authentication using the CakePHP tutorial, but it's added to > a single controller, my users. I want it applied to all items under admin. > Is it possible to set this up, so whatever in admin requires auth, and goes > to a shared login page? > > -- 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
Pages and Auth
Hi there, I'm new to CakePHP, and falling in love it with. A question on how this all works. I have setup a route for admin, so domain/admin/news, and domain/admin/users work. I have added authentication using the CakePHP tutorial, but it's added to a single controller, my users. I want it applied to all items under admin. Is it possible to set this up, so whatever in admin requires auth, and goes to a shared login page? And that leads me to my other question about the routes and pages. Is it possible for me to domain.com/news - my news list, redirects to index.ctp domain.com/admin/news - the admin area for news domain.com/admin - can this redirect to a page, like pages/admin.ctp? domain.com/anypage - i'm seeing I can add pages but it has to be in domain.com/pages/pagename, can I keep them at the root? I hope this all makes sense. Thanks! -- 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: Generating KML pages
Try this function beforeFilter() { $this->RequestHandler->setContent('kml', 'text/xml'); // $this->RequestHandler->setContent('kml', 'application/vnd.google-earth.kml+xml'); } On Thursday, September 24, 2009 7:01:18 AM UTC+2, Kyle Decot wrote: > > I am attempting to create KML pages for my site but I'm not having any > luck. In my routes.php I have: > > Router::parseExtensions('kml'); > > I have also created a KML layout at /app/layouts/kml/default.ctp > > When I go to localhost/my_controller/index.kml though the default > layout is being used. How can I fix this? Thank you for any help you > can provide. -- 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: Default layout and static pages How to?
> the page is default has css menu and i want when i press about us to have > the same default view with the samw css menu but different content.So that > i dont have to write again inside the about page all the css menu...and > so on . > In this case you want to extend existing layout http://book.cakephp.org/2.0/en/views.html#extending-views This section describes how to extend view, but it works the same for layouts and elements as well. -- 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: Default layout and static pages How to?
2012/6/7 gorgoro wicks > Thakns for your answer that is what i meant byt i dont have the default > layout with $this->layout='custom' i can pass the static page content on > my view but i dont have the default layout. > > example > > element('header'); ?> > > > > > > > element('_menu'); ?> > > > > > > > > > > > HERE > > > > > element('footer'); ?> > > > > the page is default has css menu and i want when i press about us to have > the same default view with the samw css menu but different content.So that > i dont have to write again inside the about page all the css menu...and > so on . > > > > 2012/6/7 stork > >> I'm not sure I understand your question. >> If you want to set custom layout for some static page(s), then in >> this/these page(s) just >> $this->layout = 'custom'; >> You can change layout in controller's action AND in view as well. >> >> -- >> 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: Default layout and static pages How to?
Thakns for your answer that is what i meant byt i dont have the default layout with $this->layout='custom' i can pass the static page content on my view but i dont have the default layout. example the page is default has css menu and i want when i press about us to have the same default view with the samw css menu but different content.So that i dont have to write again inside the about page all the css menu...and so on . 2012/6/7 stork > I'm not sure I understand your question. > If you want to set custom layout for some static page(s), then in > this/these page(s) just > $this->layout = 'custom'; > You can change layout in controller's action AND in view as well. > > -- > 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: Default layout and static pages How to?
I'm not sure I understand your question. If you want to set custom layout for some static page(s), then in this/these page(s) just $this->layout = 'custom'; You can change layout in controller's action AND in view as well. -- 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: Default layout and static pages How to?
On Thu, Jun 7, 2012 at 8:39 AM, gorgoro wicks wrote: > How can i use the default layout but when i am on About us page to > make the default layout add the about us content and the same for > contact. > can anyone help or give a guide how to do that . Put the static pages into the app/View/Pages and then define routes for each of them Router::connect('/aboutus', array('controller' => 'pages', 'action' => 'display', 'aboutus')); Router::connect('/contact', array('controller' => 'pages', 'action' => 'display', 'contact')); Mike. -- 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
Default layout and static pages How to?
Hello there I am new to cakephp and i have read the tut but something i haven't understand. I have create a default page and i have 2 more static pages About us and Contact . How can i use the default layout but when i am on About us page to make the default layout add the about us content and the same for contact. can anyone help or give a guide how to do that . Thanks -- 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 redirect two pages back?
I created the following in my controller, just setReferer when you want to track where you want to go back to. function origReferer(){ return $this->Session->read('referer'); } function setReferer(){ $this->Session->write('referer', $this->referer()); } eg: function edit($id){ if (empty($this->request->data)) { $this->request->data = $this->ModelToEdit->read(null, $id); $this->setReferer(); } } On Sunday, April 15, 2012 2:15:20 PM UTC-6, Daniel wrote: > > I am using the following code to go back a page, but the problem is > that the action is an "add" one so it just goes back to an empty "add" > form: > > if ($this->request->is('post')) { > // blah blah ... > if ($this->Inemail->save($this->request->data)) { > // blah blah ... > $this->redirect($this->referer()); > > I think what I need to do is go back two pages. Is this possible? > > Thanks. -- 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 redirect two pages back?
I use this in AppController: function origReferer(){ return $this->Session->read('referer'); } function setReferer(){ $this->Session->write('referer', $this->referer()); } This way I can cross multiple pages and keep track of where I want to refer them back too using $this->redirect($this->origReferer()); On Sunday, April 15, 2012 2:15:20 PM UTC-6, Daniel wrote: > > I am using the following code to go back a page, but the problem is > that the action is an "add" one so it just goes back to an empty "add" > form: > > if ($this->request->is('post')) { > // blah blah ... > if ($this->Inemail->save($this->request->data)) { > // blah blah ... > $this->redirect($this->referer()); > > I think what I need to do is go back two pages. Is this possible? > > Thanks. -- 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: cake 2.x auth component bugs with pages controller after changing htaccess files
You can make a sql qury which will delete all from given range.. I think it would be best for performances as well On May 19, 4:55 am, Jimit Kapadya wrote: > Hello All, > > how to delete Multiple tables fields values in cakephp 2.0 -- 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: cake 2.x auth component bugs with pages controller after changing htaccess files
Hello All, how to delete Multiple tables fields values in cakephp 2.0 -- 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: cake 2.x auth component bugs with pages controller after changing htaccess files
I figured id out.. So I did have a char in the end of my while it is because I maade my controller UTF 8 beacuse of some warnings that I needed to make in serbian. However, I didn't make it utf 8 without BOM (notepad ++ has that option), lousy missclick Strange things are the following : in local host , it worked 0.O second thing is, ACL->Allow worked when you make all allowed but doesn't when you need to check if someone is logged in. This behaviour is super strange, because only AUTH component had the problem with my controller. If it was allowed it worked .. Anywyas LOZ .. I just wasted a day on that .. But at least its over .. On 18 мај, 23:35, Miloš Vučinić wrote: > Hi, > > this is really strange question. I made a simple web presentation (so > far I have used cake 1.3 this is my first 2.x project), and added AUTH > component looking at the tutorial from this link > :http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-cont... > > Ok so here is my problem. I have overridden pages controller and made > 4 more. They all run perfectly in local host, however , only pages > controller bugs on the server. In order to upload code and make it > work I had to change my 3 htaccess files , because sever was giving me > internal sever error without base variable. > > Now here is the funny part. The pages controller shows blank page with > no errors, even in debug mode 2, whenever I try to access any of the > functions for which you have to be logged in to use. Only pages > controller, which doesn't use anything unusual, or unstandard. Just a > plain blank page and only on that server. In local host it runs > normaly. > > So I did the following : > 1) I checked if there is any blank space left - no > 2) I checked if allowed functions work - they do > 3) When I put smth in before filter and do var_dump it prints it. > 4) I tried to print user from session of from auth component , I get > null - although in other controllers it works ok > 5) This all happens regardless if I am loged in or out > 6) I do not get redirected when the function is allowed for normal > users, I only get the blank page , i checked to surce of the page, > nothing, just html and body tags empty again > 7) when i make auth->allow('*') everything runs ok. So only the > functions which are not allowed. > > Since I wasted a whole day on this, I am going to rename the > controller and try again because all others are working fine, and in > local host even pages work fine. I suppose that since I had to change > htaccess files, auth component bugs, but I cant guess what. > > I will post update about this, however if someone had a similar > situation and solved it please help. > > I guess somehow I got different sessions for these controllers but I > have no idea how or why... 0.O > > ty in advance -- 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
cake 2.x auth component bugs with pages controller after changing htaccess files
Hi, this is really strange question. I made a simple web presentation (so far I have used cake 1.3 this is my first 2.x project), and added AUTH component looking at the tutorial from this link : http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html Ok so here is my problem. I have overridden pages controller and made 4 more. They all run perfectly in local host, however , only pages controller bugs on the server. In order to upload code and make it work I had to change my 3 htaccess files , because sever was giving me internal sever error without base variable. Now here is the funny part. The pages controller shows blank page with no errors, even in debug mode 2, whenever I try to access any of the functions for which you have to be logged in to use. Only pages controller, which doesn't use anything unusual, or unstandard. Just a plain blank page and only on that server. In local host it runs normaly. So I did the following : 1) I checked if there is any blank space left - no 2) I checked if allowed functions work - they do 3) When I put smth in before filter and do var_dump it prints it. 4) I tried to print user from session of from auth component , I get null - although in other controllers it works ok 5) This all happens regardless if I am loged in or out 6) I do not get redirected when the function is allowed for normal users, I only get the blank page , i checked to surce of the page, nothing, just html and body tags empty again 7) when i make auth->allow('*') everything runs ok. So only the functions which are not allowed. Since I wasted a whole day on this, I am going to rename the controller and try again because all others are working fine, and in local host even pages work fine. I suppose that since I had to change htaccess files, auth component bugs, but I cant guess what. I will post update about this, however if someone had a similar situation and solved it please help. I guess somehow I got different sessions for these controllers but I have no idea how or why... 0.O ty in advance -- 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: Error Pages
That makes sense now that you say it. Does anyone know how to use the AppController with the error/exception handling? On Wednesday, April 18, 2012 2:20:30 PM UTC-5, creat1v1ty wrote: > > I am using version 2.1... > > In my app I have some logic taking place in my AppController's > beforeFilter() function where I'm setting a few variables that get used in > my default layout, and subsequently on all pages of the site. > > When testing my error pages in production mode (debug=0), I noticed the > variables I'm setting in my AppController aren't getting passed to the > layout, even though the error pages appear to be using the default layout. > > Will someone help me figure this out? Thanks! > -- 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: Error Pages
Set debug to 1 and then click on the "Notice" link to see the stacktrace. You'll see that AppController is not even used. An internal redirect happens and ErrorHandler then passes the rendering to ExceptionRenderer, which in turn invokes Controller directly. I can't remember what the workaround is supposed to be, though. On Wed, Apr 18, 2012 at 3:20 PM, creat1v1ty wrote: > I am using version 2.1... > > In my app I have some logic taking place in my AppController's > beforeFilter() function where I'm setting a few variables that get used in > my default layout, and subsequently on all pages of the site. > > When testing my error pages in production mode (debug=0), I noticed the > variables I'm setting in my AppController aren't getting passed to the > layout, even though the error pages appear to be using the default layout. > > Will someone help me figure this out? Thanks! > > -- > 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
Error Pages
I am using version 2.1... In my app I have some logic taking place in my AppController's beforeFilter() function where I'm setting a few variables that get used in my default layout, and subsequently on all pages of the site. When testing my error pages in production mode (debug=0), I noticed the variables I'm setting in my AppController aren't getting passed to the layout, even though the error pages appear to be using the default layout. Will someone help me figure this out? Thanks! -- 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 redirect two pages back?
Yes, that's a much better way to do it -- just set it in request data. On Mon, Apr 16, 2012 at 4:19 AM, euromark wrote: > @cricket > almost perfect - I would not pass the referer this way, though. creates > overhead > and then I don't think the else case inside the post() is necessary. > after a post the same post data will populate the inputs anyway. therefore > the Model.referer input should still have the same value. > no need to resend this variable to the view. > I also dont like to unnecessarily set defaults in the view. > > echo $this->Form->input('Model.referer'); > > public function add() { > > if ($this->request->is('post')) { > // validate ... > > if ($this->Model->save()) { > $referer = > !empty($this->request->data['Model']['referer']) > ? $this->request->data['Model']['referer'] > : '/';// or some other fallback route of > your choice > > $this->redirect($referer); > } > } else { > $this->request->data['Model']['referer'] = $this->referer(); > } > } > > > you agree? > > > Am Montag, 16. April 2012 01:08:29 UTC+2 schrieb cricket: >> >> On first display of the form pass the referer to the view to add it to the >> form. >> >> echo $this->Form->input('Model.referer', array('value' => $referer)); >> >> public function add() { >> >> if ($this->request->is('post')) { >> >> $referer = isset($this->request->data['Model']['referer']) >> ? $this->request->data['Model']['referer'] >> : '/';// or some other fallback route of >> your choice >> >> // validate ... >> >> if ($this->Model->save()) { >> >> $this->redirect($referer); >> } >> else { >> // flash msg, log, etc. >> $this->set(compact('referer')); >> } >> } >> else { >> $this->set('referer', $this->referer()); >> } >> } >> >> >> You have to use the else block to set the view var because if the save >> failed it would overwrite it to the empty form. Likewise, you need to >> create the $referer method var before attempting to save so that it's >> available either way (to redirect or reset the view var). >> >> On Sun, Apr 15, 2012 at 4:15 PM, Daniel wrote: >> > I am using the following code to go back a page, but the problem is >> > that the action is an "add" one so it just goes back to an empty "add" >> > form: >> > >> > if ($this->request->is('post')) { >> > // blah blah ... >> > if ($this->Inemail->save($this->request->data)) { >> > // blah blah ... >> > $this->redirect($this->referer()); >> > >> > I think what I need to do is go back two pages. Is this possible? >> > >> > Thanks. >> > >> > -- >> > 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: How to redirect two pages back?
@cricket almost perfect - I would not pass the referer this way, though. creates overhead and then I don't think the else case inside the post() is necessary. after a post the same post data will populate the inputs anyway. therefore the Model.referer input should still have the same value. no need to resend this variable to the view. I also dont like to unnecessarily set defaults in the view. echo $this->Form->input('Model.referer'); public function add() { if ($this->request->is('post')) { // validate ... if ($this->Model->save()) { $referer = !empty($this->request->data['Model']['referer']) ? $this->request->data['Model']['referer'] : '/';// or some other fallback route of your choice $this->redirect($referer); } } else { $this->request->data['Model']['referer'] = $this->referer(); } } you agree? Am Montag, 16. April 2012 01:08:29 UTC+2 schrieb cricket: > > On first display of the form pass the referer to the view to add it to the > form. > > echo $this->Form->input('Model.referer', array('value' => $referer)); > > public function add() { > > if ($this->request->is('post')) { > > $referer = isset($this->request->data['Model']['referer']) > ? $this->request->data['Model']['referer'] > : '/';// or some other fallback route of > your choice > > // validate ... > > if ($this->Model->save()) { > > $this->redirect($referer); > } > else { > // flash msg, log, etc. > $this->set(compact('referer')); > } > } > else { > $this->set('referer', $this->referer()); > } > } > > > You have to use the else block to set the view var because if the save > failed it would overwrite it to the empty form. Likewise, you need to > create the $referer method var before attempting to save so that it's > available either way (to redirect or reset the view var). > > On Sun, Apr 15, 2012 at 4:15 PM, Daniel wrote: > > I am using the following code to go back a page, but the problem is > > that the action is an "add" one so it just goes back to an empty "add" > > form: > > > > if ($this->request->is('post')) { > >// blah blah ... > >if ($this->Inemail->save($this->request->data)) { > >// blah blah ... > >$this->redirect($this->referer()); > > > > I think what I need to do is go back two pages. Is this possible? > > > > Thanks. > > > > -- > > 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: How to redirect two pages back?
On first display of the form pass the referer to the view to add it to the form. echo $this->Form->input('Model.referer', array('value' => $referer)); public function add() { if ($this->request->is('post')) { $referer = isset($this->request->data['Model']['referer']) ? $this->request->data['Model']['referer'] : '/'; // or some other fallback route of your choice // validate ... if ($this->Model->save()) { $this->redirect($referer); } else { // flash msg, log, etc. $this->set(compact('referer')); } } else { $this->set('referer', $this->referer()); } } You have to use the else block to set the view var because if the save failed it would overwrite it to the empty form. Likewise, you need to create the $referer method var before attempting to save so that it's available either way (to redirect or reset the view var). On Sun, Apr 15, 2012 at 4:15 PM, Daniel wrote: > I am using the following code to go back a page, but the problem is > that the action is an "add" one so it just goes back to an empty "add" > form: > > if ($this->request->is('post')) { > // blah blah ... > if ($this->Inemail->save($this->request->data)) { > // blah blah ... > $this->redirect($this->referer()); > > I think what I need to do is go back two pages. Is this possible? > > Thanks. > > -- > 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: How to redirect two pages back?
On Apr 15, 9:22 pm, Matt Murphy wrote: > You need to capture your post array for the form and feed it back into the > new loaded form. OK, but how do I do that? -- 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 redirect two pages back?
You need to capture your post array for the form and feed it back into the new loaded form. Cheers, Matt On Sun, Apr 15, 2012 at 4:15 PM, Daniel wrote: > I am using the following code to go back a page, but the problem is > that the action is an "add" one so it just goes back to an empty "add" > form: > > if ($this->request->is('post')) { >// blah blah ... >if ($this->Inemail->save($this->request->data)) { >// blah blah ... >$this->redirect($this->referer()); > > I think what I need to do is go back two pages. Is this possible? > > Thanks. > > -- > 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
How to redirect two pages back?
I am using the following code to go back a page, but the problem is that the action is an "add" one so it just goes back to an empty "add" form: if ($this->request->is('post')) { // blah blah ... if ($this->Inemail->save($this->request->data)) { // blah blah ... $this->redirect($this->referer()); I think what I need to do is go back two pages. Is this possible? Thanks. -- 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
404 and other error pages
Hi, I googled quite some time arround but I only find here and there some hint, but I found never a kind of complete instruction how to setup custom error layouts for my project. I am using Cake 2.1. Does anyone know a good tutorial link? I aslo read in the book, but I find it also quite hard to start with it And the most other pages I found in Google are from 2006ish and relate to cake 1.2/3 Hope that anyone has a good source! Thanks!! -- 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: read filename of current view file in pages
Are you using Cake's PageController, or have you implemented your own? Have a look at how that does it. On Sun, Mar 25, 2012 at 12:02 PM, Ivo Wolgensinger wrote: > Dear all > > I'm doing my website multilingual. Now I'm working on the pages handling. > Most of them works fine. > If somebody calls www.mydomain/pages/about_us (or > www.mydomain/ita/pages/about_us) then I want (in the AppController) to read > the name of "about_us". In this case it's about_us.ctp in the pages folder. > I want to create a switch and have to ask which page it is. Then I can check > if the file exists in the exact folder (ex. pages/ita/about_us.ctp) > > How can I get the filename? I tried to do this: $this->action, but the > action is "display", so I need another solution. > > Any ideas? > > Thank you very much. > > Ivo > > -- > 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
read filename of current view file in pages
Dear all I'm doing my website multilingual. Now I'm working on the pages handling. Most of them works fine. If somebody calls www.mydomain/pages/about_us (or www.mydomain/ita/pages/about_us) then I want (in the AppController) to read the name of "about_us". In this case it's about_us.ctp in the pages folder. I want to create a switch and have to ask which page it is. Then I can check if the file exists in the exact folder (ex. pages/ita/about_us.ctp) How can I get the filename? I tried to do this: $this->action, but the action is "display", so I need another solution. Any ideas? Thank you very much. Ivo -- 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: locale mit pages
Sorry, now in english: In my cakePHP-environment (version 2) the following code in AppController: $locale = $this->Session->read('Config.language'); //if ($locale && file_exists(VIEWS . DS . $this- >viewPath .DS . $locale . DS)) { if ($locale && file_exists($_SERVER['DOCUMENT_ROOT'] . '/ cake2/ app/View/Pages/'.$locale.'/')) { echo $this->viewPath . DS . $locale; $this->viewPath = $this->viewPath . DS . $locale; } Everything works fine. But the outcommented line is how to do it (in cakephp-style). But it doesn't work in my example. Does anybody know what I do wrong? There is no error message. My pages structure ist the following: - default files: View/Pages/ - files in another language: View/Pages/deu, View/Pages/ita etc. Thank you for any help. Ivo -- 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: locale mit pages
2012/3/23 Ivo Wolgensinger > Hallo zusammen > > Ich habe in meiner cakePHP-Umgebung (Version 2) folgenden Code im > AppController: > >$locale = $this->Session->read('Config.language'); >//if ($locale && file_exists(VIEWS . DS . $this->viewPath . > DS . $locale . DS)) { >if ($locale && file_exists($_SERVER['DOCUMENT_ROOT'] . '/cake2/ > app/View/Pages/'.$locale.'/')) { >echo $this->viewPath . DS . $locale; >$this->viewPath = $this->viewPath . DS . $locale; >} > > Dies funktioniert soweit ganz gut. Leider funktioniert die vom > Kochbuch vorgeschlagene Version (etwas abgeändert) nicht. Kann mir > jemand sagen wo der Fehler liegen könnte? Ich stehe ganz schön auf der > Leitung. > PS: Meine Struktur sieht so aus bezüglich Pages: > Standardfiles: View/Pages/ > Sprachfiles: View/Pages/deu, View/Pages/ita etc. > > Vielen Dank für Hinweise. > > It's an English forum, so please just use English. Thanks -- Regards,,, thom http://mynameisthom.blogspot.com http://www.twitter.com/iamthom_ http://id.linkedin.com/in/mastanto -- 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
locale mit pages
Hallo zusammen Ich habe in meiner cakePHP-Umgebung (Version 2) folgenden Code im AppController: $locale = $this->Session->read('Config.language'); //if ($locale && file_exists(VIEWS . DS . $this->viewPath . DS . $locale . DS)) { if ($locale && file_exists($_SERVER['DOCUMENT_ROOT'] . '/cake2/ app/View/Pages/'.$locale.'/')) { echo $this->viewPath . DS . $locale; $this->viewPath = $this->viewPath . DS . $locale; } Dies funktioniert soweit ganz gut. Leider funktioniert die vom Kochbuch vorgeschlagene Version (etwas abgeändert) nicht. Kann mir jemand sagen wo der Fehler liegen könnte? Ich stehe ganz schön auf der Leitung. PS: Meine Struktur sieht so aus bezüglich Pages: Standardfiles: View/Pages/ Sprachfiles: View/Pages/deu, View/Pages/ita etc. Vielen Dank für Hinweise. Ivo -- 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
When enable php_pdo_mysql.dll pages stop working
I'm trying enable PDO on my server, because CakePHP 2.1 need it, but when I'm uncomment in php.ini php_pdo_mysql.dll all pages working with MySQL stop working. When I re-comment this dll pages start working again. Could you give me some advice what to do? I have Windows 7. Apache 2.4, PHP 5.4, MySQL 5.5.21. I only got error message from my browser Error 101 (net::ERR_CONNECTION_RESET): -- Pozdrawiam Dominik Gajewski -- 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: Access db from static pages
http://stackoverflow.com/questions/6973594/access-the-database-from-static-pages-in-cakephp1-3 On 7 Aug., 16:45, AB wrote: > Is there any way to access the database from static pages? -- 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
Access db from static pages
Is there any way to access the database from static pages? -- 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: CakePHP Pages Occasionally Losing Layout - Please Help!
Thanks for the tip, Andy! I'm quite ashamed that it was this simple and I never thought of it before, when all I did was disable caching on pages that were requested using AJAX and non-AJAX requests. -- 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: CakePHP Pages Occasionally Losing Layout - Please Help!
On Jul 21, 6:48 pm, Matthew wrote: > I have a CakePHP site whose homepage is cached for 10 minutes at a > time using Cake's default options. However I've been alerted that > "every once in a while", once a day or so, it's losing the layout, > just displaying the page content without the header, styling etc. > > Removing the cached version and regenerating the page apparently fixes > the problem. But why would/could this be happening in the first place? If you ajax load a page with the same url as the full-html version / and/ are using full page caching that would be one combination of factors which would lead to what you describe. Because headers are not taken into account when generating or querying the full page cache files. If that applies to you, you can avoid such problems quite easily: /foo/bar - full html /foo/bar.ajax - body only Or any similar permutation thereof. AD -- 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: CakePHP Pages Occasionally Losing Layout - Please Help!
I saw the same behavior when an error occurs or when the execution time exceed. I suggest you try logging all the activity of the site during the analisys time, so you can find if any errors happends. Do this logging with database activity too if you can. Regards, Alejandro. El 22/07/2011 11:13, Dr. Loboto escribió: > I saw such behavior without caching - it will happen if fatal error > occurs after (or during) content render but before layout render. > "Every once in a while" behavior I got with execution time limit > exceeded because of too heavy load on dev server - this is fatal error > too. > > Don't know can this help you, but its the only I know about such > problem. > > On Jul 21, 11:48 pm, Matthew wrote: >> I have a CakePHP site whose homepage is cached for 10 minutes at a >> time using Cake's default options. However I've been alerted that >> "every once in a while", once a day or so, it's losing the layout, >> just displaying the page content without the header, styling etc. >> >> Removing the cached version and regenerating the page apparently fixes >> the problem. But why would/could this be happening in the first place? >> I can't say I've seen it happen myself (in any of my CakePHP projects) >> but asking around on the internet, other developers say they've >> definitely seen it happen, usually only in development - but that's >> still a big cause for concern, especially as no-one seems to know >> why >> >> Many thanks for your help! -- 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: CakePHP Pages Occasionally Losing Layout - Please Help!
I saw such behavior without caching - it will happen if fatal error occurs after (or during) content render but before layout render. "Every once in a while" behavior I got with execution time limit exceeded because of too heavy load on dev server - this is fatal error too. Don't know can this help you, but its the only I know about such problem. On Jul 21, 11:48 pm, Matthew wrote: > I have a CakePHP site whose homepage is cached for 10 minutes at a > time using Cake's default options. However I've been alerted that > "every once in a while", once a day or so, it's losing the layout, > just displaying the page content without the header, styling etc. > > Removing the cached version and regenerating the page apparently fixes > the problem. But why would/could this be happening in the first place? > I can't say I've seen it happen myself (in any of my CakePHP projects) > but asking around on the internet, other developers say they've > definitely seen it happen, usually only in development - but that's > still a big cause for concern, especially as no-one seems to know > why > > Many thanks for your help! -- 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
CakePHP Pages Occasionally Losing Layout - Please Help!
I have a CakePHP site whose homepage is cached for 10 minutes at a time using Cake's default options. However I've been alerted that "every once in a while", once a day or so, it's losing the layout, just displaying the page content without the header, styling etc. Removing the cached version and regenerating the page apparently fixes the problem. But why would/could this be happening in the first place? I can't say I've seen it happen myself (in any of my CakePHP projects) but asking around on the internet, other developers say they've definitely seen it happen, usually only in development - but that's still a big cause for concern, especially as no-one seems to know why Many thanks for your help! -- 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: data from models onto pages.. e.g. /pages/home etc
This goes back to the convention of Fat Models and Skinny Controllers. Create an action in each of your models which are going to display data on your Dashboard page and call them from whichever controller you are using to ultimately display the dashboard (can be a dashboard controller without a table if needs be, or an action in your pages controller I suppose). You can be clever with your existing model associations to reach other models, by doing deep calls: $this->Model1->Model2->Model3->dashboard(); But if you want access to unassocicated models you can use Controller::loadModel() or ClassRegistry->init() to get at them. Related post: http://milesj.me/blog/read/16/loading-models-specific-to-certain-actions HTH, Paul. On Jul 8, 7:55 am, elogic wrote: > Hi All, > > How do I go about calling data from models within my system onto the > standard pages? I have built an intranet with models such as accounts, > users, groups, properties and now I want to create a dashboard / > homepage (it is /pages/dashboard). I have the blank page but I want to > call stuff from those other models on to this page. > > How do I do this? > > Thanks -- 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
data from models onto pages.. e.g. /pages/home etc
Hi All, How do I go about calling data from models within my system onto the standard pages? I have built an intranet with models such as accounts, users, groups, properties and now I want to create a dashboard / homepage (it is /pages/dashboard). I have the blank page but I want to call stuff from those other models on to this page. How do I do this? Thanks -- 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
NoCaching Small Model-Data-Driven Parts of Pages?
I want to employ CakePHP's basic caching functionality on my site's home page. However, there is one element on the page that should display different data depending on the visitor's location, as determined by their IP address. You can't wrap around variables that are set in the controller, which is where I was previously determining the location and getting the data. My question therefore is: where can I optimally set a (session?) variable to contain visitor location information before the controller? How can I use this information to populate an array of data for the nocached portion of the view, while completely sidestepping the controller action, which is no longer being called? Any advice greatly appreciated! -- View this message in context: http://cakephp.1045679.n5.nabble.com/NoCaching-Small-Model-Data-Driven-Parts-of-Pages-tp4521784p4521784.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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: Using Pages
That's what I thought. I originally tried it that way but I still got the page not found error. I've gone back and reviewed the API and have even tried modifying the router with a tip I found here http://richardathome.wordpress.com/2007/08/13/cakephp-tip-routing-for-static-pages/ But I'm still having trouble. -- 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: Using Pages
you don't need to create an action just view domain.com/pages/test Andras Kende On Jun 15, 2011, at 10:49 PM, brandon buster wrote: > I'm just trying to run a quick and dirty test on my site and I thought > it would be best to use pages for it. > > I've created a page called test.ctp in the views/pages folder and a > new action called test in the pages controller. > > But I keep getting a page not found error. > > Am I missing anything? > > -- > 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
Using Pages
I'm just trying to run a quick and dirty test on my site and I thought it would be best to use pages for it. I've created a page called test.ctp in the views/pages folder and a new action called test in the pages controller. But I keep getting a page not found error. Am I missing anything? -- 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: Little bit lost in space - trying to handle static pages
Hi, $this->Session->setFlash(__('Please enter the correct answer to the math question.', true)); How can I add this to be within the form validation error array? -- 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: Little bit lost in space - trying to handle static pages
"Sounds like the Html helper is not loaded." Yes, I added the HTML helper and now it works!! Thanks!! @Euromark, I added a contacts table to get the files baked and just changed the index funktion, and its working now! Danke!! On 10 Jun., 13:50, euromark wrote: > class ContactsController extends AppController { > var $name = 'Contact'; > .. > > that doesnt work!! > > class ContactController + $name = Contact > > On 10 Jun., 13:01, Ryan Schmidt wrote: > > > > > On Jun 10, 2011, at 03:15, heohni wrote: > > > > I always get the error > > > Undefined property: View::$Html [APP\views\layouts\default.ctp, line > > > 4] > > > Fatal error: Call to a member function charset() on a non-object in D: > > > \SVN-Homes\PHP\trunk\My-project\views\layouts\default.ctp on line 4 > > > > This line 4 is Html->charset(); ?> > > > Sounds like the Html helper is not loaded. Since this is being used in the > > default template, you probably want the Html helper loaded always, i.e. in > > your app_controller, possibly along with other helpers you plan to use > > everywhere: > > > class AppController extends Controller { > > var $helpers = array('Html', 'Session', ...); > > > } -- 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: Little bit lost in space - trying to handle static pages
class ContactsController extends AppController { var $name = 'Contact'; .. that doesnt work!! class ContactController + $name = Contact On 10 Jun., 13:01, Ryan Schmidt wrote: > On Jun 10, 2011, at 03:15, heohni wrote: > > > I always get the error > > Undefined property: View::$Html [APP\views\layouts\default.ctp, line > > 4] > > Fatal error: Call to a member function charset() on a non-object in D: > > \SVN-Homes\PHP\trunk\My-project\views\layouts\default.ctp on line 4 > > > This line 4 is Html->charset(); ?> > > Sounds like the Html helper is not loaded. Since this is being used in the > default template, you probably want the Html helper loaded always, i.e. in > your app_controller, possibly along with other helpers you plan to use > everywhere: > > class AppController extends Controller { > var $helpers = array('Html', 'Session', ...); > > > > > > > > } -- 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: Little bit lost in space - trying to handle static pages
On Jun 10, 2011, at 03:15, heohni wrote: > I always get the error > Undefined property: View::$Html [APP\views\layouts\default.ctp, line > 4] > Fatal error: Call to a member function charset() on a non-object in D: > \SVN-Homes\PHP\trunk\My-project\views\layouts\default.ctp on line 4 > > This line 4 is Html->charset(); ?> Sounds like the Html helper is not loaded. Since this is being used in the default template, you probably want the Html helper loaded always, i.e. in your app_controller, possibly along with other helpers you plan to use everywhere: class AppController extends Controller { var $helpers = array('Html', 'Session', ...); } -- 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: Little bit lost in space - trying to handle static pages
Just a further note: When I add a echo "buh"; into the contact index(); I get the output just before all the error lines. If I call the echo $this->MathCaptcha->generateEquation(); I also get the output... So for some reason my templates are not getting parsed... But I don't understand why. here is my default.ctp http://www.w3.org/1999/xhtml";> Html->charset(); ?> Html->meta('icon'); echo $this->Html->css('style'); echo $this->Html->css('jquery.lightbox-0.5.css'); echo $this->Html->css('http://fonts.googleapis.com/css? family=Cabin:regular,bold'); echo $this->Html->script(array('jquery', 'jqueryactions', 'jquery.lightbox-0.5')); echo $scripts_for_layout; ?> element('flags'); ?> link($html- >image('logo.jpg'), array(), array('escape' => false));?> element('navigation'); ?> Session->flash(); ?> element('footer'); ?> element('mainnavigation'); ?> element('addresses'); ?> element('sql_dump'); ?> -- 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: Little bit lost in space - trying to handle static pages
And default.ctp? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 10 Jun 2011, at 09:30, heohni wrote: > class ContactsController extends AppController { >var $name = 'Contact'; >var $uses = 'Contact'; >var $components = array('Email', 'MathCaptcha'); > >function index() { >if ($this->RequestHandler->isPost()) { >$this->Contact->set($this->data); >if ($this->MathCaptcha->validates($this->data['Contact'] > ['security_code'])) { >if ($this->Contact->validates()) { >$this->Email->to = > Configure::read('SiteSettings.email_form_address'); >$this->Email->subject = 'Contact from message from > ' . $this->data['Contact']['name']; >$this->Email->from = $this->data['Contact'] > ['email']; > >$this->Email->send($this->data['Contact'] > ['comments']); >} >} else { >$this->Session->setFlash(__('Please enter the correct > answer to the math question.', true)); >} >} > >$this->set('mathCaptcha', $this->MathCaptcha- >> generateEquation()); >} > } > ?> > > -- > 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: Little bit lost in space - trying to handle static pages
RequestHandler->isPost()) { $this->Contact->set($this->data); if ($this->MathCaptcha->validates($this->data['Contact'] ['security_code'])) { if ($this->Contact->validates()) { $this->Email->to = Configure::read('SiteSettings.email_form_address'); $this->Email->subject = 'Contact from message from ' . $this->data['Contact']['name']; $this->Email->from = $this->data['Contact'] ['email']; $this->Email->send($this->data['Contact'] ['comments']); } } else { $this->Session->setFlash(__('Please enter the correct answer to the math question.', true)); } } $this->set('mathCaptcha', $this->MathCaptcha- >generateEquation()); } } ?> -- 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: Little bit lost in space - trying to handle static pages
RequestHandler->isPost()) { $this->Contact->set($this->data); if ($this->MathCaptcha->validates($this->data['Contact'] ['security_code'])) { if ($this->Contact->validates()) { //$this->Email->to = Configure::read('SiteSettings.email_form_address'); $this->Email->to = 'heidi.anselstet...@consultingteam.de'; $this->Email->subject = 'Contact from message from ' . $this->data['Contact']['name']; $this->Email->from = $this->data['Contact'] ['email']; $this->Email->send($this->data['Contact'] ['comments']); } } else { $this->Session->setFlash(__('Please enter the correct answer to the math question.', true)); } } $this->set('mathCaptcha', $this->MathCaptcha- >generateEquation()); } } ?> -- 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: Little bit lost in space - trying to handle static pages
What's in your contacts_controller.php? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 10 Jun 2011, at 09:15, heohni wrote: > Hi, > > I started a project with many static pages which I get working routing > them in routes.php like > Router::connect('/aboutus', array('controller' => 'pages', 'action' => > 'display', 'aboutus')); > > Fine so far. > > Now I wanted to have a contact page with this math captcha: > http://bakery.cakephp.org/articles/jnay/2010/01/20/simple-math-question-captcha-component > > So I added > controllers/contacts_controller.php > controllers/components/math-captcha.php > models/contact.php > views/contacts/index.ctp > > When I call now in my browser: http://localhost/my-project/contacts > > I always get the error > Undefined property: View::$Html [APP\views\layouts\default.ctp, line > 4] > Fatal error: Call to a member function charset() on a non-object in D: > \SVN-Homes\PHP\trunk\My-project\views\layouts\default.ctp on line 4 > > This line 4 is Html->charset(); ?> > > Whats wrong here? > What I am doing wrong? > I have a model, a controller, a view... > > Why I dont get the right page? > I am really really lost now... > > -- > 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
Little bit lost in space - trying to handle static pages
Hi, I started a project with many static pages which I get working routing them in routes.php like Router::connect('/aboutus', array('controller' => 'pages', 'action' => 'display', 'aboutus')); Fine so far. Now I wanted to have a contact page with this math captcha: http://bakery.cakephp.org/articles/jnay/2010/01/20/simple-math-question-captcha-component So I added controllers/contacts_controller.php controllers/components/math-captcha.php models/contact.php views/contacts/index.ctp When I call now in my browser: http://localhost/my-project/contacts I always get the error Undefined property: View::$Html [APP\views\layouts\default.ctp, line 4] Fatal error: Call to a member function charset() on a non-object in D: \SVN-Homes\PHP\trunk\My-project\views\layouts\default.ctp on line 4 This line 4 is Html->charset(); ?> Whats wrong here? What I am doing wrong? I have a model, a controller, a view... Why I dont get the right page? I am really really lost now... -- 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: What is the way to make Sub Pages
Is www.example.com/datas/data-title<http://www.example.com/datas/data-title>will contain intro to only one article? If www.example.com/datas/data-title/about-this is not too long fetch it hide it and show it when the user click the 'more... ' link. If its big, create two actions in the posts_controller. Summary ad Details. Fetch the data for each of these actions . On Wed, Jun 1, 2011 at 7:26 PM, Mr.Jayesh wrote: > Hi Mates, > > Am working on a project on which I require your advice. > I am thinking to split a row data to couple of pages. For example: > > Main landing page for row data: > www.example.com/datas/data-title (currently this page displays full > data from particular row) > > What I want looking for is: > www.example.com/datas/data-title (would contain intro texts) > www.example.com/datas/data-title/about-this (some more data from same > row.) > > So, would invite your advice and input on this. > > Thanks in Advance. > > Happy Baking > > -- > 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: What is the way to make Sub Pages
> Am working on a project on which I require your advice. > I am thinking to split a row data to couple of pages. For example: > > Main landing page for row data: > www.example.com/datas/data-title (currently this page displays full > data from particular row) > > What I want looking for is: > www.example.com/datas/data-title (would contain intro texts) > www.example.com/datas/data-title/about-this (some more data from same > row.) > > So, would invite your advice and input on this. Why not use the Tree behaviour to create the parent/child records? www.example.com/page/about <- top level page www.example.com/page/about/clients <- page that is a child of 'about' You can test this working without any extra routing by going to: www.example.com/pages/view/about/clients - provided your model is Page and your display method is view - have a look at the stop pages controller, it uses func_get_args, you could just look for the final item. Cheers, J -- jon bennett - www.jben.net - blog.jben.net -- 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
What is the way to make Sub Pages
Hi Mates, Am working on a project on which I require your advice. I am thinking to split a row data to couple of pages. For example: Main landing page for row data: www.example.com/datas/data-title (currently this page displays full data from particular row) What I want looking for is: www.example.com/datas/data-title (would contain intro texts) www.example.com/datas/data-title/about-this (some more data from same row.) So, would invite your advice and input on this. Thanks in Advance. Happy Baking -- 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: do i need to create a controller for all pages in \views\pages\ folder
Hi thanks a lot to all of you. Yes, i do have a long way to go in mastering cakePHP. The static page is working fine once i placed it in pages folder. :) On Apr 29, 2:48 am, cricket wrote: > On Thu, Apr 28, 2011 at 11:49 AM, Jeremy Burns | Class Outfit > > wrote: > > Really wrong. Please read the guide, even if the Blog tutorial isn't right > > for you. Start here: http://book.cakephp.org/view/958/The-Pages-Controller. > > What you are trying to do is one of the most basic things and you are way > > off line. > > Although, granted, it's easy to see how it could be confusing. > > varai, if you want to include static, full HTML pages put them under > app/webroot. You can even have a deep directory structure, eg > > app/webroot/foo.bar.html > > You would access this with: > > http://www.domain.com/foo/bar.html > > Take a close look at the rewrite rules in the .htaccess files. What > they do is check if the requested URL is for an existing file or > directory under app/webroot. If so, it serves that, other wise it > passes the request to index.php, which in turn passes it to > Dispatcher. It's the latter which is complaining that the request > doesn't make sense. > > If you want your static pages to use an existing layout then you need > to change the static pages into templates. In that case, you'd use the > PagesController and put your various pages in the app/views/pages > directory. -- 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: do i need to create a controller for all pages in \views\pages\ folder
On Thu, Apr 28, 2011 at 11:49 AM, Jeremy Burns | Class Outfit wrote: > Really wrong. Please read the guide, even if the Blog tutorial isn't right > for you. Start here: http://book.cakephp.org/view/958/The-Pages-Controller. > What you are trying to do is one of the most basic things and you are way > off line. Although, granted, it's easy to see how it could be confusing. varai, if you want to include static, full HTML pages put them under app/webroot. You can even have a deep directory structure, eg app/webroot/foo.bar.html You would access this with: http://www.domain.com/foo/bar.html Take a close look at the rewrite rules in the .htaccess files. What they do is check if the requested URL is for an existing file or directory under app/webroot. If so, it serves that, other wise it passes the request to index.php, which in turn passes it to Dispatcher. It's the latter which is complaining that the request doesn't make sense. If you want your static pages to use an existing layout then you need to change the static pages into templates. In that case, you'd use the PagesController and put your various pages in the app/views/pages directory. -- 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: do i need to create a controller for all pages in \views\pages\ folder
Really wrong. Please read the guide, even if the Blog tutorial isn't right for you. Start here: http://book.cakephp.org/view/958/The-Pages-Controller. What you are trying to do is one of the most basic things and you are way off line. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 28 Apr 2011, at 16:42, varai wrote: > Yes, I had already gone through the Blog tutorial. But that doesn't > have a static page (just to display info). What I'm trying to do is > similar to contents of about page. > > I tried creating a missing_controller.ctp with no contents as below: > class Missing_Controller extends AppController { > } > ?> > and i'm not getting any errors now. > > thanks. :) > > On Apr 27, 3:24 pm, Jeremy Burns | Class Outfit > wrote: >> You really need to read the guide...what are you are doing is not utilising >> Cake at all. Follow the Blog tutorial:http://book.cakephp.org/view/1528/Blog >> >> Jeremy Burns >> Class Outfit >> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com >> >> On 27 Apr 2011, at 08:21, varai wrote: >> >> >> >>> Hi, >> >>> Is it necessary to create a controller for each page in \views\pages\ >>> folder? >> >>> I have this static page Preschool.html. And I'm getting the following >>> error message: >>> Missing Controller >>> Error: Preschool.htmlController could not be found. >> >>> Error: Create the class Preschool.htmlController below in file: >>> merry_flowers\controllers\preschool.html_controller.php >> >>> >> class Preschool.htmlController extends AppController { >> >>>var $name = 'Preschool.html'; >>> } >>> ?> >>> Notice: If you want to customize this error message, create >>> merry_flowers\views\errors\missing_controller.ctp >> >>> Even after creating a controller with the above name and contents, i'm >>> still getting the same Missing Controller message. >> >>> As the notice says, if I create missing_controller.ctp, what should >>> the contents be? >> >>> Please help me. I'm cluelessI'm new to cakephp. >> >>> thank you. >> >>> -- >>> Our newest site for the community: CakePHP Video >>> Tutorialshttp://tv.cakephp.org >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 >>> athttp://groups.google.com/group/cake-php- Hide quoted text - >> >> - Show quoted text - > > -- > 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: do i need to create a controller for all pages in \views\pages\ folder
Yes, I had already gone through the Blog tutorial. But that doesn't have a static page (just to display info). What I'm trying to do is similar to contents of about page. I tried creating a missing_controller.ctp with no contents as below: and i'm not getting any errors now. thanks. :) On Apr 27, 3:24 pm, Jeremy Burns | Class Outfit wrote: > You really need to read the guide...what are you are doing is not utilising > Cake at all. Follow the Blog tutorial:http://book.cakephp.org/view/1528/Blog > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 27 Apr 2011, at 08:21, varai wrote: > > > > > Hi, > > > Is it necessary to create a controller for each page in \views\pages\ > > folder? > > > I have this static page Preschool.html. And I'm getting the following > > error message: > > Missing Controller > > Error: Preschool.htmlController could not be found. > > > Error: Create the class Preschool.htmlController below in file: > > merry_flowers\controllers\preschool.html_controller.php > > > > class Preschool.htmlController extends AppController { > > > var $name = 'Preschool.html'; > > } > > ?> > > Notice: If you want to customize this error message, create > > merry_flowers\views\errors\missing_controller.ctp > > > Even after creating a controller with the above name and contents, i'm > > still getting the same Missing Controller message. > > > As the notice says, if I create missing_controller.ctp, what should > > the contents be? > > > Please help me. I'm cluelessI'm new to cakephp. > > > thank you. > > > -- > > Our newest site for the community: CakePHP Video > > Tutorialshttp://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 > > athttp://groups.google.com/group/cake-php- Hide quoted text - > > - Show quoted text - -- 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: do i need to create a controller for all pages in \views\pages\ folder
You really need to read the guide...what are you are doing is not utilising Cake at all. Follow the Blog tutorial: http://book.cakephp.org/view/1528/Blog Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 27 Apr 2011, at 08:21, varai wrote: > Hi, > > Is it necessary to create a controller for each page in \views\pages\ > folder? > > I have this static page Preschool.html. And I'm getting the following > error message: > Missing Controller > Error: Preschool.htmlController could not be found. > > Error: Create the class Preschool.htmlController below in file: > merry_flowers\controllers\preschool.html_controller.php > > class Preschool.htmlController extends AppController { > > var $name = 'Preschool.html'; > } > ?> > Notice: If you want to customize this error message, create > merry_flowers\views\errors\missing_controller.ctp > > Even after creating a controller with the above name and contents, i'm > still getting the same Missing Controller message. > > As the notice says, if I create missing_controller.ctp, what should > the contents be? > > Please help me. I'm cluelessI'm new to cakephp. > > thank you. > > -- > 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
do i need to create a controller for all pages in \views\pages\ folder
Hi, Is it necessary to create a controller for each page in \views\pages\ folder? I have this static page Preschool.html. And I'm getting the following error message: Missing Controller Error: Preschool.htmlController could not be found. Error: Create the class Preschool.htmlController below in file: merry_flowers\controllers\preschool.html_controller.php Notice: If you want to customize this error message, create merry_flowers\views\errors\missing_controller.ctp Even after creating a controller with the above name and contents, i'm still getting the same Missing Controller message. As the notice says, if I create missing_controller.ctp, what should the contents be? Please help me. I'm cluelessI'm new to cakephp. thank you. -- 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: My Links Pages
On Apr 8, 2011, at 04:01, dvvbrook79 wrote: > On Apr 8, 4:52 am, Ryan Schmidt wrote: >> On Apr 7, 2011, at 09:38, dvvbrook79 wrote: >>> http://www.disneyvillavacations.com/links/travel_services/page:1 >> >> Ok, I've taken a look at that page, but I didn't understand what you wanted >> to change about it. > > Basically as you can see when you go to this page there is page after > page of travel service links...but what i want to do is have these > numbered pages show up at the bottom of the home page, so that if a > user clicks it, it will take them straight to the travel services page > ex page1,page2,page3 and so onso the bottom of the home page would > then look like this.. > > Travel Services: 1_2_3_4_5_6_7_8_9 (and so on) > > and obviously i would need a break in there so it would start a new > line, otherwise i would just have a long list of numbers in one > line... Your links controller's travel_services action contains code that fetches and paginates the data. Copy that code to whatever controller action is generating your home page. If your home page is currently being generated by the pages controller, then you'll probably want to change it to be generated by some other controller that you are in charge of (rather than the pages controller, whose code is part of the CakePHP core and is not meant to be modified, and is meant for static pages that don't fetch data). The view that the links controller's travel_services action uses contains code that displays a page of data, and the page number links. Copy the part of the code that displays the page number links (but not the part that displays the page of data) to your home page's view. However I'm not sure this will be useful to a user. If a user comes to your home page and sees "Travel Services: 1 2 3 4 5 6 7 8 9" how is the user meant to know what to click? Why is this more helpful than just displaying a single link "Travel Services"? -- 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: My Links Pages
Hi Ryan, Thanks for taking a look Basically as you can see when you go to this page there is page after page of travel service links...but what i want to do is have these numbered pages show up at the bottom of the home page, so that if a user clicks it, it will take them straight to the travel services page ex page1,page2,page3 and so onso the bottom of the home page would then look like this.. Travel Services: 1_2_3_4_5_6_7_8_9 (and so on) and obviously i would need a break in there so it would start a new line, otherwise i would just have a long list of numbers in one line... Hope i explained it a little better, and hope you can help and point me in the right direction. Kind Regards brook On Apr 8, 4:52 am, Ryan Schmidt wrote: > On Apr 7, 2011, at 09:38, dvvbrook79 wrote: > > > Im fairly new to cakephp and php, but im learning fast. Im helping a > > friend do some minor updates to his website, and have come stuck, > > basically the links page (and system needs updating) needs sorting > > out. > > > What im trying to do is im trying to get all the links pages to > > display on the home page, (ex: 1,2,3,4,5,6) without the user having to > > click the links button first and then travel services and then through > > each page...Obviously it would be alot easier if the user could just > > click on the page numbers. Heres the link so you can see > > >http://www.disneyvillavacations.com/links/travel_services/page:1 > > Ok, I've taken a look at that page, but I didn't understand what you wanted > to change about it. -- 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: My Links Pages
On Apr 7, 2011, at 09:38, dvvbrook79 wrote: > Im fairly new to cakephp and php, but im learning fast. Im helping a > friend do some minor updates to his website, and have come stuck, > basically the links page (and system needs updating) needs sorting > out. > > What im trying to do is im trying to get all the links pages to > display on the home page, (ex: 1,2,3,4,5,6) without the user having to > click the links button first and then travel services and then through > each page...Obviously it would be alot easier if the user could just > click on the page numbers. Heres the link so you can see > > http://www.disneyvillavacations.com/links/travel_services/page:1 Ok, I've taken a look at that page, but I didn't understand what you wanted to change about it. -- 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
My Links Pages
Hi everyone, Im fairly new to cakephp and php, but im learning fast. Im helping a friend do some minor updates to his website, and have come stuck, basically the links page (and system needs updating) needs sorting out. What im trying to do is im trying to get all the links pages to display on the home page, (ex: 1,2,3,4,5,6) without the user having to click the links button first and then travel services and then through each page...Obviously it would be alot easier if the user could just click on the page numbers. Heres the link so you can see http://www.disneyvillavacations.com/links/travel_services/page:1 I know its something quite simple but i just cant get me head round it. Could anyone point me in the right direction?? thanks in advance for the assistance Brook -- 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: Add Wordpress posts and pages from CakePHP
Enable XML-RPC and then do something like function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='UTF-8') { $title = htmlentities($title,ENT_NOQUOTES,$encoding); $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding); $content = array( 'title'=>$title, 'description'=>$body, 'mt_allow_comments'=>0, // 1 to allow comments 'mt_allow_pings'=>0, // 1 to allow trackbacks 'post_type'=>'post', 'mt_keywords'=>$keywords, 'categories'=>array($category) ); $params = array(0,$username,$password,$content,true); $request = xmlrpc_encode_request('metaWeblog.newPost',$params); $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_URL, $rpcurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 1); $results = curl_exec($ch); curl_close($ch); return $results; } The above uses cURL you can try using the builtin http class HTH Tarique On Wed, Apr 6, 2011 at 10:44 PM, alberto wrote: > > Hi! > I would like to have the possibility to add posts and pages to > Wordpress from CakePHP. > > How can I do that? > > Thanks in advance! > > Alberto > > -- > 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 -- = PHP for E-Biz: http://sanisoft.com = -- 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
Add Wordpress posts and pages from CakePHP
Hi! I would like to have the possibility to add posts and pages to Wordpress from CakePHP. How can I do that? Thanks in advance! Alberto -- 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 Hide Model name from URL of Search Result Pages
Hi Adael; Hi Miles, I am not very thorough in this regards, I was trying to build a Advanced search form for my site. I am using $this->passedArgs. The controller code for this function is as under: if (!empty($this->passedArgs)) { if(isset($this->passedArgs['Medicine.keyword'])) { $keyword = $this->passedArgs['Medicine.keyword']; $this->data['Medicine']['keyword'] = $keyword; $this->set('keyword'); } else { $keyword = null; } if(isset($this->passedArgs['Medicine.author_id'])) { $author = $this->passedArgs['Medicine.author_id']; $this->data['Medicine']['author_id'] = $author; $this->set('author'); } else { $author = null; } if(isset($this->passedArgs['Medicine.field'])) { $area = $this->passedArgs['Medicine.field']; $this->data['field']['field'] = $area; $this->set('area'); } else { $area = null; } $conditions = array( "Medicine.author_id LIKE" => "%$author%", "Medicine.field LIKE" => "%$area%", "or" => array( "Medicine.name LIKE" => "%$keyword%", "Medicine.description LIKE" => "%$keyword%" )) ; } else { $this- >redirect(array('controller'=>'medicines','action'=>'search')); } Please, anyone advice me a direction for getting proper url of search. Regards, Jayesh On Mar 15, 3:45 am, Miles J wrote: > What are you using to generate the named params? > > On Mar 14, 2:15 pm, Adael wrote: > > > > > > > > > You can do the following:http://pastebin.com/JAup00Hn > > > On 14 mar, 20:00, "Mr.Jayesh" wrote: > > > > Hello Everyone, > > > Hope things Great.. > > > > Anyone please advice me a quick solution from which i can hide model > > > name from my URL created out of search string. > > > > currently my url looks > > > like:http://my.website.com/medical/results/Medicine.search:cancer/Medicine... > > > > I wanted it to be like > > > this:http://my.website.com/medical/results/search:cancer/author_id:5 > > > > Thanks in advance. > > > Regards. -- 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 Hide Model name from URL of Search Result Pages
What are you using to generate the named params? On Mar 14, 2:15 pm, Adael wrote: > You can do the following:http://pastebin.com/JAup00Hn > > On 14 mar, 20:00, "Mr.Jayesh" wrote: > > > Hello Everyone, > > Hope things Great.. > > > Anyone please advice me a quick solution from which i can hide model > > name from my URL created out of search string. > > > currently my url looks > > like:http://my.website.com/medical/results/Medicine.search:cancer/Medicine... > > > I wanted it to be like > > this:http://my.website.com/medical/results/search:cancer/author_id:5 > > > Thanks in advance. > > Regards. -- 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 Hide Model name from URL of Search Result Pages
You can do the following: http://pastebin.com/JAup00Hn On 14 mar, 20:00, "Mr.Jayesh" wrote: > Hello Everyone, > Hope things Great.. > > Anyone please advice me a quick solution from which i can hide model > name from my URL created out of search string. > > currently my url looks > like:http://my.website.com/medical/results/Medicine.search:cancer/Medicine... > > I wanted it to be like > this:http://my.website.com/medical/results/search:cancer/author_id:5 > > Thanks in advance. > Regards. -- 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 Hide Model name from URL of Search Result Pages
Hello Everyone, Hope things Great.. Anyone please advice me a quick solution from which i can hide model name from my URL created out of search string. currently my url looks like: http://my.website.com/medical/results/Medicine.search:cancer/Medicine.author_id:5 I wanted it to be like this: http://my.website.com/medical/results/search:cancer/author_id:5 Thanks in advance. Regards. -- 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