How to Manage Multidimensional Array in Cakephp
hi i m going to develop an application in which i have to manage each items one bye one even i have to make total of each items how do i manage --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL/AUTH redirecting.
With the ACL/Auth set up, is there a way to redirect to a specific view in the event of a user who is logged in but does not have permission to a particular action? I believe by default, it redirects to the login page. What I would like to accomplish are: 1. If the user is not logged in and tries to access a restricted area, he will be redirected to the login page. 2. If he is logged in but without the proper access permission, he will be redirected to a page that says something like "You do not have access permission to do that." Currently in both the above scenarios, the user is redirected to the login page. My AuthComponent configuration is as follows: $this->Auth->actionPath = 'controllers/'; $this->Auth->authorize = 'actions'; $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login'); $this->Auth->loginRedirect = array('controller' => 'media_centers', 'action' => 'index'); Thanks in advance for your help. Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to clear element cache?
So I've been reading documentation and looking through source and API and I thought I'm doing the clearing of cache correctly but I'm a little stumped as to why my element cache is not being cleared. I have a blog controller and whenever I add or edit a blog I want the element->latest_news to be cleared from the cache. So I do something like this in the controller: if($Blog->save($this->data)){ $this->clear_cache(); // --- other stuff } private function clear_cache(){ Cache::delete('latest_news'); } But the tmp/view/elements/element__latest_news file is still there. I'm apparently doing something wrong, maybe because its 1 in the morning and I've had a drink or two but I'm stumped. Help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DebugKit plugin: not available for Windows users?
You can download the Debug Kit from: http://thechaw.com/debug_kit/versions Comments about Chaw can be posted on: http://groups.google.com/group/chaw --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Collecting data from array depending on Association
On Feb 6, 7:57 pm, "abergs.and...@gmail.com" wrote: > Hello! > > Im been at this for hours and hanging in the IRC channel, without > getting the final solution. > I want to share events between users... > > **I have these relations: > User hasmany Event > Event HABTM User > > **I have these tables > [events] > -id > -user_id > -title > > [users] > -id > -email > -and some other columns thats not interesting > > [events_users] > -id > -event_id > -user_id > -group_id (not used at the moment) It sounds like you just need the User HABTM Events. Having a user_id in Event is redundant since you have the HABTM relationship. Also, I highly suggest removing the 'id' field in events_users and simply make both 'event_id' and 'user_id' primary keys. > What i want to do with this array is that i want to collect those > Events that has user_id = 12. Which normally is 'id':9 and 26. Though > id 23 is shared to user_id 12. Therefore i want to collect it aswell! If you're just wanting events for user id of 12, then try this (provided your relationships are defined properly in the model): $this- >set('events', $this->Event->find('all', array('conditions' => array ('User.id' => 12), 'recursive' => 1))); If you are intentionally wanting all records to begin with and are looking to grab certain parts of the array, look into the Set Utility Library: http://book.cakephp.org/view/640/Set --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with linked image swap
use the html helper : http://book.cakephp.org/view/206/Inserting-Well-Formatted-elements image(string $path, array $htmlAttributes = array()) in your view (inside a php block) echo $html->image( "menu1.jpg", array( "onmouseover"=>"yourJsRollOverFunc()", "onclick"=>"jsFunc()", "class"=>"mycssclass" ) ); wrap the php block with your link... this should do the trick On Feb 6, 10:14 pm, Zolthar wrote: > Learning cake/programming for the first time so please excuse me if > this is a very noob question. I have tried to search this board > without much success - as the responses were either too complicated or > possibly I searching with the wrong keywords. > > What I am after is how do I get a linked image to swap like > onmouseover using javascripts (or any other option)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Collecting data from array depending on Association
in case you don't find the "good" way ti do it i suggest you to create a custom model method using $this->query('your custom query') On Feb 6, 7:57 pm, "abergs.and...@gmail.com" wrote: > Hello! > > Im been at this for hours and hanging in the IRC channel, without > getting the final solution. > I want to share events between users... > > **I have these relations: > User hasmany Event > Event HABTM User > > **I have these tables > [events] > -id > -user_id > -title > > [users] > -id > -email > -and some other columns thats not interesting > > [events_users] > -id > -event_id > -user_id > -group_id (not used at the moment) > > When i perform > $this->set('events', $this->Event->find('all')); > > I get this result: > (this is $events) > > Array ( > [0] => Array ( [Event] => Array ( [id] => 9 [user_id] => 12 [title] => > asdadg ) [User] => Array ( ) ) > [1] => Array ( [Event] => Array ( [id] => 12 [user_id] => 28 [title] > => Clllmaann ) [User] => Array ( ) ) > [2] => Array ( [Event] => Array ( [id] => 23 [user_id] => 13 [title] > => hehe, NOT SO FUNNY! ) > [User] => Array ( [0] => Array ( [id] => 12 [email] => aberg > [password] => 5b1fb8132b0dee40ed8aec0e0049fb005f612e55 [fname] => > [ename] => [status] => 0 > [EventsUser] => Array ( [id] => 1 [event_id] => 23 [user_id] => 12 > [group_id] => 0 ) ) ) ) > [3] => Array ( [Event] => Array ( [id] => 26 [user_id] => 12 [title] > => OBOYOYOYOYOY12 ) [User] => Array ( ) ) ) 1 > > - > What i want to do with this array is that i want to collect those > Events that has user_id = 12. Which normally is 'id':9 and 26. Though > id 23 is shared to user_id 12. Therefore i want to collect it aswell! > > I dont know how to do this and have been searching for hours... > > Any help is greatly appreciated and i hope this can help others that > have the same problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Output is not showing, but database is updated
try to debug something like: controller: $tasks = $this->Task->find('all'); print_r($tasks); $this->set('tasks', $tasks); view: Andras On Feb 6, 2009, at 11:39 PM, abhishek wrote: > > I am writing a simple TASK application: with 1 model, 1 controller,and > 2 views. > In the application, you can add a task and it shows a list of all the > tasks. > > my problem is I am not getting the output shown in the index view. > Database is being updated fine, which means it is working I don't know > why the data is not showing in the index view. > > Thanks a lot. > > My database: > CREATE TABLE tasks( > id int(10) unsigned NOT NULL auto_increment, > title varchar(255) NOT NULL, > done tinyint(1) default NULL, > created datetime default NULL, > modified datetime default NULL, > PRIMARY KEY (id) > ); > > MODEL > class Task extends AppModel{ > var $name = 'Task'; > } > ?> > > > THE CONTROLLER > class TasksController extends AppController{ > > var $name = 'Tasks'; > var $helpers = array('Html', 'Form'); > function index(){ > $this->set('tasks', $this->Task->find('all')); > > } > >function add(){ >if (!empty($this->data)){ >$this->Task->create(); >if ($this->Task->save($this->data)){ >$this->Session->setFlash('Task has been saved'); >$this->redirect(array('action'=>'index'),null, true); > >}else{ >$this->Session->setFlash('Task not saved. Try > again.'); >} >} > >} > } > ?> > > VIEW INDEX > > TASKS > > There are no tasks in this list > > > > > Title > Status > Created > Modified > Actions > > > > > > > > > >"Done"; > else echo "Pending"; > ?> > > > > > > > > > > > > > > > > > link('Add Task', array('action'=>'add')); ?> > > > VIEW ADD: > create('Task'); ?> > > > > >Add New Task > >echo $form->input('title'); >echo $form->input('done'); >?> > > end('Add Task');?> > > link('List All Task', array('action'=>'index')); ?> > > > > my problem is I am not getting the output shown in the index view. > Database is being updated. But it doesn't show in the view. > > > Andras Kende http://kende.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Output is not showing, but database is updated
What is the debug level? Set it to 2 if not and then look at SQL query 2009/2/7 abhishek > > I am writing a simple TASK application: with 1 model, 1 controller,and > 2 views. > In the application, you can add a task and it shows a list of all the > tasks. > > my problem is I am not getting the output shown in the index view. > Database is being updated fine, which means it is working I don't know > why the data is not showing in the index view. > > Thanks a lot. > > My database: > CREATE TABLE tasks( >id int(10) unsigned NOT NULL auto_increment, >title varchar(255) NOT NULL, >done tinyint(1) default NULL, >created datetime default NULL, >modified datetime default NULL, >PRIMARY KEY (id) > ); > > MODEL > class Task extends AppModel{ >var $name = 'Task'; > } > ?> > > > THE CONTROLLER > class TasksController extends AppController{ > >var $name = 'Tasks'; >var $helpers = array('Html', 'Form'); >function index(){ >$this->set('tasks', $this->Task->find('all')); > >} > >function add(){ >if (!empty($this->data)){ >$this->Task->create(); >if ($this->Task->save($this->data)){ >$this->Session->setFlash('Task has been saved'); >$this->redirect(array('action'=>'index'),null, true); > >}else{ >$this->Session->setFlash('Task not saved. Try > again.'); >} >} > >} > } > ?> > > VIEW INDEX > > TASKS > >There are no tasks in this list > > > > >Title >Status >Created >Modified >Actions > > > > > > > > > > "Done"; >else echo "Pending"; >?> > > > > > > > > > > > > > > > > > link('Add Task', array('action'=>'add')); ?> > > > VIEW ADD: > create('Task'); ?> > > > > >Add New Task > >echo $form->input('title'); >echo $form->input('done'); >?> > > end('Add Task');?> > > link('List All Task', array('action'=>'index')); ?> > > > > my problem is I am not getting the output shown in the index view. > Database is being updated. But it doesn't show in the view. > > > > -- Amit http://amitrb.wordpress.com/ http://coppermine-gallery.net/ http://cheesecake-photoblog.org/ http://www.sanisoft.com/blog/author/amitbadkas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Output is not showing, but database is updated
I am writing a simple TASK application: with 1 model, 1 controller,and 2 views. In the application, you can add a task and it shows a list of all the tasks. my problem is I am not getting the output shown in the index view. Database is being updated fine, which means it is working I don't know why the data is not showing in the index view. Thanks a lot. My database: CREATE TABLE tasks( id int(10) unsigned NOT NULL auto_increment, title varchar(255) NOT NULL, done tinyint(1) default NULL, created datetime default NULL, modified datetime default NULL, PRIMARY KEY (id) ); MODEL THE CONTROLLER set('tasks', $this->Task->find('all')); } function add(){ if (!empty($this->data)){ $this->Task->create(); if ($this->Task->save($this->data)){ $this->Session->setFlash('Task has been saved'); $this->redirect(array('action'=>'index'),null, true); }else{ $this->Session->setFlash('Task not saved. Try again.'); } } } } ?> VIEW INDEX TASKS There are no tasks in this list Title Status Created Modified Actions link('Add Task', array('action'=>'add')); ?> VIEW ADD: create('Task'); ?> Add New Task input('title'); echo $form->input('done'); ?> end('Add Task');?> link('List All Task', array('action'=>'index')); ?> my problem is I am not getting the output shown in the index view. Database is being updated. But it doesn't show in the view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DebugKit plugin: not available for Windows users?
Another vote here for Chaw needing a download link! On Feb 6, 7:43 pm, Matt Curry wrote: > The Git link Brandon referenced does work once you get everything > setup. I did it yesterday so I could download the API Plugin. It > would be nice if TheChaw had a download link like GitHub. I assume > it's forthcoming. > > Most of the changes from my forked version have been merged back into > the official one. I think the last few will be added eventually. I > probably won't keep my version up to date after that, but right now it > should be *relatively* close to the official one. > > -Matthttp://www.pseudocoder.com > > On Feb 6, 1:56 pm, BrendonKoz wrote: > > > Git installer for Windows:http://code.google.com/p/msysgit/ > > > Allows you to run Git from the Windows' command line. There's > > probably another way to get access to it as well, but I'm not really > > familiar with Git or TheChaw. Matt Curry's forked version > > (pseudocoder.com) is on GitHub which offers a download, but I'd highly > > recommend sticking with the official source, I only mention this as a > > possible temporary alternative until you can get access to the real > > source. > > > On Feb 6, 11:48 am, rcurzon wrote: > > > > I guess it would work fine in Windows... but you can't get it without > > > "git"... which isn't ready for Windows? Let me know if I missed > > > something please! > > > > -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help with linked image swap
Learning cake/programming for the first time so please excuse me if this is a very noob question. I have tried to search this board without much success - as the responses were either too complicated or possibly I searching with the wrong keywords. What I am after is how do I get a linked image to swap like onmouseover using javascripts (or any other option)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Collecting data from array depending on Association
Hello! Im been at this for hours and hanging in the IRC channel, without getting the final solution. I want to share events between users... **I have these relations: User hasmany Event Event HABTM User **I have these tables [events] -id -user_id -title [users] -id -email -and some other columns thats not interesting [events_users] -id -event_id -user_id -group_id (not used at the moment) When i perform $this->set('events', $this->Event->find('all')); I get this result: (this is $events) Array ( [0] => Array ( [Event] => Array ( [id] => 9 [user_id] => 12 [title] => asdadg ) [User] => Array ( ) ) [1] => Array ( [Event] => Array ( [id] => 12 [user_id] => 28 [title] => Clllmaann ) [User] => Array ( ) ) [2] => Array ( [Event] => Array ( [id] => 23 [user_id] => 13 [title] => hehe, NOT SO FUNNY! ) [User] => Array ( [0] => Array ( [id] => 12 [email] => aberg [password] => 5b1fb8132b0dee40ed8aec0e0049fb005f612e55 [fname] => [ename] => [status] => 0 [EventsUser] => Array ( [id] => 1 [event_id] => 23 [user_id] => 12 [group_id] => 0 ) ) ) ) [3] => Array ( [Event] => Array ( [id] => 26 [user_id] => 12 [title] => OBOYOYOYOYOY12 ) [User] => Array ( ) ) ) 1 - What i want to do with this array is that i want to collect those Events that has user_id = 12. Which normally is 'id':9 and 26. Though id 23 is shared to user_id 12. Therefore i want to collect it aswell! I dont know how to do this and have been searching for hours... Any help is greatly appreciated and i hope this can help others that have the same problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to use the Security Component in unit tests
Hi guys this is my first post here, and I've not been using Cake for long. I am writing some unit tests for the models a new application. For the most part it works well, however in my User model I use the cake security component to do some custom validation of a password confirmation. When I run the test using the validates method I get the following line: Fatal error: Class 'Security' not found in D:\Workspace\*application* \models\user.php on line 50 Here is some of the other code: File: user.php class User extends AppModel { var $name = 'User'; var $validate = array( 'email' => array( array('rule' => array('minLength', 1), 'message' => 'Please enter an email address.', 'last' => true), array('rule' => 'email', 'message' => 'The email address is not a valid email address.', 'last' => true), array('rule' => 'isUnique', 'message' => 'This email address is already in use. Please enter a different email address.', 'last' => true)), 'password' => array( array('rule' => array('minLength', 1), 'message' => 'Please enter a password.', 'last' => true), array('rule' => array('minLength', 6), 'message' => 'The password must be at least 6 characters.', 'last' => true)), 'confirm_password' => array( array('rule' => array('minLength', 1), 'message' => 'Please confirm password.', 'last' => true), array('rule' => array('comparePassword'), 'message' => 'Sorry, confirmation and password entered do not match. Please re-enter password information.')) ); /** * Check if two given passwords are equal */ function comparePassword($data) { $confirmPasswordHashed = Security::hash(Configure::read ('Security.salt') . $data['confirm_password']); $confirmPassword = $data['confirm_password']; if (($this->data[$this->name]['password'] == $confirmPasswordHashed) || ($this->data[$this->name]['password'] == $confirmPassword)) { return true; } return false; } } File: user.test.php App::import('Model', 'User'); class UserTestCase extends CakeTestCase { var $User = null; var $fixtures = array('app.user'); function startTest() { $this->User =& ClassRegistry::init('User'); } function testUserInstance() { $this->assertTrue(is_a($this->User, 'User')); } function testUserValidates() { // Valid user information $data = array('User' => array( 'id' => '----', 'email' => 'u...@localhost.com', 'password' => '18b300bb0e3ed08e692d8c1cc7b95aab6cb6c64f', 'confirm_password' => 'password' )); $this->User->set($data); $this->assertTrue($this->User->validates()); } } Do I need to include something for the Security component to work in the unit tests, or is it a limitation? If it is a limitation, then is there a work around? Thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: IIS and isapi_rewrite 3
I found it via google http://markmail.org/message/mjpds44riiet3kvr#query:iis_rewrite%20cakePHP+page:1+mid:5fopqo6gcvnyxkjn+state:results may it be helpful for you :)... - Best regards ! Giang Son Dat On vacation Mobile: +84 988114164 Email giangson...@gmail.com, giangson...@yahoo.com On Fri, Feb 6, 2009 at 12:36 PM, Joos wrote: > > Hello, > > I'm new at Cake. > > Unfortunately I have to work with IIS. I have installed Isapi_Rewrite > 3 (from Helicon) but I don't know how to get it working. > > Does anybody know the settings for the combination cake + iis + > isapi_rewrite 3? > > My app's url is http://servername/cake > > - Joos > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need help with the Improved Captcha Component
Which lines of Code should i change now, i found me bug,(I changed the incorrect if-condition) but there is no code verification. How i can get it? unction add(){ $this->Captcha->case = true; if(!empty($this->data)) { $this->Translate->create(); if($this->Translate->save($this->data) && $this->Captcha- >protect()) { $this->Session->setFlash('The Translation has been saved'); $this->redirect(array('action'=>'index'),null, true); } else { $this->Session->setFlash('The Translation has not been saved. Try again'); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Filter empty Textfields
On 6 Feb., 16:45, amarradi wrote: > Hello together, > > i have a form with the inputfield and a button, the input ist named > 'q' How can i filter if the form will loaded(when i klick on the view > with the forn) And the Textfield is empty? I don't know how i get the > values of the iput area? > > many greetings > > Marcusa Radisch Thanks i found it out $this->data[Model]['field'] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Need help with the Improved Captcha Component
Hello i've tried this Captcha Components http://bakery.cakephp.org/articles/view/improved-captcha-component Great the captcha is show in my browser :) Yeah. But no captcha checking. How do i get it, that the captcha will checked This are my directories and files first /cakePHP/app/controllers/components/captcha.php /cakePHP/app/controllers/my_controller.php this are the changes of my_controller.php var $components = array ('Captcha'); var $helpers = array('Html','Form','Time', 'Datum','Captcha'); The Function i added.. function captcha(){ $this->Captcha->show(); } into my_controller is an action to write an new entry into my db-table function add(){ $this->Captcha->case = true; if(!empty($this->data) && [b]$this->Captcha->protect()[/b]) { $this->Translate->create(); if($this->Translate->save($this->data)) { $this->Session->setFlash('The Translation has been saved'); $this->redirect(array('action'=>'index'),null, true); } else { $this->Session->setFlash('The Translation has not been saved. Try again'); } } } /cakePHP/app/views/helpers/captcha.php /cakePHP/app/views/translates/add.ctp The last line of my add.ctp is input(); ?> So the code is downloaded and added into my cakePHP Framework. The Captcha is showing when i call the add.ctp view. How can i get it that the captcha will be checked. The only change from me in my add action was the "bold" condition. Can everyone help me please? many greetings marcus radisch as --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DebugKit plugin: not available for Windows users?
I downloaded it without having to use git. Let me see if I can find the link. On Feb 6, 11:44 am, Matt Curry wrote: > And by "Brandon" I mean "Brendon"... > > On Feb 6, 2:43 pm, Matt Curry wrote: > > > The Git link Brandon referenced does work once you get everything > > setup. I did it yesterday so I could download the API Plugin. It > > would be nice if TheChaw had a download link like GitHub. I assume > > it's forthcoming. > > > Most of the changes from my forked version have been merged back into > > the official one. I think the last few will be added eventually. I > > probably won't keep my version up to date after that, but right now it > > should be *relatively* close to the official one. > > > -Matthttp://www.pseudocoder.com > > > On Feb 6, 1:56 pm, BrendonKoz wrote: > > > > Git installer for Windows:http://code.google.com/p/msysgit/ > > > > Allows you to run Git from the Windows' command line. There's > > > probably another way to get access to it as well, but I'm not really > > > familiar with Git or TheChaw. Matt Curry's forked version > > > (pseudocoder.com) is on GitHub which offers a download, but I'd highly > > > recommend sticking with the official source, I only mention this as a > > > possible temporary alternative until you can get access to the real > > > source. > > > > On Feb 6, 11:48 am, rcurzon wrote: > > > > > I guess it would work fine in Windows... but you can't get it without > > > > "git"... which isn't ready for Windows? Let me know if I missed > > > > something please! > > > > > -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Linking three tables?
There is also this link, which I forgot to add to my previous post: http://jbenner.net/blog/understanding-cakephp-associations --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Linking three tables?
On Feb 6, 1:42 am, geoff wrote: > I sometimes have issues trying to lock down the types of relationships > that need to be enforced between Models. Do you have any helpful ideas/ > hints that you found helped you? I'm not sure if you've seen it previously or not, but maybe this link will help some: http://bakery.cakephp.org/articles/view/database-design-and-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 For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: New Paypal NVP Component in the Bakery
Please, do not post both to the bakery and the google group, it is just noise. I am sure that you are proud of the work you did, but a better approach has already been posted. http://bakery.cakephp.org/articles/view/paypal-datasource --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
IIS and isapi_rewrite 3
Hello, I'm new at Cake. Unfortunately I have to work with IIS. I have installed Isapi_Rewrite 3 (from Helicon) but I don't know how to get it working. Does anybody know the settings for the combination cake + iis + isapi_rewrite 3? My app's url is http://servername/cake - Joos --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Router::parseExtensions case
On Feb 5, 5:46 pm, Damon wrote: > Why does parseExtensions all the sudden care about case? > Router::parseExtensions('rss') won't load the proper layout file (app/ > views/layouts/rss/default.ctp), but Router::parseExtensions('RSS') > does. I don't remember it doing so in earlier versions (I'm on > 1.2.1.8004). I'm using 1.2.1.8004 and Router::parseExtensions('xml'); Both .xml and .XML make it render correctly for me. Changing the case of the directory names in the appropriate views folder and/or the layouts folder made no difference, it still worked. Although, It's possible it has to do with Windows which is what I'm testing this on. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database question, How do I represent a zero in a zero to one relationship?
You should use a null value in the foreign key field to represent that that row doesn't participate in a relationship with the other model. On Feb 6, 12:54 pm, TonyP wrote: > I need to create a zero to one relationship for my cakephp app. I > would like to have a foreign key constraint, cascade on update. > > The problem is, when I use zero as the default value for the field, I > get a foreign key constraint error when trying to add the constraint. > This is because there is no zero value for the constraint I'm adding. > > My question is, should I use a Null value to represent the zero is my > zero to one relationship? Or, should I just create a zero value for > the primary key in the foreign table? > > For example, creating an entry > > id = 0 > company_name = "no company" > phone = " " > ect ... > > I read about there being performance problems when using null values? > Does anyone have any incite? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with TCPDF and Auth
Nobody can help? On 4 Ún, 21:56, Petr Vytlačil wrote: > Hi I want create PDF file with lib. TCPDF. When i dont use Auth > component all is ok and call url return PDF file, but wheh I use Auth > componet in app_controller, call url dont return PDF file, sure im > login. Please help me, i dont know where is problem. > THX! > > Source of app_controller: > > class AppController extends Controller { > var $helpers = array('Javascript','Html'); > var $components = array('Auth'); > > function beforeFilter(){ > Security::setHash('md5'); > $this->Auth->userModel = 'Restaurant'; > $this->Auth->loginAction = array(Configure::read > ('Routing.admin') =>false, 'controller' => 'restaurants', 'action' => > 'login'); > $this->Auth->logoutRedirect = array(Configure::read > ('Routing.admin')=> false, 'controller' => 'restaurants', 'action' => > 'logout'); > $this->Auth->userScope = array('Restaurant.statusaccount' > => '1'); > > if(!empty($this->params['admin'])){ > if($this->params['admin'] == true) { > $this->layout = 'admin'; > $this->set('user',$this->Auth->user()); > } > } > }} > > ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to call validation in a form that doesn't use save()?
In your model use "message" inside your validation rules http://book.cakephp.org/view/125/Data-Validation by default a red message will be displayed under the invalid field. you can access the error info from your controller using $errors = $this->ModelName->invalidFields(); http://book.cakephp.org/view/410/Validating-Data-from-the-Controller Use $this->set("errorvar","your custom error message"); to display a custom error message in your view /* view */ echo $errorvar On 6 fév, 14:27, "libard...@gmail.com" wrote: > Here's what I finally did, and it is working now: > > function search() { > if (empty($this->data)) { > // just render the view > } else { > $this->Book->set($this->data); // sends $data to the model for > validation purposes. > if ($this->Book->validates()) { > $results = $this->Book->find('all', > array( > 'conditions' => array( > 'or' => array( > 'Book.isbn' => $this->data['Book']['isbn'], > 'Book.title' => $this->data['Book']['title'], > 'Book.description' => $this->data['Book'] > ['description'], > 'Book.author_name' => $this->data['Book'] > ['author_name'], > 'Book.starred' => $this->data['Book'] > ['starred'] > ) > ) > ) > ); > } else { > $this->Session->setFlash('Your search contains wrong data, > please check'); > $this->redirect(array('action' => 'search')); > } > > Now, how would it be possible for me to provide the user with the > validation feedback, such as showing in the view the messages upon > validation failure? > > On Feb 5, 3:05 pm, "libard...@gmail.com" wrote: > > > Could you please provide a little more detail on how to do this? > > > Specifically, what do you mean by "just pass $this->data to be > > checked" > > > Sorry for the newbie question. > > > On Jan 25, 1:28 pm, brian wrote: > > > > You'll need to validate the user's input before you call find(). If > > > you want, you can create methods in the model for that and just pass > > > $this->data to be checked. Have the method(s) check the values and > > > return true/false back to the controller. > > > > On Sun, Jan 25, 2009 at 7:31 AM, libard...@gmail.com > > > > wrote: > > > > > I am learning Cake with a test project. > > > > > As far as I know, validation automatically occurs when the Model's save > > > > () method is called from within a controller. So, if I have defined > > > > validation rules in my model, those rules will be scrutinized before > > > > actually either saving or editing data. > > > > > Now, what if the purpose of the form is not to save data? > > > > > Example. What if I create a form whose function is to perform a > > > > search? > > > > > In this case, I am only using the $this->data information in > > > > conjunction with the find() method, but I am not calling the save() > > > > function. > > > > > So... my question, how could I link this search form with the > > > > validation rules initially created for the add() and edit() actions > > > > (which evidently make use of the save() function)? > > > > > Here is my sample code: > > > > > In my controller: > > > > function search() { > > > > if (empty($this->data)) { > > > > // just render the view > > > > } else { > > > > $results = $this->Book->find('all', > > > > array( > > > > 'conditions' => array( > > > > 'or' => array( > > > > 'Book.isbn' => $this->data['Book']['isbn'], > > > > 'Book.title' => $this->data['Book']['title'], > > > > 'Book.description' => $this->data['Book'] > > > > ['description'], > > > > 'Book.author_name' => $this->data['Book'] > > > > ['author_name'], > > > > 'Book.starred' => $this->data['Book']['starred'] > > > > ) > > > > ) > > > > ) > > > > ); > > > > $this->set('data', $this->data); > > > > $this->set('results', $results); > > > > } > > > > } > > > > > In my view (ctp file): > > > > > create('Book', array('action'=>'search')); ?> > > > > > > > > Search Books > > > > > > > echo $form->input('isbn'); > > > > echo $form->input('title'); > > > > echo $form->input('description'); > > > > echo $form->input('author_name'); > > > > echo $form->input('starred'); > > > > ?> > > > > end('Search'); ?> > > > > > > > > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~
Re: DebugKit plugin: not available for Windows users?
And by "Brandon" I mean "Brendon"... On Feb 6, 2:43 pm, Matt Curry wrote: > The Git link Brandon referenced does work once you get everything > setup. I did it yesterday so I could download the API Plugin. It > would be nice if TheChaw had a download link like GitHub. I assume > it's forthcoming. > > Most of the changes from my forked version have been merged back into > the official one. I think the last few will be added eventually. I > probably won't keep my version up to date after that, but right now it > should be *relatively* close to the official one. > > -Matthttp://www.pseudocoder.com > > On Feb 6, 1:56 pm, BrendonKoz wrote: > > > Git installer for Windows:http://code.google.com/p/msysgit/ > > > Allows you to run Git from the Windows' command line. There's > > probably another way to get access to it as well, but I'm not really > > familiar with Git or TheChaw. Matt Curry's forked version > > (pseudocoder.com) is on GitHub which offers a download, but I'd highly > > recommend sticking with the official source, I only mention this as a > > possible temporary alternative until you can get access to the real > > source. > > > On Feb 6, 11:48 am, rcurzon wrote: > > > > I guess it would work fine in Windows... but you can't get it without > > > "git"... which isn't ready for Windows? Let me know if I missed > > > something please! > > > > -R > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DebugKit plugin: not available for Windows users?
The Git link Brandon referenced does work once you get everything setup. I did it yesterday so I could download the API Plugin. It would be nice if TheChaw had a download link like GitHub. I assume it's forthcoming. Most of the changes from my forked version have been merged back into the official one. I think the last few will be added eventually. I probably won't keep my version up to date after that, but right now it should be *relatively* close to the official one. -Matt http://www.pseudocoder.com On Feb 6, 1:56 pm, BrendonKoz wrote: > Git installer for Windows:http://code.google.com/p/msysgit/ > > Allows you to run Git from the Windows' command line. There's > probably another way to get access to it as well, but I'm not really > familiar with Git or TheChaw. Matt Curry's forked version > (pseudocoder.com) is on GitHub which offers a download, but I'd highly > recommend sticking with the official source, I only mention this as a > possible temporary alternative until you can get access to the real > source. > > On Feb 6, 11:48 am, rcurzon wrote: > > > I guess it would work fine in Windows... but you can't get it without > > "git"... which isn't ready for Windows? Let me know if I missed > > something please! > > > -R > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to call validation in a form that doesn't use save()?
Here's what I finally did, and it is working now: function search() { if (empty($this->data)) { // just render the view } else { $this->Book->set($this->data); // sends $data to the model for validation purposes. if ($this->Book->validates()) { $results = $this->Book->find('all', array( 'conditions' => array( 'or' => array( 'Book.isbn' => $this->data['Book']['isbn'], 'Book.title' => $this->data['Book']['title'], 'Book.description' => $this->data['Book'] ['description'], 'Book.author_name' => $this->data['Book'] ['author_name'], 'Book.starred' => $this->data['Book'] ['starred'] ) ) ) ); } else { $this->Session->setFlash('Your search contains wrong data, please check'); $this->redirect(array('action' => 'search')); } Now, how would it be possible for me to provide the user with the validation feedback, such as showing in the view the messages upon validation failure? On Feb 5, 3:05 pm, "libard...@gmail.com" wrote: > Could you please provide a little more detail on how to do this? > > Specifically, what do you mean by "just pass $this->data to be > checked" > > Sorry for the newbie question. > > On Jan 25, 1:28 pm, brian wrote: > > > You'll need to validate the user's input before you call find(). If > > you want, you can create methods in the model for that and just pass > > $this->data to be checked. Have the method(s) check the values and > > return true/false back to the controller. > > > On Sun, Jan 25, 2009 at 7:31 AM, libard...@gmail.com > > > wrote: > > > > I am learning Cake with a test project. > > > > As far as I know, validation automatically occurs when the Model's save > > > () method is called from within a controller. So, if I have defined > > > validation rules in my model, those rules will be scrutinized before > > > actually either saving or editing data. > > > > Now, what if the purpose of the form is not to save data? > > > > Example. What if I create a form whose function is to perform a > > > search? > > > > In this case, I am only using the $this->data information in > > > conjunction with the find() method, but I am not calling the save() > > > function. > > > > So... my question, how could I link this search form with the > > > validation rules initially created for the add() and edit() actions > > > (which evidently make use of the save() function)? > > > > Here is my sample code: > > > > In my controller: > > > function search() { > > > if (empty($this->data)) { > > > // just render the view > > > } else { > > > $results = $this->Book->find('all', > > > array( > > > 'conditions' => array( > > > 'or' => array( > > > 'Book.isbn' => $this->data['Book']['isbn'], > > > 'Book.title' => $this->data['Book']['title'], > > > 'Book.description' => $this->data['Book'] > > > ['description'], > > > 'Book.author_name' => $this->data['Book'] > > > ['author_name'], > > > 'Book.starred' => $this->data['Book']['starred'] > > > ) > > > ) > > > ) > > > ); > > > $this->set('data', $this->data); > > > $this->set('results', $results); > > > } > > > } > > > > In my view (ctp file): > > > > create('Book', array('action'=>'search')); ?> > > > > > > Search Books > > > > > echo $form->input('isbn'); > > > echo $form->input('title'); > > > echo $form->input('description'); > > > echo $form->input('author_name'); > > > echo $form->input('starred'); > > > ?> > > > end('Search'); ?> > > > > > > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DebugKit plugin: not available for Windows users?
Git installer for Windows: http://code.google.com/p/msysgit/ Allows you to run Git from the Windows' command line. There's probably another way to get access to it as well, but I'm not really familiar with Git or TheChaw. Matt Curry's forked version (pseudocoder.com) is on GitHub which offers a download, but I'd highly recommend sticking with the official source, I only mention this as a possible temporary alternative until you can get access to the real source. On Feb 6, 11:48 am, rcurzon wrote: > I guess it would work fine in Windows... but you can't get it without > "git"... which isn't ready for Windows? Let me know if I missed > something please! > > -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakeError
What errors do you want to display to the user, while running in production mode? That being asked, you might take a look here on how to handle this situation: http://teknoid.wordpress.com/2008/08/29/dealing-with-errors-in-cakephp/ On Feb 6, 11:54 am, maxmil wrote: > I have found the same problem. > > Is this really deliberate? > > It takes quite a bit of power away from the cakephp errorHandling > mechanism if it is and is very naughty not to mention it in the error > handling pages of the manual! > > My solution has been to use: > > $this->render('/errors/custom_error'); > > instead invoking $this->cakeError. > > On Jan 16, 11:55 am, ianh wrote: > > > Hmm. Just found the same thing. Seems to be to do with lines 110 to > > 117 in core error.php __construct method > > if ($method !== 'error') { > > if (Configure::read() == 0) { > > $method = 'error404'; > > if (isset($code) && $code == 500) { > > $method = 'error500'; > > } > > } > > > } > > > So if you trigger cakeError with a method like 'test' then that works > > fine unless Configure::read() (which seems to return debug by default) > > is 0 then it gets reset. So you can create a custom method in > > app_error called 'error' and that will work regardless of debug level, > > but any custom errors will only work when debug is > 0. > > > The code suggests this is intended but the book doesnt make any > > reference to it. Also the tests dont shed any light as of course tests > > cannot be run when debug is 0! Does anybody know what the intention > > behind this is please? > > > Anyway, as Mike says above, the solution Im now using is to include a > > Configure::write('debug', 1); line wherever I call cakeError for a > > custom method. > > > Thx, ianh > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Lightwindow support with cakephp
It's not pretty, but here's how I was able to make lightwindow work (after the $html->css('lightwindow')) in my view: image(IMAGE_SMALL_DISPLAY . $image['Image'] ['filename'], array('class'=>'thumb_view')); ?> MAGE_MED_DISPLAY and IMAGE_SMALL_DISPLAY are constants in my bootstrap.php file. This is for a thumbnail image that links to lightwindow. Hope this helps... On Feb 3, 8:22 am, Abhishek wrote: > Hi, > Does cakephp support lightwindow... the thing is when i give an > absolute url like > http://www.test.com/listings/view/20"; class="lightwindow">Test > > it works fine .. but when i use the helper > > link('View',array > ('controller'=>'test','action'=>'temp1'),array > ('class'=>'lightwindow')); ?> > > it doesnt work .. basically i think its not working with relative > url .. or it something that am doing wrong > > Abhishek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
DebugKit plugin: not available for Windows users?
I guess it would work fine in Windows... but you can't get it without "git"... which isn't ready for Windows? Let me know if I missed something please! -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Database question, How do I represent a zero in a zero to one relationship?
I need to create a zero to one relationship for my cakephp app. I would like to have a foreign key constraint, cascade on update. The problem is, when I use zero as the default value for the field, I get a foreign key constraint error when trying to add the constraint. This is because there is no zero value for the constraint I'm adding. My question is, should I use a Null value to represent the zero is my zero to one relationship? Or, should I just create a zero value for the primary key in the foreign table? For example, creating an entry id = 0 company_name = "no company" phone = " " ect ... I read about there being performance problems when using null values? Does anyone have any incite? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakeError
I have found the same problem. Is this really deliberate? It takes quite a bit of power away from the cakephp errorHandling mechanism if it is and is very naughty not to mention it in the error handling pages of the manual! My solution has been to use: $this->render('/errors/custom_error'); instead invoking $this->cakeError. On Jan 16, 11:55 am, ianh wrote: > Hmm. Just found the same thing. Seems to be to do with lines 110 to > 117 in core error.php __construct method > if ($method !== 'error') { > if (Configure::read() == 0) { > $method = 'error404'; > if (isset($code) && $code == 500) { > $method = 'error500'; > } > } > > } > > So if you trigger cakeError with a method like 'test' then that works > fine unless Configure::read() (which seems to return debug by default) > is 0 then it gets reset. So you can create a custom method in > app_error called 'error' and that will work regardless of debug level, > but any custom errors will only work when debug is > 0. > > The code suggests this is intended but the book doesnt make any > reference to it. Also the tests dont shed any light as of course tests > cannot be run when debug is 0! Does anybody know what the intention > behind this is please? > > Anyway, as Mike says above, the solution Im now using is to include a > Configure::write('debug', 1); line wherever I call cakeError for a > custom method. > > Thx, ianh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Filter empty Textfields
Hello together, i have a form with the inputfield and a button, the input ist named 'q' How can i filter if the form will loaded(when i klick on the view with the forn) And the Textfield is empty? I don't know how i get the values of the iput area? many greetings Marcusa Radisch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Customized View for each User
You get the currently authenticated user information from the Auth object, so in your controller, you reference: $userId = $this->Auth->user('id'); You can then use the value in your find to restrict the data. On Feb 3, 7:47 pm, psa wrote: > Hello. > > I'm new to cakePHP. > I have this problem in my project application that I'm having > difficulty determining the authenticated user information so that I > can only display a list of designated accounts of him. I believe I > have to filter the controller data at the view process but I don't > where to get > the user's information. > Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: howto build an form where the Textfield and buttons are side by side
On 5 Feb., 20:55, John Andersen wrote: > On Feb 4, 10:28 pm, amarradi wrote: > > > Hello together, > > > i tried it since my start with cakePHP. How get i my forms in an > > "normal" view. Textfield and the button, all what can in this time is > > to build an form where the textfield is over the button.. > > > many greetings > > > Marcus Radisch > > Hi Marcus, > > Attach a style sheet to handle the layout of the textfield and the > button. > > Enjoy, > John Hello John, thanks a lot, i will try it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: total html separation in views
I'd have to agree with Tobiasz. I don't know how I missed this conversation, but I wished I'd seen it five months ago. I just found Tobiasz site and was overjoyed as I was on the cusp of building my own similar solution. Reasons for using this over other strait PHP would be: security, separation of concerns, and reusability. If you've ever done DOM editing in the browser, you know how that flexibility can change your outlook on life and give you hope for web technology again. Doing this on the server side is something that PHP's needed for years. The web is moving beyond mixed domains of concern and "one off" integrations of technology (read mixing PHP in HTML or any other document type). Tobiasz, thank you. On Sat, Sep 6, 2008 at 5:43 PM, Tobiasz Cudnik wrote: > > I cannot agree with this :))) > > I have a multi-document, multi-dom templating engine with almost no > performance loss. It has some cakephp dedicated solutions, but > generally it's completly standaone. > > It will be published soon, when final API will be ready. > > It based on phpQuery, which i'm also author of. > I will happly share my work (MIT of course) and for this day i have a > full, cakephp based website running on it, stable :) > > On Sep 4, 7:27 pm, mark_story wrote: >> Having a template parser for PHP is quite silly. PHP was originally >> concieved as a templating language. Using a dom parser is going to be >> measurably slower than raw PHP templates. The primary reasons for >> templating sytax in other frameworks is because languages like python >> and ruby don't support html / code blocks to be mixed. There is no >> need for this in PHP. >> >> -Mark >> >> On Sep 4, 8:20 am, the_woodsman wrote: >> >> > I can see the time and place for something like PHPQuery, but >> > seriously: >> >> > // Create DOM from string >> > $html = str_get_html('Hello> > id="world">World'); >> >> > What possible benefits are there for declaring entire pages like this? >> > You'll have escaping issues, you'll always have a harder job >> > integrating other peoples designs, or allowing less technical people >> > to make minor changes. >> >> > I implore you, don't do it! The very idea gives me nightmares :) >> >> > On Sep 3, 12:18 pm, Donkeybob wrote: >> >> > > cake has a built-in template system . . . .why change it? Seems like >> > > more work if you're using the framework anyways. >> >> > > On Sep 3, 4:54 am, mariuz wrote: >> >> > > > In views i can use smarty or fasttemplate or any other template >> > > > language but i'm not quite atracted about any of >> > > > themhttp://www.qadram.com/vcl4php/docwiki/index.php/Component_Writer%27s_... >> > > > I wonder what if i use no template engine at all and keep the html >> > > > separated and clean >> > > > and use an simple dom parser for html "templates" or files >> >> > > >http://simplehtmldom.sourceforge.net/andmodifythehtml dom >> > > > structure >> >> > > > // Create DOM from string >> > > > $html = str_get_html('Hello> > > > id="world">World'); >> >> > > > $html->find('div', 1)->class = 'bar'; >> >> > > > $html->find('div[id=hello]', 0)->innertext = 'foo'; >> >> > > > echo $html; // Output: foo> > > > class="bar">World >> >> > > > or with jquery phpQuery - jQuery port to >> > > > PHPhttp://code.google.com/p/phpquery/ > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using Configure class in custom AppError
Hi there, I have some variables set using the Configure class in the beforeFunction of the main AppController. I use for multiple things, for example to set the title of the page. I need a custom 404 error page, so I made a custom AppError class containing the function error404, which overrides the build function from the framework (see below). The problem is that the Configure class is not working at all in AppError. Any suggestions? regards, class sample -- class AppError extends ErrorHandler { function error404() { //read the config file $config = Configure::read('siteConfig'); //set it so it's available in layout & views $this->set('config', $config); ... ... run other code . //run parent class function parent::__construct(); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cookie->write not working with localhost
I tried to set som cookies today on my development domain(localhost), and for strange reasons it didn't work as expected. The cookie didn't live as expected and after digging into the problem I found that setting $this->Cookie->domain to false made things better. The problems seems to be that if domain is set to localhost the PHP method setcookie doesn't work as expected. I also found som good thoughts about this here: http://www.aeonity.com/frost/php-setcookie-localhost-apache . It sure could be my setup, but it is pretty default MAMP and therefore I believe others could be struggling with this to. I made my own patch to CookieComponent. It's easy. Just check if domain is localhost and set it to false if true. I want to provide a bug report but wanted to here with this group if this is a known problem and that it has been taken care of. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: (how) can cake do nested applications
Hi, I handle something similar using plugins. Each plugin can be an independent application if you like. What I went for was an application "core" that handles the main layout, users and a few global things. Then each plugin just taps into the part of the core it needs or keeps to itself. I just have to make sure I don't accidentally make the core dependent on any one plugin. :) On Feb 5, 5:41 pm, MagiaMan wrote: > Hi all, I am considering using Cake for the next version of an app I > have but need to know how i might do something. something i might > call sub-applications? > > ok. I have a php application "suite" that consists of a "desktop" > that loads in other "applications". Many of these applications are > quite big and I would like to keep each in its own app directory but > be able to access them all through the main desktop application. > > the flow right now looks like this: > > Every call is sent through the desktop main file, it determines what > application is being requested, verifies user rights, and loads the > appropriate application. > > So i need something like: > > ...xyz./StoreFront/Category/View > > Where StoreFront is the application to load, category is the model and > view the action. > > how might i handle this in Cake? > > Happy Baking & Thanks in advance, > > Daryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Doing a NOW() in save().
Hello, I use: *date('Y-m-d H:i:s', time())* instead 'NOW()' and it works fine. Regards. 2009/2/5 Miles J > > I have this method that updates login information on a user. It all > works, except I cant figure out how to get the mysql NOW() to work. > Any ideas? > > function updateLogin($user, $ip) { >$data = array(); >$data['currentIP'] = $ip; >$data['lastLoginTime'] = $user['User']['currentLoginTime']; >$data['currentLoginTime'] = 'NOW()'; > >$this->id = $user['User']['id']; >return $this->save($data, false); > } > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
want to know about changing layout look
Hello all.. I read layout tutorial from http://book.cakephp.org/view/96/Layouts I got the point about how to create default.ctp and $title_for_layout, $content_for_layout.. but I want a look of my website as like our cakephp group page where right side has a menus.. so is there need to change my css accordingly or define any other thing in default.ctp file?? Any one explain me what to do if I want a look of my website like this group's page.. waiting for reply.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: New Paypal NVP Component in the Bakery
Well not yet! It is still pending approval haha. On Feb 6, 3:10 am, Parris wrote: > Enjoy:http://bakery.cakephp.org/articles/view/paypal-direct-payment-compone... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
New Paypal NVP Component in the Bakery
Enjoy: http://bakery.cakephp.org/articles/view/paypal-direct-payment-component-using-curl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Curious problem with img, css, and js in plugin
Hello everyone: I am developing a plugin and i have a curious problem. In my first version I've got all the img, js and css in webroot. Rereading the doc I have seen that they go in plugins/mi_plugin/ vendors. So I've decided to put it there and everything is perfect. I mean: it loads the css, the js and images. But I've noticed that, when accessing the homepage of the plugin in the previous version, which I have saved a copy,I need about 4 or 5 seconds, while the new version requires 8 or 9. I investigate something and I discorver that all the images, css and javascript are reloading again and again, every time you reload the page. I have to configure any special way to behave as in webroot? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can a variable defined in one view file be used in another ?
Is it wrong to use $this->data? I am currently doing this and any value in this array is automatically available within views AND elements. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Router::parseExtensions case
Router should automatically support any extension type right? I'm adding a ics extention for a customised calendar and CakePHP is completely ignoring that. On Feb 6, 12:14 am, brian wrote: > I think it's RequestHandler that's responsible for that, not > Router::parseExtensions(). > > Anyhoo, does your layout path happen to be > "app/views/layouts/RSS/default.ctp"? > > On Thu, Feb 5, 2009 at 5:46 PM, Damon wrote: > > > Why does parseExtensions all the sudden care about case? > > Router::parseExtensions('rss') won't load the proper layout file (app/ > > views/layouts/rss/default.ctp), but Router::parseExtensions('RSS') > > does. I don't remember it doing so in earlier versions (I'm on > > 1.2.1.8004). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to perform Add cart using bake
Hi Maulik, that's a really huge question and I don't think you're going to get a very good response. My advice would be to try and read a lot about the basics of building with cake, to try and build your shopping cart and to come back if you have a specific question about any smaller problem you are having. Don't forget to search the web and this group for answers before posting! Good luck, Pete On Feb 6, 6:33 am, Maulik wrote: > hello > i m new in cakephp > i m developing shopping cart > how do i perform add to cart process, each steps for it. > what i have to perform. > do i have to create a new ctp for cart process. > or frm any other way i complete it. > or how do i do it using bake. > plz let me know each steps for add to cart & updataing the price & qty > etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to perform Add cart using bake
bake only can help you to add to car and updataing the price detailed qty must to write code by yourself if you have the table about cart, 1. cd the directory cake/cake/console, 2. ./cake bake model 3. ./cake bake console 4. ./cake bake view 5 http://www.yoursite.com/yourtablename/ 2009/2/6 Maulik > > hello > i m new in cakephp > i m developing shopping cart > how do i perform add to cart process, each steps for it. > what i have to perform. > do i have to create a new ctp for cart process. > or frm any other way i complete it. > or how do i do it using bake. > plz let me know each steps for add to cart & updataing the price & qty > etc. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
I blocked the cookies, let the 'Session.cookie' to transfer in my parameter.(but can't use)
Hi, everyone, thank you for your read this topic. I blocked the cookies. I don't want to save the 'Session.cookie' in cookies. only let the 'Session.cookie' to transfer in my parameter. I have let the function of redirect like this: function redirect($url, $status = null, $exit = true) { { if (is_array($url)) { $url = array_merge($url,array("?"=>Configure::read('Session.cookie')."=".session_id())); } else { $url = $url."?".Configure::read('Session.cookie')."=".session_id(); } } (write in AppController) I can login .but I can't click any link, If I do this, I must login again, if you know the answer, please tell me, thank you very much. Thanks rimoe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need Help on Internationalization in CakePHP
Elianora, This is a French tutorial for Internationalization, have a read of this. This should help you with the basics http://www.formation-cakephp.com/41/multilingue-18n-l10n As for database content, I wouldn't suggest using the I18n in CakePHP with database queries as it is quite difficult to use. I read this tutorial and used the behavior model from this website. It is a lot simpler and cleaner to use. http://www.palivoda.eu/2008/04/i18n-in-cakephp-12-database-content-translation-part-2/ Hope this helps. On Feb 6, 5:05 pm, Elianora wrote: > here is my test file, located in "app/locale/fre/LC_MESSAGES/ > default.po" : > > msgid "welcome_text" > msgstr "Bienvenue sur le site de test de" > > msgid "test_by" > msgstr "Les tests ici présents sont réalisés par" > > msgid "user_mgt" > msgstr "Gestion des utilisateurs" > > I tried to name the language dir "fr", "fr_FR", "fra" but it does > nothing... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need Help on Internationalization in CakePHP
Try placing this in your bootstrap.php or your AppController beforeFilter(): App::import('Core', 'l10n'); $l10n = new L10n(); $l10n->get('fre'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Call to undefined method IniAcl::allow()
On Thu, Feb 5, 2009 at 10:18 PM, Gwoo wrote: > > try Configure::write('Acl.classname', 'INI_ACL'); i tried it, it's the same... Fatal error: Call to undefined method IniAcl::allow() in /home/fain182/workspace/cake/libs/controller/components/acl.php on line 101 > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need Help on Internationalization in CakePHP
here is my test file, located in "app/locale/fre/LC_MESSAGES/ default.po" : msgid "welcome_text" msgstr "Bienvenue sur le site de test de" msgid "test_by" msgstr "Les tests ici présents sont réalisés par" msgid "user_mgt" msgstr "Gestion des utilisateurs" I tried to name the language dir "fr", "fr_FR", "fra" but it does nothing... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---