Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
I'm using a component called SimpleAuth and SimpleAcl (instead of the standard Auth and Acl ones because they are too complicated for my small project). SimpleAuth features a getActiveUser() method which returns the currently logged in user. This method calls $this-Controller, which is only

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
Oh, and by the way: why is the filter in beforeFilter resp. afterFilter? beforeRender makes sense to me, but beforeFilter seems a strange name to me... On Fri, Nov 12, 2010 at 10:30 AM, Joshua Muheim psybea...@gmail.com wrote: I'm using a component called SimpleAuth and SimpleAcl (instead of the

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
Well, I found a way to implement another controller hook that is called between initialization of components and execution of action logic: ?php /** * Enables another hook (_afterComponentsInitialization()) that is placed * between the initialization of components and the execution of action

CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread psybear83
Hi all I don't get it why CakePHP doesn't complain about stuff like when one specifies missing components or fixtures: var $components = array('SomeNotExistingComponent'); var $fixtures = array('app.this_fixture_does_not_exist'); App::import('Lib', 'TheresNoSuchFileInLib'); All the three lines

Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread psybear83
Hi everybody For the sake of simplicity I'd like to make my helpers available in my views not as $this-Helper but as $helper using the set(...) method in the controller. Is there any reason why this could be a bad idea? Or is there already an option to tell CakePHP to make the helpers available

Re: Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread euromark
actually its the other way around it used to be $html and NOW is $this-Html (cake =1.3) and yes, there are plenty reasons why this is now a view object (and not just an object variable) it is a bad idea to want to go back to the old syntax and your argument is bad: For the sake of simplicity

Re: Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread Joshua Muheim
I'd really like to know why it has switched to $this-Html. Is there a decision log or something for CakePHP? Coming from the RoR world (which is far more widespread in the webworld than CakePHP, I guess) I like things as simple as anyhow possible, even if you have to stick to some conventions for

Re: Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread Jeremy Burns | Class Outfit
I like the way Cake does it, regardless of what else others do. I can imagine that if you had a helper function called display and then you added another helper that had a function with the same name you *could* isolate and rectify the clashes, but I'd rather avoid that extra work in the first

Re: Why only pass $data to view instead of model instance?

2010-11-12 Thread Joshua Muheim
I'd like to warm up this topic again. :-) I decided to pass model instances to the views instead of just their $data attributes. So is there a way to tweak the paginator to do exactly this? Thanks, Josh On Thu, Oct 28, 2010 at 8:26 PM, euromark dereurom...@googlemail.com wrote: i tend to do

Re: Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread Joshua Muheim
I don't see the big deal, too. I just wondered whether there's a knockout argument for doing it the CakePHP-way. But I guess I will stick to the CakePHP-way now for some time and see later if I still want to change it... :-) On Fri, Nov 12, 2010 at 2:23 PM, Jeremy Burns | Class Outfit

Re: CakePHP Stores the user login information to Cookies automatically

2010-11-12 Thread Muhaimen Ezabbad
Amit, Thanks for the reply, Amit, Team, I'm using 1.3.5 Stable version. BTW, I also created a new empty project with two tables, items and users in the AppController I wrote: var $components=array('Auth'); function beforeFilter() {

Re: Encrypted text does not get saved in the db

2010-11-12 Thread laduree
It is strange that the log says there is not an INSERT query at all; however, the Message.to data is captured from the form and inserted in the db. And the 'created' and 'modified' fields are inserted automagically. The output from the SQL log is the following: Nr Query

Re: Encrypted text does not get saved in the db

2010-11-12 Thread laduree
Sorry, the SQL output got all messed up after I clicked send, Nr: 1 _ Query: DESCRIBE `messages` _ Affected: 6 _ Num. Rows: 6 _ Took (ms): 2 Nr: 2 _ Query: DESCRIBE `users` _ Affected: 6 _ Num. Rows: 6 _ Took (ms): 3 Nr: 3 _ Query: _ Affected: 1 _ Num. Rows:_ Took

Re: Site Development from Start to Finish

2010-11-12 Thread naidim
For the homepage controller, if User and Drug are not related but you want to use those models, you have to include them both. Maybe I should specify that, thanks. Not sure I understand the 1.3 point. 'add' was added because I noticed scaffold methods are not allowed when you allow('*'); so you

Re: Doubt about admin routes / actions and Auth component

2010-11-12 Thread cricket
On Thu, Nov 11, 2010 at 11:44 PM, huoxito huox...@gmail.com wrote: Thats what I thought as well, but it doesnt happen, If I just let $this-Auth-allow(‘*’) in my app_controller all actions are accessible without being logged in, even my admin_* methods Perhaps Auth isn't properly configured in

Re: Encrypted text does not get saved in the db

2010-11-12 Thread cricket
On Thu, Nov 11, 2010 at 4:13 PM, laduree villa...@gmail.com wrote: I have some data coming from a form, and I'm trying to encrypt part of it and save it in a mysql db. Everything gets saved, except the encrypted field, which is empty when I look in the database. I'm new to CakePHP and wasn't

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread cricket
On Fri, Nov 12, 2010 at 5:05 AM, psybear83 psybea...@gmail.com wrote: Hi all I don't get it why CakePHP doesn't complain about stuff like when one specifies missing components or fixtures: var $components = array('SomeNotExistingComponent'); var $fixtures =

Re: Site Development from Start to Finish

2010-11-12 Thread Shaz
It's better practice to use model relationships rather than $uses. i.e. $this-User-Drug-find(); On Nov 12, 4:30 pm, naidim nai...@gmail.com wrote: For the homepage controller, if User and Drug are not related but you want to use those models, you have to include them both. Maybe I should

Re: Encrypted text does not get saved in the db

2010-11-12 Thread laduree
I tried using Security::cipher and the same thing happened with the same SQL output. The weirdest thing is that the data is not going missing at any point as I had passed it to the view using $this-set() both before and after encryption with the following result: Message: This string will be

Re: Encrypted text does not get saved in the db

2010-11-12 Thread cricket
On Fri, Nov 12, 2010 at 1:13 PM, laduree villa...@gmail.com wrote: I tried using Security::cipher and the same thing happened with the same SQL output. The weirdest thing is that the data is not going missing at any point as I had passed it to the view using $this-set() both before and after

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread Miles J
It will error out when you try to access a component that doesn't exist. Adding an invalid string to an array should not cause CakePHP to barf errors. On Nov 12, 10:09 am, cricket zijn.digi...@gmail.com wrote: On Fri, Nov 12, 2010 at 5:05 AM, psybear83 psybea...@gmail.com wrote: Hi all I

Re: Encrypted text does not get saved in the db

2010-11-12 Thread laduree
I did that and the data is there, if I hardcode a value it is entered correctly in the database, if I don't encrypt it it is entered correctly as well. It seems mysql is just not accepting the encrypted string. // After: // if(!empty($this-data)) { //     die(debug($this-data)); [Message] = Array

Re: Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread Miles J
It was mainly so that user variables don't overwrite helper variables. I ran into this problem a few times during my 1.2 days. If it really bothers you that much. $f = $this-Form; On Nov 12, 5:25 am, Joshua Muheim psybea...@gmail.com wrote: I don't see the big deal, too. I just wondered

Re: Why only pass $data to view instead of model instance?

2010-11-12 Thread Miles J
I dislike this also. Cake really should have more than 1 model type: DAOModel and DataModel. One deals with database interactions, while the other manipulates a dataset for the view. However, there is nothing stopping you creating these extra models. $this-set('data', new

Re: Site Development from Start to Finish

2010-11-12 Thread naidim
I don't understand. Without the var $uses = array('User', 'Drug', etc.) line, calls to $this-User-find() give this error: Fatal error: Call to undefined method stdClass::find() With the uses line, it works fine. On Nov 12, 11:13 am, Shaz shazam...@gmail.com wrote: It's better practice to use

Re: Encrypted text does not get saved in the db

2010-11-12 Thread laduree
I tried running the query manually with $this-Message-query() and the same happens, it will work correctly when a value is not encrypted or with a hardcoded value, but will not work with encrypted values, it leaves that field in the database empty. On Nov 12, 7:57 pm, laduree villa...@gmail.com

mysql connection refused

2010-11-12 Thread rogwei
The subject search phrase returns 0 items in this group which surprises me a little, and google isn't. Anyway, I upgraded my DB server Ubuntu 9.10 to 10.04 LTS, and now when I try to access my application I get the following warning and a missing database table error. One factoid, I CAN connect

Help with Joins

2010-11-12 Thread Dave Maharaj
No matter what I try I cant get this to work. I need to pull all records from Offer only if not in Reject I tried manual JOINS but all I ever get is a list of all Reject records. SELECT DISTINCT `Offer`.`id` , `Offer`.`title` , `Reject` . * FROM `Offers` AS `Offer` LEFT JOIN

problem with links helper

2010-11-12 Thread Dobrogor
Hi all! I have a little problem. I want to use russian languale at my links in main menu. I create my links with html helper. For example, if i write in code ?php echo $this-Html-link('Works', array('controller' = 'art_works', 'action' = 'show')) ? output will be like this a

Re: Paginate Multiple Models in the same view

2010-11-12 Thread Arak Tai'Roth
Anyone have any other ideas? On Nov 12, 12:56 am, Arak Tai'Roth nielsen.dus...@gmail.com wrote: That doesn't work, it actually disabled the working pagination on the Image model. I know there is a model option that can be set in the Paginator options, I'm wondering if it can be used for this

Re: Doubt about admin routes / actions and Auth component

2010-11-12 Thread huoxito
I have this in my app_controller var $components = array('Session', 'Auth'); function beforeFilter(){ parent::beforeFilter(); # thanks to http://padariadodenilson.wordpress.com/2010/10/04/criando-uma-area-administrativa-com-cakephp/ if (isset($this-params['admin'])) {

Re: Encrypted text does not get saved in the db

2010-11-12 Thread laduree
So, after trying everything I could think of, I baked a new project with as fewer code as possible, and I am able to insert an encrypted value in the database without any problem. I don't know what was causing the problem. I'll keep testing tomorrow. Thanks for all who took the time to read and

use multi lang in cakephp 1.3.*

2010-11-12 Thread hoss7
how can i create multi lang website? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: use multi lang in cakephp 1.3.*

2010-11-12 Thread Tilen Majerle
yes you can... how to do it...look here http://book.cakephp.org/view/1228/Internationalization-Localization -- Tilen Majerle http://majerle.eu 2010/11/13 hoss7 hoss...@gmail.com how can i create multi lang website? Check out the new CakePHP Questions site http://cakeqs.org and help