Re: Controller question
You can use $this-requestAction('/controller/action') from within a view is this what you mean. On Jul 6, 12:48 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi again. Is there anyway to detect from what view a controller action was called? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
pagination / custom query question
I have 2 models Venue and Event. I want to do a search page that returns both Venue and Event on 1 page and trying to get the ajax pagination feature in cake rc2 to work. However, the first parameter for $this-paginate(...) is the 'type' (model). Is it possible for my controller to have both $this-paginate ('Venue',...) and $this-paginate ('Event',...) at the same time? Or, it would be preferable to do a custom query and feed the results of this query to the paginate() function. Is this possible? Any other possible ways to do this? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with setFlash
Hello, I have a problem with SessionComponent::setFlash(). When I save something in flash, it should be shown on next page and it should expire when user go to another page. But it doesn't expire immediatelly, but after a long while (probably session expiration). When I turn cookies off, it seems to work. I have tried writing $session-flash() in view (layout) twice. As I expected, the first flash() deleted Message.flash, so the second didn't flash. But on next request it flashes the same message again. Finally, I'm sorry for my English :). Thanks, Ondrej --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Subversion merge causing syntax errors - why?
I actually didn't change anything in the cake core, just that I have these SVN properties for keyword substitution, which I (stupidly) added to the cake files. So, SVN is doing it's substitution magic on the cake core file with my parameters, and that is causing differences/ conflicts which shouldn't be there. Need to remove them. I also think I don't have svn setup just quite right, but don't really know what is wrong. When I get more experience with it, I'll probably trash the current installation, and install again from scratch with things setup in the proper way. Will lose some history, but will be better off going forward. Anyways, are you saying you do not put cakephp into SVN as a separare vendor, and you don't do vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder with each project and recommit? On Jul 4, 6:22 pm, aranworld [EMAIL PROTECTED] wrote: I will second what AD7six says. For a while I tried out this type of merging. I soon realized that it is much easier to just leave the Cake core alone. I just have a shared cake folder for all my projects that I do an SVN update on. One advantage of this is that if you start submitting patches to trac you can be sure they are based off the current code. On Jul 3, 1:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 3, 10:48 pm, keymaster [EMAIL PROTECTED] wrote: Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you trouble until you instruct it how to resolve the conflict, or order it to forget about the conflct because you've resolved it manually. Merging for the first time is not simple, at least until you get the hang of it. For those that read this thread afterwards, you need to know three things: 1. Merging against revision range M to N requires you tell subversion to use (M-1) to N. 2. You MUST either use SVN to resolve a conflict, or inform svn after you've resolved the conflict yourself. It needs to know in order to clean up all it's conflict markers from the merge. 3. You need to learn the Svn conflict resolution tools both at the file and line level, to do this properly. Or avoid ever hack your cake install - no risk of conflicts then. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Issues with upgrading Cake releases in SVN
Are you saying you do not store cakephp in SVN as a separare vendor, ie. you aren't using vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder into each project and recommit to SVN? (I don't change the cake core either. I think the reason svn is flagging conflicts may be due to keyword substitution properties I (stupidly) applied to the cake core files. Should probably remove them. On Jul 4, 6:22 pm, aranworld [EMAIL PROTECTED] wrote: I will second what AD7six says. For a while I tried out this type of merging. I soon realized that it is much easier to just leave the Cake core alone. I just have a shared cake folder for all my projects that I do an SVN update on. One advantage of this is that if you start submitting patches to trac you can be sure they are based off the current code. On Jul 3, 1:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 3, 10:48 pm, keymaster [EMAIL PROTECTED] wrote: Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you trouble until you instruct it how to resolve the conflict, or order it to forget about the conflct because you've resolved it manually. Merging for the first time is not simple, at least until you get the hang of it. For those that read this thread afterwards, you need to know three things: 1. Merging against revision range M to N requires you tell subversion to use (M-1) to N. 2. You MUST either use SVN to resolve a conflict, or inform svn after you've resolved the conflict yourself. It needs to know in order to clean up all it's conflict markers from the merge. 3. You need to learn the Svn conflict resolution tools both at the file and line level, to do this properly. Or avoid ever hack your cake install - no risk of conflicts then. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Subversion merge causing syntax errors - why?
Are you saying you do not store cakephp in SVN as a separare vendor, ie. you aren't using vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder into each project and recommit to SVN? I actually didn't change the cake core either. (I believe I had (stupidly) put svn keyword substitution properties on the cake core files, and perhaps that was causing conflicts. Should probably remove them.) Am now wondering whether vendor branching is overkill, since I don't change the cake core either? On Jul 4, 6:22 pm, aranworld [EMAIL PROTECTED] wrote: I will second what AD7six says. For a while I tried out this type of merging. I soon realized that it is much easier to just leave the Cake core alone. I just have a shared cake folder for all my projects that I do an SVN update on. One advantage of this is that if you start submitting patches to trac you can be sure they are based off the current code. On Jul 3, 1:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 3, 10:48 pm, keymaster [EMAIL PROTECTED] wrote: Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you trouble until you instruct it how to resolve the conflict, or order it to forget about the conflct because you've resolved it manually. Merging for the first time is not simple, at least until you get the hang of it. For those that read this thread afterwards, you need to know three things: 1. Merging against revision range M to N requires you tell subversion to use (M-1) to N. 2. You MUST either use SVN to resolve a conflict, or inform svn after you've resolved the conflict yourself. It needs to know in order to clean up all it's conflict markers from the merge. 3. You need to learn the Svn conflict resolution tools both at the file and line level, to do this properly. Or avoid ever hack your cake install - no risk of conflicts then. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Best Practices for managing cake in your SVN
I actually didn't change anything in the cake core, just that I have these SVN properties for keyword substitution, which I (stupidly) added to the cake files. So, SVN is doing it's substitution magic on the cake core file with my parameters, and that is causing differences/ conflicts which shouldn't be there. Need to remove them. I also think I don't have svn setup just quite right, but don't really know what is wrong. When I get more experience with it, I'll probably trash the current installation, and install again from scratch with things setup in the proper way. Will lose some history, but will be better off going forward. Anyways, are you saying you do not put cakephp into SVN as a separare vendor, and you don't do vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder with each project and recommit? On Jul 4, 6:22 pm, aranworld [EMAIL PROTECTED] wrote: I will second what AD7six says. For a while I tried out this type of merging. I soon realized that it is much easier to just leave the Cake core alone. I just have a shared cake folder for all my projects that I do an SVN update on. One advantage of this is that if you start submitting patches to trac you can be sure they are based off the current code. On Jul 3, 1:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 3, 10:48 pm, keymaster [EMAIL PROTECTED] wrote: Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you trouble until you instruct it how to resolve the conflict, or order it to forget about the conflct because you've resolved it manually. Merging for the first time is not simple, at least until you get the hang of it. For those that read this thread afterwards, you need to know three things: 1. Merging against revision range M to N requires you tell subversion to use (M-1) to N. 2. You MUST either use SVN to resolve a conflict, or inform svn after you've resolved the conflict yourself. It needs to know in order to clean up all it's conflict markers from the merge. 3. You need to learn the Svn conflict resolution tools both at the file and line level, to do this properly. Or avoid ever hack your cake install - no risk of conflicts then. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
SVN, Vendor Branching and cake upgrades
Are you saying you do not store cakephp in SVN as a separare vendor, ie. you aren't using vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder into each project and recommit to SVN? Am now wondering whether vendor branching is overkill, since I don't change the cake core either? On Jul 4, 6:22 pm, aranworld [EMAIL PROTECTED] wrote: I will second what AD7six says. For a while I tried out this type of merging. I soon realized that it is much easier to just leave the Cake core alone. I just have a shared cake folder for all my projects that I do an SVN update on. One advantage of this is that if you start submitting patches to trac you can be sure they are based off the current code. On Jul 3, 1:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 3, 10:48 pm, keymaster [EMAIL PROTECTED] wrote: Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you trouble until you instruct it how to resolve the conflict, or order it to forget about the conflct because you've resolved it manually. Merging for the first time is not simple, at least until you get the hang of it. For those that read this thread afterwards, you need to know three things: 1. Merging against revision range M to N requires you tell subversion to use (M-1) to N. 2. You MUST either use SVN to resolve a conflict, or inform svn after you've resolved the conflict yourself. It needs to know in order to clean up all it's conflict markers from the merge. 3. You need to learn the Svn conflict resolution tools both at the file and line level, to do this properly. Or avoid ever hack your cake install - no risk of conflicts then. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: blog tutorial error - cakePHP 1.1
1) i don't know what's wrong in the SQL statement, what it is? From: http://dev.mysql.com/doc/refman/5.0/en/create-table.html column_definition: data_type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY] [COMMENT 'string'] [reference_definition] Note that [DEFAULT default_value] means that DEFAULT is optional, but if you specify it, it's mandatory that it be followed by the default value. 2) this is the code in my .php, it's exactly the tutorial: http://bin.cakephp.org/saved/34489 I can't see nothing wrong with that code... On Sat, Jul 5, 2008 at 4:49 PM, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Hello, and welcome to CakePHP! i'm trying to learn CakePHP by the bog tutorial, i'm using APache2Triad 1.5.4 and CakePHP 1.1.19.6305 and i had two problems: Let me suggest you start right with CakePHP 1.2 RC2, since it's the second release candidate seems like soon we will have a stable release. 1) MySQL did'nt accept the DEFAULT parameter in: CREATE TABLE posts ( id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, title VARCHAR(50), body TEXT, created DATETIME DEFAULT NOT NULL, modified DATETIME DEFAULT NOT NULL ); Indeed that has a typo, perhaps you should file a documentation ticket: http://trac.cakephp.org . 2) After i created the view index.thtml i tried to see what i did in the browser and i got this error: Parse error: syntax error, unexpected T_CLASS in C:\apache2triad\htdocs\cake\app\controllers\posts_controller.php on line 2, this doens't make any sense to me, because all the code i copied ctrl+c ctrl+v from the tutorial and all syntax is correct. Seems like you have a syntax error in your PostsController, if you show us the code maybe we can spot the error. Please use the bin: http://bin.cakephp.org so if anyone can help me with this, tks! Regards, - Dardo Sordi. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dispatcher::start - Controller::$beforeFilter property usage is deprecated and will no longer be supported. Use Controller::beforeFilter()
class FoosController extends AppController { function beforeFilter() { parent::beforeFilter(); // do your own beforeFlter stuff here } } On Sat, Jul 5, 2008 at 11:46 PM, rhrn [EMAIL PROTECTED] wrote: Dispatcher::start - Controller::$beforeFilter property usage is deprecated and will no longer be supported. Use Controller::beforeFilter() how to use right? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Best Practices for managing cake in your SVN
On Sun, Jul 6, 2008 at 3:26 AM, keymaster [EMAIL PROTECTED] wrote: Anyways, are you saying you do not put cakephp into SVN as a separare vendor, and you don't do vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder with each project and recommit? This is what I do, you experience may vary. I do not put cake in my own svn. On my server I do an svn export or check out (kind of depends on a couple of factors which I do) of the version of cake that my app is developed to I put this export/checkout into a directory named like /cake_r/cake-- where the is the cake svn Then I symlink that to the /cake folder on my development and staging servers I use the custom features of the /app/webroot/index.php to detect that it is running in staging/dev and then point the cake core file path to a directory named like above. This way multiple apps targeting multiple cake versions/releases can be supported on the same staging/dev machines. This also makes it very easy to roll back the cake versions on any one of the locations, either by changing the link on the productions boxes or the lines in index.php on the staging/dev machines. After a certain amount of time I will compact and archive the cake_r files on the server and no release goes to the server without being 'tagged' with the cake release as part of the tag identifier. Hope that makes sense. Now for us a lot of this is automated but you get the idea I would imagine. Sam D --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
model validation rules order ?
Hi I noticed a strange behaviour and wanted to know if it's there's a order on executing validation rules the example : case 1 : var $validate = array( 'word' = array( array( 'required' = true, 'allowEmpty'= false, 'rule' = '/\S+/', 'message' = 'Required field.' ), array( 'rule' = array('minLength', 3), 'message' = '3 caracters min.' ), ) ); case 2 : var $validate = array( 'word' = array( array( 'rule' = array('minLength', 3), 'message' = '3 caracters min.' ), array( 'required' = true, 'allowEmpty'= false, 'rule' = '/\S+/', 'message' = 'Required field.' ), ) ); submitting an empty field will display '3 caracters min.' in case 1 and will display 'Required field.' in case 2... for me it's a strange behaviour, I would think that rules are executed in the order they are declared... so how is determined the execution order ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation rules order ?
PS: using 1.2 RC2 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Filter on a field with two conditions.
Hi to all, I have to translate this logic code to a CakePHP condition: SELECT (all) WHERE field isNull or field LIKE %val;% 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$this-Auth-loginRedirect is overridden after successfullly login
I noticed that if I set $this-Auth-loginRedirect to a certain url (i.e. /posts/index) it is not considered after a successfully login operation. Instead, it redirects to '/' location. The strange thing is that I noticed that if you call twice the login action (logging in twice one after the other), the correct location if reached with the redirect ($this-Auth-loginRedirect). I use $this-Auth-authorize = 'controller'; and standard setting to obtain an admin panel. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Filter on a field with two conditions.
There are 2 solutions posted here: http://groups.google.com/group/cake-php/web/faq look under tricky habtm... Personally I don't really like the solutions and prefer to use my own query where i would do a normal join.. On Jul 6, 6:57 pm, JuniorCMS [EMAIL PROTECTED] wrote: Hi to all, I have to translate this logic code to a CakePHP condition: SELECT (all) WHERE field isNull or field LIKE %val;% 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SVN, Vendor Branching and cake upgrades
I don't store the Cake core code in my project's SVN repository either. To upgrade, I just do an svn update on the cake directory I am using for my project. If something in the upgrade doesn't work I can either: -- backtrack the cake core -- fix my project's code to work with the new core -- in the rare case where there is a new bug in the core, fix the bug and submit a diff to TRAC Mainly this is possible because the releases have been quite stable for a while now, and very little has broken backwards compatibility in the last 6 months or so. On Jul 6, 5:25 am, keymaster [EMAIL PROTECTED] wrote: Are you saying you do not store cakephp in SVN as a separare vendor, ie. you aren't using vendor branching? How do you handle cake upgrades? Do just replace the latest cake core folder into each project and recommit to SVN? Am now wondering whether vendor branching is overkill, since I don't change the cake core either? On Jul 4, 6:22 pm, aranworld [EMAIL PROTECTED] wrote: I will second what AD7six says. For a while I tried out this type of merging. I soon realized that it is much easier to just leave the Cake core alone. I just have a shared cake folder for all my projects that I do an SVN update on. One advantage of this is that if you start submitting patches to trac you can be sure they are based off the current code. On Jul 3, 1:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jul 3, 10:48 pm, keymaster [EMAIL PROTECTED] wrote: Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you trouble until you instruct it how to resolve the conflict, or order it to forget about the conflct because you've resolved it manually. Merging for the first time is not simple, at least until you get the hang of it. For those that read this thread afterwards, you need to know three things: 1. Merging against revision range M to N requires you tell subversion to use (M-1) to N. 2. You MUST either use SVN to resolve a conflict, or inform svn after you've resolved the conflict yourself. It needs to know in order to clean up all it's conflict markers from the merge. 3. You need to learn the Svn conflict resolution tools both at the file and line level, to do this properly. Or avoid ever hack your cake install - no risk of conflicts then. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
1.2.0.7296 RC2 zip download vs. exporting revision 7296 ?
Anyone know why the 1.2.0.7296 RC2 zip file download from the cake site yields a different set of source files than a direct export of revision 7296 from cake's svn? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth login redirect unreliable?
Using Eric's post, I created a very simple way to get the Auth component to redirect to the referring page no matter what. I think its userful: ?php class UsersController extends AppController { var $name = Users; var $components = array(Auth); function beforeFilter() { $this-Auth-autoRedirect = false; } function login() { $this-redirect($_SERVER['HTTP_REFERER']); } } On Jul 2, 1:56 pm, Rich [EMAIL PROTECTED] wrote: that worked perfectly for me. thanks Eric! On Jul 2, 12:32 pm, Eric [EMAIL PROTECTED] wrote: I had a similar problem and here is what I did. 1. Change your setupAuth function like this function setupAuth( ) { ... $this-Auth-loginRedirect = '/users/loginRedirect'; $this-Auth-autoRedirect = false; // -- handle redirecting yourself } 2. create a loginRedirect action which determines where to go after a login has succeeded function loginRedirect() { $this-log('users/LoginRedirect()', LOG_DEBUG); if (parent::getAuthGroup() === ADMIN) { $this-log('--redirecting to admin', LOG_DEBUG); $this-redirect('/admin/myCtrl/index'); } else { $this-log('--redirecting to normal', LOG_DEBUG); $this-redirect('/myCtrl/index'); } 3. Your login action is pretty simple then function login() { if ($this-Auth-login()) { $this-loginRedirect(); } else { if (!empty($this-data)) $this-Session-setFlash($this-Auth-loginError); } } I think you can get the page that the user was trying to access via the session, and redirect there, but taking them to the front page works for me . Hopefully this helps. -Eric On Jul 2, 10:44 am, leo [EMAIL PROTECTED] wrote: On 2 Jul, 17:27, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: I see what you mean, but I'm not sure that you can put 'action' = '/' or 'controller' = '/'. Sorry, I missed that. Nope, I wouldn't want to be doing that even if it was valid. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Controller question
I was trying to figure out from what page a came from to render a diferent view uppon the decision. Example (in pseudo code) if(came_from_view_A) { render_view_B; } else { render_view_C } I've solved the problem with Controller::referer() :) On 6 Jul, 02:14, Chris Hartjes [EMAIL PROTECTED] wrote: On Sat, Jul 5, 2008 at 7:48 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi again. Is there anyway to detect from what view a controller action was called? Controllers are not called from views, it's the other way around. What are you trying to accomplish that you need to know this information? -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ayuda en autocomplete no me funciona alguien puede ayudarme
class EnvoicesController extends AppController { var $name='Envoices'; var $helpers= array('Form','Html','Ajax','Javascript','Time', 'Paginator'); var $scaffold; function index(){ $this-render('autocomplete'); } function autocomplete(){ $this-set('clients',$this-Envoice-Client- findAll(Client.ruc LIKE '{$this-data ['Client']['ruc']}%', array('Client.name','Client.ruc'),'Client.id ASC', 20)); #now render element //$this- render('autocomplete','ajax','autocomplete'); $this-render('autocomplete', 'ajax','autocomplete'); } view index.ctp form name=form id=form label for=user_autocompleteCliente:/label ?php echo $ajax-autocomplete('Client/name','/envoices/ autocomplete', array('size'=15,'frequency'=0.2)) ? /form -- view autocomplete.ctp ul class=autocompleteList ?php foreach($clients as $client): ? li class=autocompleteList ?php echo $client['Client']['name']; ? /li ?php endforeach;? /ul --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
links and images on static pages
Hi, I am new to cakePHP and I read some posts on creating static pages by adding the pages to the apps/views/pages/ and using the pages controller. However, my links and images in the default.thml layout do not work anymore. I have been adding my links using img and a tags because for some reason I could not get $html-image and $html-link to work. Does anyone know how to fix this? Thanks Chris --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: display var from view in layout
For anyone else wondering, just have a $this-set('layout_var', 'content') in your view, then in the layout file you can use $layout_var . On Jul 6, 6:15 am, bmgz [EMAIL PROTECTED] wrote: I managed to figure this out, however it wasnt as elegant or simple as it could be.. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Controller question
It might be nicer to just call slightly different URLs from the views! An extra param, perhaps? On Jul 6, 7:58 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I was trying to figure out from what page a came from to render a diferent view uppon the decision. Example (in pseudo code) if(came_from_view_A) { render_view_B;} else { render_view_C } I've solved the problem with Controller::referer() :) On 6 Jul, 02:14, Chris Hartjes [EMAIL PROTECTED] wrote: On Sat, Jul 5, 2008 at 7:48 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi again. Is there anyway to detect from what view a controller action was called? Controllers are not called from views, it's the other way around. What are you trying to accomplish that you need to know this information? -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with setFlash
This sounds like caching to me. What debug level are you on? Do you use view caching? What browser do you use? etc! On Jul 6, 7:35 am, angel333 [EMAIL PROTECTED] wrote: Hello, I have a problem with SessionComponent::setFlash(). When I save something in flash, it should be shown on next page and it should expire when user go to another page. But it doesn't expire immediatelly, but after a long while (probably session expiration). When I turn cookies off, it seems to work. I have tried writing $session-flash() in view (layout) twice. As I expected, the first flash() deleted Message.flash, so the second didn't flash. But on next request it flashes the same message again. Finally, I'm sorry for my English :). Thanks, Ondrej --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: links and images on static pages
Set the Html helper in your app/app_controller.php: class AppController extends Controller { var $helpers = array('Html', etc.., etc..) } T+ On Jul 6, 4:13 pm, CM [EMAIL PROTECTED] wrote: Hi, I am new to cakePHP and I read some posts on creating static pages by adding the pages to the apps/views/pages/ and using the pages controller. However, my links and images in the default.thml layout do not work anymore. I have been adding my links using img and a tags because for some reason I could not get $html-image and $html-link to work. Does anyone know how to fix this? Thanks Chris --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---