Testing model which uses Auth::user

2012-10-06 Thread cronet
de/app/webroot/test.php : 92 > > In my model i use $user_id = AuthComponent::user('id'); > Regards, cronet -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to

saveAssociated with hasOne creates new entries instead of updating

2012-06-28 Thread cronet
nderstand the book, cakephp should populate the UserProfile.user_id and UserSetting.user_id field automatically. But the result is, with every save, a new association entry is generated. The User field updates correct. What is my problem here? Any clues? Regards, cronet -- Our newest site for th

Re: inputDefaults in AppController

2011-11-27 Thread cronet
t; > > > > > > On Sunday, 27 November 2011 at 4:18 AM, Tilen Majerle wrote: > > inputDefaults works for each created form separately only > > > and +1 for ur post :) > > > -- > > Lep pozdrav, Tilen Majerle > >http://majerle.eu > > > 2011

inputDefaults in AppController

2011-11-26 Thread cronet
)); ?> The Code above isn't working, but i think you get what i thought of regards, cronet -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help other

Re: Modify form error output

2011-11-26 Thread cronet
;, array('div' => array('class' => > >> 'my-div-class'))) > > >> -- > >> ***Thiago Belem* > >> Desenvolvedor > >> Rio de Janeiro - RJ - Brasil > > >>+55 (21) 8865.9250 > >> thiagobelem.net > >

Modify form error output

2011-11-26 Thread cronet
achieve this? Regards, Cronet -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr

Database design question

2011-08-19 Thread cronet
l and database table for each small ad category (version 2), or should I pack all categories in one table (version 1)? Regards, Cronet -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help o

Re: CakePHP, jQuery & JSON

2011-03-18 Thread cronet
That works very well... Thank you guys ! On 18 Mrz., 12:28, LipeDjow wrote: > Yes. > > Instead returning the value in action, you can set it to view and load a > general element for JSON. > Like this (using Taffarel's example): > > function json(){ >     //bring some data in database >      $json

Testing controllers - no param is set

2010-05-30 Thread cronet
Hey, i try testing controllers as described by mark story (http://mark- story.com/posts/view/testing-cakephp-controllers-the-hard-way).. The Problem - i call the method with one param but the view mehtod recognize it, even it is in $this->params... In the Test: $this->Users->pa

Re: Prefix routing problem

2010-05-30 Thread cronet
no, i use the authsome component from debuggable... On 28 Mai, 10:18, Bogdan Bursuc wrote: > Do you use the Auth component ? > > > > On Fri, May 28, 2010 at 9:07 AM, cronet wrote: > > hm... > > >  i solved my problem with the following route configuration: >

Re: Prefix routing problem

2010-05-27 Thread cronet
in the manual there's a note to user admin=>false, not admin=>null in the html link array... On 28 Mai, 07:47, cronet wrote: > that does not solve the problem... > > Router::connect('/aktivieren', array('controller' => 'users', 'act

Re: Prefix routing problem

2010-05-27 Thread cronet
;admin'=>false, 'prefix'=>false )); I tried all combinations and accessing /aktivieren /aktivieren/ /aktivieren/blabla it ends up in "admin_activate" not "activate" On 28 Mai, 06:24, Bogdan Bursuc wrote: > You need to define the master route, als

Prefix routing problem

2010-05-27 Thread cronet
Hey, i defined the following route: Router::connect('/aktivieren/*', array('controller' => 'users', 'action' => 'activate', 'admin'=>false)); But everytime when I try to access /aktivieren cake routes me to admin_activatie... Here ar some vars from pr($this) [action] => admin_activ

Re: Web Service cakePHP

2010-02-16 Thread cronet
you could add soap support simply by loading a soap class (e.g. nusoap) as vendor... It's much simpler using the built in rest functions... but that depends on what webservice you want to create or use. On 15 Feb., 10:43, ivan wrote: > What cakePHP support REST only? What cakePHP support SOAP? an

Admin Section as plugin

2010-01-30 Thread cronet
Hello, i want to create a plugin, which covers a little admin section, e.g. Usermanagement,Basic Authentication and website Settings The idea is to have a admin section which is easy maintainable, but also extendable to fit the needs of different projects... Do I run into problems creating th

Re: Ajax (jquery) Question - am I doing this right?

2009-09-29 Thread Cronet
Now it works really perfect... I set the "RequestHandler" part in my beforeFilter method in app_controller. Thank you for directing in the right direction! On Sep 29, 4:05 pm, brian wrote: > On Tue, Sep 29, 2009 at 2:23 AM, Cronet wrote: > > > Hi Brian, > &

Re: Ajax (jquery) Question - am I doing this right?

2009-09-28 Thread Cronet
ular case, it's only a pagination statement...so no problem)... But what if the logic comes complexer? Should I then move it to the model? On Sep 29, 2:22 am, brian wrote: > On Mon, Sep 28, 2009 at 3:27 PM, cronet wrote: > > > Hey, > > > i try to do my first steps with aj

Ajax (jquery) Question - am I doing this right?

2009-09-28 Thread cronet
Hey, i try to do my first steps with ajax (jquery) - In a list, i would like to have a switch which changes the 'active' paramter in the db for this entry. As i understand this topic, I need to do an ajax call to a controller method, which do the changes, and the realod the div with the new entr

Re: saveall for hasone in edit method

2009-09-03 Thread Cronet
Thank you for responding. You're right. Very simple solution :) I thought, because it's a hasOne relationship cake gets this id automagically... On 3 Sep., 11:19, WebbedIT wrote: > If you want both models to update then you need the primary id of each > model in the form, if you pass no id f

saveall for hasone in edit method

2009-09-02 Thread cronet
Hi there, i stuck in a problem which is perhaps obvious, but i didn't see the solution right now. It is a simple savell for a hasnone association. I try to edit the primary and secondary data in one form. But the secondary data creates always a new insert instead of updating it. I think the nami

console and db connection

2009-08-07 Thread cronet
Hi, is there a way to specify which db connection the console uses to connect to the db? Regards, cronet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send ema

Re: Use form helper in own helper

2009-08-03 Thread Cronet
s the problem here? Regards, Alexander On 7 Jul., 15:50, Robert P wrote: > I refer you tohttp://book.cakephp.org/ > > http://book.cakephp.org/view/102/Including-other-Helpers > > On Jul 7, 9:48 pm, cronet wrote: > > > Hi, > > > i want to use the FormH

Use form helper in own helper

2009-07-07 Thread cronet
Hi, i want to use the FormHelper in my own helper. simple helper example: function formTest($model) { App::import('Helper', 'Html'); App::import('Helper', 'Form'); $form = new FormHelper(); echo $form->create($model); echo $form->inputs(); echo $

Re: strange link problem

2009-02-07 Thread cronet
have some CSS along these lines: > > a:after { content:" (" attr(href) ") "; } > > Either that, or it's javascript doing it. That's a technique best used > for print styles, so the URL is printed. > > On Sat, Feb 7, 2009 at 7:46 PM, cronet wr

Re: strange link problem

2009-02-07 Thread cronet
Hard to discribe... please look at this Image: img90.imageshack. us/my.php? image=bild12op1.png It shows my view (top), the site (middle) and the sourcecode (lower). On 8 Feb., 00:54, brian wrote: > On Sat, Feb 7, 2009 at 6:47 PM, cronet wrote: > > > Hi, > > > i got a

strange link problem

2009-02-07 Thread cronet
oot. No Idea what the hell is going on there. Anyone of you got something similar? Regards, Cronet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-p

Validate checkbox which is not a database field

2008-12-03 Thread cronet
#x27;Check this box' ) ); But the validation progress ignores the whole policy field. Why? How can I validate this field in the model without creating the db field? Regards, Cronet --~--~-~--~---

JSON, AJAX or XML

2008-12-01 Thread cronet
eturning the geo coordinates or "false". But which format should this be (or is the more less to develop)? AJAX, JSON or XML? How can I parse this view using javascript (with jquery)? Regards, Cronet --~--~-~--~~~---~--~~ You received this message because you a

Re: Documentation - Cakes bad side

2008-10-03 Thread cronet
I think the book is on the right way. Think a half year back! Nearly nothing was documented. Now, evertime I search a feature I look at the proper sections of the book. If you need help about Formhelper, look at the Built-In Helpers chapter. It is structured very well, and you find many things wi

Re: Praise the good book!

2008-09-27 Thread cronet
I would like to thank especially John David Anderson aka _psychic_ who has the overview about the documentation, and received so much indirect criticism in that era, where the book was not that what it is nowadays... Thank You !!! On Sep 27, 7:59 am, Duncan <[EMAIL PROTECTED]> wrote: > The bo

problems testing a model which uses geocoded behaviour

2008-09-11 Thread cronet
Hi, I have a problem in testing my model which act as geocoded. The funny thing (i think) is, that it works in the application perfectly, but, in the test it throws an error message. Fatal error: Call to a member function findByAddress() on a non-object in /Users/alexander/Sites/musiker-sucht.d

Re: testing bootstrap functions

2008-09-05 Thread cronet
Ok. Now i know that i can test the bootstrap functions everywhere. But where is the best place? To do that? Regards, Alexander On 5 Sep., 17:19, cronet <[EMAIL PROTECTED]> wrote: > Hi, > > i have a function defined in bootstrap. I putted it to bootstrap, > because I need th

Re: reverse routing won't work

2008-09-05 Thread cronet
Hi Jaime. I Found my mistake. I missed the generic pages route, hidden between comments. The router catches the first matching route, which was too generic. Switching the place in the source code does the trick. Specials first, generic last. Now I have another problem (indirect with routing): e

testing bootstrap functions

2008-09-05 Thread cronet
Hi, i have a function defined in bootstrap. I putted it to bootstrap, because I need the same function in Models, Controllers and Views. According the DRY principle i think the bootstrap is the best place. Now i would like to write a testcase for this function. Is there a way to do this? Regard

reverse routing won't work

2008-09-04 Thread cronet
Hi, I have a simple example. I would like to use reverse routing with my urls. In my routes.php Router::connect( '/neue_anzeige', array( 'controller' =

Re: Quick informal poll

2008-07-02 Thread cronet
I agree with Jonathan! The "Lord of the rings" Example shows us how powerful ACL in cake can be, and helped me a lot to get in touch with ACL. But (for me) it is far away from a real users project. Perhaps an example of controlling rights of a whole communitiy login with diffrent roles could be

Re: cake assumes first param as id

2008-06-01 Thread cronet
insert this line > >                 if( $this->Request->save($this->data) ) { >                         $this->redirect($redirect); >                 } > >         } > > On 2 июн, 06:50, cronet <[EMAIL PROTECTED]> wrote: > > > Quite simple:

Re: cake assumes first param as id

2008-06-01 Thread cronet
egards, Alexander On 1 Jun., 22:57, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > And how are definded the models? > > On Sun, Jun 1, 2008 at 1:51 PM, cronet <[EMAIL PROTECTED]> wrote: > > > Already done. It's not that easy... > > > Array >

Re: cake assumes first param as id

2008-06-01 Thread cronet
ROTECTED]> wrote: > Look at pr($this->data) > > On Sun, Jun 1, 2008 at 9:22 AM, cronet <[EMAIL PROTECTED]> wrote: > > > Hi, > > > i have this routes defined: > > > Router::connect('/musiker/neu', array('controller' => 

cake assumes first param as id

2008-06-01 Thread cronet
Hi, i have this routes defined: Router::connect('/musiker/neu', array('controller' => 'requests', 'action' => 'add', 'musician')); Router::connect('/band/neu', array('controller' => 'requests', 'action' => 'add', 'band')); My Controller looks like this: function add ($type) { $inputs =

Re: routes and named params

2008-06-01 Thread cronet
7;controller' => 'requests', > 'action' => 'view', 'musician')); > // $this->passedArgs[0] == 'musician' > > Router::connect('/bands', array('controller' => 'requests', 'action' &g

routes and named params

2008-05-31 Thread cronet
Hi, I want to achieve different URLs map to the same controller with different named arguments. The named arguments should not appear in the URL itselfs... Examples: URL: /musicians Mapped to: RequestsController->view(); $this->passedArgs['type'] = 'musician'; URL: /bands Mapped to: Request

Re: Sanitize and validation

2008-03-08 Thread cronet
g debug() to examine the data before and after sanitizing to > see what the differences are. > > On Mar 3, 6:42 pm, cronet <[EMAIL PROTECTED]> wrote: > > > Nobody else having problems with sanitzing data and validate on save ? > > > I'm still having this probl

Re: Sanitize and validation

2008-03-03 Thread cronet
Nobody else having problems with sanitzing data and validate on save ? I'm still having this problem. I would like to know how to get my data mysql safe and validating correctly. Anybody has some hints for me? Regards, Alexander --~--~-~--~~~---~--~~ You receive

Request view without controller function

2008-02-12 Thread cronet
Hi, is there a possibility to create views without a controller ? e.g. I have a view directory "news". I want to display all views automatically without the controller function! If someone request http://domain.com/news/abc it should render abc.ctp (but without crating the controller function)

e-Mail Spam Protection

2008-02-06 Thread cronet
Hi, In the template engine smarty, there exists an protection which encodes the address e.g. in hex chars. So the address isn't grabbable by spam bots via source... is there something like an e-Mail Spam protection or do I need to create a helper? regards, Alexander --~--~-~--~~-

Case by case validation

2008-02-03 Thread cronet
Hello, how realising case by case validation ?? (e.g. A form need to validate different for a user logged in, or not logged in) First, I thought about creating two different Models with the different validation cases. But what about the funcitons I need for the models which I would pack in the

Re: Simple "GROUP BY" ?

2008-01-21 Thread cronet
c. If you don't use them, you don't need 'group by' in > your query. I think that use of 'order by' would be enough in your > situation, so you need to add an order value to findAll to order it by > photo_id. > > On 20 Sty, 23:10, cronet <[EMAIL PROTECTE

Simple "GROUP BY" ?

2008-01-20 Thread cronet
Hi, I'm siting here for about 2 hours and get it not work. I need a simple group by in an association. This is in my controller: $this->Hotel->bindModel( array('hasMany' => array( 'HotelDescriptionTranslation' => array(

Re: Session db - format

2008-01-13 Thread cronet
Exactly what I need! Thank you!! On 14 Jan., 01:48, jarmstrong <[EMAIL PROTECTED]> wrote: > Look at the php serialize functions. > > http://us2.php.net/serializehttp://us2.php.net/manual/en/function.unserialize.php > > > > Cronet wrote: > > > Hi, >

Session db - format

2008-01-13 Thread cronet
Hi, it's more a general question, not directly cake related. If I store a Session in my db, the "data" field looks like: Config|a:3:{s:9:"userAgent";s:32:"c8cea9c1eac13b66616ef07d94528a70";s: 4:"time";i:1199123052;s:4:"rand";i:1343036056;}Message|a:0:{}ref|s: 12:"/users/index";ref1|s:13:"/user

Session db - format

2008-01-13 Thread cronet
Hi, it's more a general question, not directly cake related. If I store a Session in my db, the "data" field looks like: Config|a:3:{s:9:"userAgent";s:32:"c8cea9c1eac13b66616ef07d94528a70";s: 4:"time";i:1199123052;s:4:"rand";i:1343036056;}Message|a:0:{}ref|s: 12:"/users/index";ref1|s:13:"/user

Re: Autocomplete Component produces invalid xhmtl

2007-11-27 Thread cronet
I'm most famliar with: > > $(document).ready(function() { > $("CityNameDe").attr("autocomplete", off"); > > }); > > You will have to tweak the original code in the autocomplete helper > and remove the autocomplete='off' option

Autocomplete Component produces invalid xhmtl

2007-11-27 Thread cronet
Hi, i'm using Nate's excellent autocomplete class in Cake 1.2 (http:// cakebaker.42dh.com/2006/06/06/autocompletion-the-easy-way/) calling it simple in view: echo $ajax->autocomplete('City.name_'.$lang); output: But, "autocomplete" is no valid value in xhtml, and the Site is marked as no

Custom Validate for search - security question

2007-11-25 Thread cronet
Hi, I'm performing a search the following way function searchform() { // Displays searchform } function search_redirect() { // redirect to get values $this->redirect("/results/".$this->data['Search']['searchvalue1']."/". $this->data['Search']['searchvalue2']."/".$this->d

Re: language problem

2007-11-24 Thread cronet
.. Perhaps this file was created from PoEdit, which I used to translate the strings. I don't know. Hope that helps other too. Regards, Alexander On 24 Nov., 20:24, cronet <[EMAIL PROTECTED]> wrote: > No, > > i haven't installed the auth component. > > On 24

Re: language problem

2007-11-24 Thread cronet
om the following lines in Auth component : > > $this->loginError = __('Login failed. Invalid username or > password.', true); > $this->authError = __('You are not authorized to access that > location.', true); > > (line 229 /

Re: language problem

2007-11-24 Thread cronet
> msgstr "bar" > > does it work when you access the view ? > > On Nov 24, 5:27 pm, cronet <[EMAIL PROTECTED]> wrote: > > > no, > > > it's the latest stable 1.2 alpha > > > On 24 Nov., 17:26, foxmask <[EMAIL PROTECTED]> wrote: >

Re: language problem

2007-11-24 Thread cronet
no, it's the latest stable 1.2 alpha On 24 Nov., 17:26, foxmask <[EMAIL PROTECTED]> wrote: > cakephp 1.1.x.x ? > > On Nov 24, 5:21 pm, cronet <[EMAIL PROTECTED]> wrote: > > > I think my files are correct, because, it worked already in > > development

Re: language problem

2007-11-24 Thread cronet
y default.po > > msgid "lang_iso_code" > msgstr "fr" > > msgid "lang_direction" > msgstr "ltr" > > On Nov 24, 5:06 pm, cronet <[EMAIL PROTECTED]> wrote: > > > hi, > > > I created the folder /app/locale/deu/LC_M

language problem

2007-11-24 Thread cronet
hi, I created the folder /app/locale/deu/LC_MESSAGES/default.po In my app_controller i set uses('L10n'); before the class call and within beforeFilter(): $this->Session->write('Config.language', "deu"); Now, i thought, all __() constructs would be translated with the po file.

cakePHP Console script generates timeout

2007-11-21 Thread cronet
Hi, i've written a shell for the cakphp console, which takes long time. (It tries to load about 250 MB data with XML in small steps). But: Althought i set max_execution_time and max_input_time to 0 (in php.ini), for both, apache and cli version of php5, i get the message Fatal error: Maximum ex

Call action within action (in console)

2007-11-15 Thread cronet
Hi, i've written a console shell skript. I need to call the actions, within the main action. e.G. function main() { X-> Here i want to call update1 with argument X-> Here i want to call update2 with argument } function update1($id) { } function update2($id) { } Is there a way to

Associations Problem

2007-11-06 Thread cronet
Hi, I have a tricky Associationsproblem: The Data is retrieved by an XML Request and Stored locally. For that i wrote a console shell script which works fine at this time. Following DB Structure: CREATE TABLE `hotel_types` ( `id` int(11) NOT NULL auto_increment, `hoteltype_id` int(255) NOT

Re: xml parsing

2007-11-05 Thread cronet
Hi, I'm also running SimpleXML. It looked easier than the Cake XML Class. As Langdon Stevenson said, try it, if it fits your need, use it ;) Greetings On 2 Nov., 21:02, moesian <[EMAIL PROTECTED]> wrote: > Hi, > > I want to parse a few xml feeds and stick their contents into a > database. Wh

DB Structure Question

2007-11-01 Thread cronet
Hi, i'm getting Data from a XML Service which i need to store locally. But now i don't know what DB Structure (esp. Prim Key) to choose... e.G. descriptiontype_id description language descriptiontype_id is not unique. Each descriptiontype_id has different languages. So what to choose as Prim

Using different Primary Key (not id)

2007-11-01 Thread cronet
Hi, is there a way to tell cake that the PK of an table is not "id" ? e.g. Table "hotels" id hotel_id hotel_type languagecode countrycode Table "hotel_types" id hoteltype_id name Now, i need to connect, hotels.hotel_type with hotel_types.hoteltype_id? Greets, Alexander --~--~-~--

XML and XML-RPC

2007-10-23 Thread cronet
Hi there, i read that it is possible to handle XML Requests (or XML-RPC?) How can I request XML Data from a webservice? I tried something like this in my controller: function index() { uses('Xml'); $xmldata =& new XML('http://xmlserver/xml/request1'); } This is the way described in the thinki

Re: datetime - cake related problem

2007-09-25 Thread cronet
//Flash a message and redirect. > $this->flash('Your information has been saved.', >'/properties/view/'.$this- >> data['MusicianRequest']['id'], 2); > } > //if some fields are invalid or sa

datetime - cake related problem

2007-09-23 Thread cronet
Hi, i'm trying to save a single datefield. My Controller looks like this: -%< // Set ID and lifetime $this->MusicianRequest->id = $id; $lifetime = trim(date( "Y-m-d H:i:s", strtotime( "+4 weeks", strtotime($this->data['MusicianRequest']['l

Re: 2 basic Problems - Validation and Date Fields

2007-09-17 Thread cronet
;[EMAIL PROTECTED]> wrote: > $this->cleanUpFields() should work, if not you must put a ticket in > trac.cakephp.org . > > On Sep 14, 4:05 pm, cronet <[EMAIL PROTECTED]> wrote: > > > Hi there, > > > i get rid of simple things... (Things which worked already)... I could &

2 basic Problems - Validation and Date Fields

2007-09-14 Thread cronet
Hi there, i get rid of simple things... (Things which worked already)... I could bang my head to the wall !! My first cake app, and i'm very impressed by cakephp. Tow basic things won't work for me: I think i'm doing all right, but the automagic of validating fields and throwing an error won't

Re: unbind and Pagination

2007-09-04 Thread cronet
nder.id" etc in various places and you'll probably sort things out. > You need to watch the debug output quite carefully to see where the > changes take effect and steer you to the right place. > > H > > On 9/3/07, cronet <[EMAIL PROTECTED]> wrote: > > >

unbind and Pagination

2007-09-03 Thread cronet
Hi, i have a question concerning the pagination and unbinding associations. My Model has a bunch of hasMany and habtm Associations which i want to unbind, because for this request I need only the hasOne UserProfile Model which is already defined in the User Model. I do this: $this->User

Question to associations

2007-08-26 Thread cronet
Hi there, I read the manual article, but there are still some questions. 1) If I define a hasOne relationship.The manual says: If I set 'dependent' to true, the associated row is also deleted. But what happens contrariwise? If I create a row in the User table, will the UserProfile (with no data

Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet
eforeFilter function have no parameters > but you can get the parameters sent to the action by $this->params > > On 21 août, 13:28, cronet <[EMAIL PROTECTED]> wrote: > > > 2. Great. This works! > > > 3. That's great for debbugging! > > ehm. But: >

Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet
parameters of the action (array) > $this->passedArgs // named parameters of the action (array) > > On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote: > > > Thank you for your reply. > > 1. Ok. 1 is clear now. > > > 2. How do i extend AppController? >

Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet
ler's variables with $this. > Maybe I don't understand well your question here... > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote: > > > Hi There, > > > I just started using cake, and having heavy troubles getting some > > basic things to work

Newbie starting questions for 1.2.x!

2007-08-21 Thread cronet
Hi There, I just started using cake, and having heavy troubles getting some basic things to work 1. How do I define a function without a view? I read somewhere on the net, that these actions/functions start with a double underscore... example: function __validateLogin() Is this okay? 2. How