Re: Global Variables and Arrays
Instead of core.php try bootstrap.php in your app/config dir --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Installed Cake in subdirectory, shared hosting
Good to know. I've actualy just reached the part of the tutorial that shows you how to use the helpers. I plan on making that a practice in all my future code. Thanks for the feedback :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Adding support for MS SQL Server
Hi Nate Thank you very much for this. I appreciate your efforts enormously. It is good to see that the database abstraction is so effective. I have a number of other projects that are no way near as portable that have given me huge headaches. Just another feather in Cake's cap :-) Regards, Langdon nate wrote: > Langdon, I know you weren't fishing, it's just that, by the time I > finished explaining the work that needed to be done, I realized I could > have already been about half done actually doing it. > > I happen to have a PC with a recent SQL Server install handy, and > thanks to Cake's well-designed database abstraction layer, it's really > not that difficult. So yes, I should probably be done by tomorrow. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Saving components values with add method
Why not just set the value in the add( ) method before you save it? $this->User->set('username', $this->Time->uniqueTimeStamp()); $this->User->save($this->data); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Form validation w/out a model?
I did it like this class Contact extends AppModel{ var $name = 'Contact'; var $validate = array('email'=>VALID_EMAIL, 'name'=>VALID_NOT_EMPTY,'text'=>VALID_NOT_EMPTY,'regards'=>VALID_NOT_EMPTY); var $useTable = false;}?>the $useTable means that it doesn't connect to the db and I can use the validation stuff that waythen in the controller rather then testing $this->ModelName->save() I do $this->Contact->validates($this->params['data'] )Works for me ;)Sam DOn 4/9/06, guice666 < [EMAIL PROTECTED]> wrote:Looked through the tutorials, trying to do it through a form with no success. Is there a way to run form validation w/out the requirement ofa model?I have a contact form that is not connected to any database model thatI need to run validation against the inputted values before sending it off. So far the only auto validation I can see is done through themodel level. Since this class doesn't hit the model level, I don't knowhow else to run an auto validation check. So I have to check all values manually?Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: how can I change current requested action?
On 09-Apr-2006, at 17.48, Larry E. Masters aka PhpNut wrote: > function beforeFilter() { > if (!$this->Permission->checkPermission($this->name, $this->action)) > { > return $this->denied(); > } Perhaps function beforeFilter() { if (!$this->Permission->checkPermission($this->name, $this- >action)) { $this->redirect('/new_controller_name/new_action_name'); } } Which just sidesteps the entire layout/content issue (because I'm not in the mood to explain that Larry expected you to fill in the details). scott. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Installed Cake in subdirectory, shared hosting
On 09-Apr-2006, at 13.48, jburns131 wrote: > > ok, I think I solved my problem. > > Following the link, I was using the tag ''>'. > > Once I changed it to ''>', everything worked out fine. I just had to > add the '/' in front of my subdirectory so Cake wouldn't look at it > like an action in my controller. Which tutorial are you using? Because that tutorial is broken. You definitely should not be hard coding links because, as you've discovered, that breaks horribly if cake is in a subdirectory. You should be using the HTMLHelper to build the links for you: $html->link("/posts/view/{$post['Post']['id']}"); And, of course, the Tutorial should be telling you to do it that way, too. (As I said, if the tutorial is hardcoding links, the tutorial is broken.) Come to think of it, a friend of mine started with Cake recently and she had problems with the tutorials as well. I didn't have the time to track it all down and file tickets, unfortunately. If I recall correctly, the blog tutorial in the manual is broken, while the version in the wiki is fine. But, the wiki version has a note saying you should use the version in the manual instead. If I get a chance I'll nail the issue down and file a ticket, but that shouldn't discourage anyone else from doing it first. :) scott. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: how can I change current requested action?
That is word but not success. Look: url www.domain.com/articles/delete/1 - will delete article with id 1. Your method only change layout. But deleting steel works. What way also can be? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: how can I change current requested action?
... function beforeFilter() { if (!$this->Permission->checkPermission($this->name, $this->action)) { return $this->denied(); } ... function denied() { } -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Form validation w/out a model?
Looked through the tutorials, trying to do it through a form with no success. Is there a way to run form validation w/out the requirement of a model? I have a contact form that is not connected to any database model that I need to run validation against the inputted values before sending it off. So far the only auto validation I can see is done through the model level. Since this class doesn't hit the model level, I don't know how else to run an auto validation check. So I have to check all values manually? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: how can I change current requested action?
You know, as I know, this function call's an action from every place. But I need to change the action. Here my code: class AppController extends Controller { var $components = array('Permission'); var $beforeFilter = array('init'); function init() { } function afterFilter() { } function beforeFilter() { if (!$this->Permission->checkPermission($this->name, $this->action)) { ///here I need to change action// } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: how can I change current requested action?
$this->requestAction() might help here look in manual Sam D On 4/9/06, Alexey Baranovskiy <[EMAIL PROTECTED]> wrote: > > I need to change requested action. > For example: User requested this url - www.domain.com/articles/edit/1, > but he isn't authorised. I need to change action "edit" to action > "denied"? How can I do that? > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
how can I change current requested action?
I need to change requested action. For example: User requested this url - www.domain.com/articles/edit/1, but he isn't authorised. I need to change action "edit" to action "denied"? How can I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Saving components values with add method
I have a component that returns an unique 14 digit timestamp. I need to use it on the add method of my UserController in order to identify each record as unique, I don't want to use the autoincrement property of mySQL table. UserController: $this->set('uniqueID', $this->Time->uniqueTimeStamp()); But I need save this value with each record. add.thtml: input('User/username', array('size' => '20', 'maxlength'=>'20'))?> Where "User" is my model and "username" the datafield name. How can I save the value of the unique timestamp in every new record? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Updating Packages in CakeForge
Hi, I want to update the locale package on CakeForge, and I can't see how to update the snippets that make up a package. Can anyone point me in the right direction? the only solution I see right now is to create new snippets for each file, which the new snippet page explicity states I shouldn't need to do. Cheers, AD7six --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Installed Cake in subdirectory, shared hosting
ok, I think I solved my problem. Following the link, I was using the tag ''>'. Once I changed it to ''>', everything worked out fine. I just had to add the '/' in front of my subdirectory so Cake wouldn't look at it like an action in my controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Installed Cake in subdirectory, shared hosting
I'm also using CakePHP v0.10.5.1701_beta. Is that not the most recent stable version? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Installed Cake in subdirectory, shared hosting
I'm using the dev setup, so those folders are in the same directory, but they are in a subdirectory on my web server, and cake is trying to link to the root directory. I have the code exactly as shown in example A.4 on this page (http://manual.cakephp.org/pages/apas08), yet the links are going to 'mysite.com/posts/view/1', rather than 'mysite.com/cake_blog/posts/view/1'. I'm not sure about the AllowOverride setting though, and I'm not sure if I made myself clear enough in my first post. Would that still cause this problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Newbe question about routes
You can use app/config/bootstrap.php to intercept the variable $_GET['url'] before it goes to Cake's dispatcher. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: links
If you want to do custom URL delimiter characters, see: http://groups.google.com/group/cake-php/browse_thread/thread/66dc2488f95ca098/079d48825fc25a8f?q=bootstrap&rnum=1#079d48825fc25a8f --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Installed Cake in subdirectory, shared hosting
If you are using mod_rewrite, and you are putting all Cake folders in the default locations (i.e. both /app and /cake are inside the same directory), you should not need to modify any configurations, on the server or in Cake. However, make sure you have all 3 .htaccess files in the right places, and that your host supports AllowOverride in their Apache configuration. Also, from the line you posted above, it looks like your Cake install might be a version or two old. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Installed Cake in subdirectory, shared hosting
I'm working on the first 'Cake Blog' tutorial in the manual, and I've uploaded Cake to a subdirectory (cake_blog). I don't have access to change the server include path directives because I'm using a hosting company. Is there a config that I can alter to let cake know that it should look in the subdirectory for all calls? I've looked in 'core.php', and noticed the 'define ('BASE_URL', $_SERVER['SCRIPT_NAME']);' entry, but I'd like to use mod_rewrite (I'm not familiar with it, but it's working fine). Any suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Adding support for MS SQL Server
Langdon, I know you weren't fishing, it's just that, by the time I finished explaining the work that needed to be done, I realized I could have already been about half done actually doing it. I happen to have a PC with a recent SQL Server install handy, and thanks to Cake's well-designed database abstraction layer, it's really not that difficult. So yes, I should probably be done by tomorrow. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
links
Hi everybody, anybody can tell me how can I make links like: http://localhost/cake/controller:sublink1 http://localhost/cake/controller:sublink2 http://localhost/cake/controller:sublink3 I saw them at the Wiki Tutorials: http://wiki.cakephp.org/tutorials:migration http://wiki.cakephp.org/tutorials:dynamic-menu http://wiki.cakephp.org/tutorials:flashing --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Opera /AJAX issues.
I think so :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Newbe question about routes
I'am pretty new to CakePHP, and I'm thinking about the posibility to rewrite an already running web portal y admin entirely with Cake. I'm a bit stuck with routes, maybe someone can help. I'd like url's to be en the format (example): [1] www.example.com/james-joyce -> info and bibliography about this author [2] www.example.com/james-joyce/ulysses -> info about this exact title. So in [1] controller is "authors", and in [2] it's "books". I've been playing around with app/config/routes.php but I can't figure out how to pass tell Cake to use one controller if param count == 1 and use other controller if param count == 2. Any help would be appreciated. Regards -- Klaus. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Re: Global Variables and Arrays
There are several files in which you could put variables to be accessed in other files:app_model.php -> in your model variable is accessibleapp_controller.php -> in your controllers variable is accessible core.php -> anywhere accessibleJoseOn 4/8/06, wassimk <[EMAIL PROTECTED]> wrote: Hello Everyone,Is there a way to register an array as global using Cake? Kind of like application wide settings array that I can load from a database.Something like$settings = array();$this->register->settings($settings)Then you can access $this->settings anywhere? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---