database configuration from core/database.php

2010-07-08 Thread Melanie Sommer
Hello, is there a way to access the database configuration that is saved in core/database.php form a behaviour? Background: I would like to get some information from the database in a behaviour. Unfortunately the database table does not belong to the current model and loading the model using

Re: use model in behaviour

2010-07-05 Thread Melanie Sommer
Which callback? BeforeFind, but is that important? The model instance is passed to the callbacks I know, but I do not want to use that model of the callback but a different model - and this is not passed to the callback. Check out the new CakePHP Questions site http://cakeqs.org and help

use model in behaviour

2010-07-04 Thread Melanie Sommer
Hello, How can I use a model in a behaviour? I created a behaviour with a callback function. In one specific situation I would like to do a find on one of my models. From old codes it seems in cakephp 2.6 $model-mymodelname-find() worked. Now I am using cakephp version 3 and I get the error

Auth, login, own validation of password

2010-06-28 Thread Melanie Sommer
Hello, I would like to use the user and password table of a CMS for authentification in my small cake application. So I told cake to use the table form the database for users. class User extends AppModel { var $useTable = 'cms_users'; } I know how to check whether the password from the

Auth::authorize - controller -- How to handle guests?

2010-06-24 Thread Melanie Sommer
Hello, I am using AuthComponent with authorization from the controller. Thus my app_controller.php looks like ## class AppController extends Controller { var $components = array('Auth','RequestHandler'); var $uses = array('User'); public function

Re: validation errors

2010-06-24 Thread Melanie Sommer
Hello Mark, thank you for your detailled explanation. It works :-) Melanie 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

Re: validation errors

2010-06-20 Thread Melanie Sommer
Because Cake do not save if validation failed and pass validation errors to view automatically. Form helper render these errors when use $from-input() method. Yes it does and it works beautifully - but not for input fields that do not belong of the current model. If my Model1 has only

validation errors

2010-06-19 Thread Melanie Sommer
Hi, In an add view I have several input fields that contain data for more than one model. I sort, validate and save this data in the controller using if($this-Model-validates()){ $this-Model-create(); if($this-Model-save($data)){ ... }else{ ... } }else{

Migrating to 1.3 - error undefned property: view::$session in default.cpt

2010-06-12 Thread Melanie Sommer
Hello, I tried to migrate from 1.2.7 to 1.3.2. I downloaded cake 1.3.2 and ran the console to create a new project. All I did in this new project is edit the app_controler.php file and include the line var $helpers = array('Html'); I then get the error message (when calling cake/myapp) Notice:

Re: Migrating to 1.3 - error undefned property: view::$session in default.cpt

2010-06-12 Thread Melanie Sommer
Sorry I forgot the second part of the error message: Fatal error: Call to a member function flash() on a non-objekct in / app/views/layouts/default.ctp on line 43 Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this

Re: view as downloadable text/plain

2010-04-16 Thread Melanie Sommer
Because the View class uses output buffering. Have a look at MediaView instead: Thank you; but I am afraid I did not figure out how this helps me MediaView Summary: Methods to display or download any type of file I do not want to display or download a file as there exists no file. The content

Re: view as downloadable text/plain

2010-04-16 Thread Melanie Sommer
I just wrote a quick PlaintextHelper (3 minutes!) based on the CsvHelper I'm already using. Check it out here: http://pastebin.com/u46cWX7T Well it does not work, header is still html. I also do not understand why it should work. The only thing you are doing is taking

Re: view as downloadable text/plain

2010-04-16 Thread Melanie Sommer
I now simply wrote header(Content-Type: text/plain); header('Content-Disposition: attachment; filename=text.txt'); into my controller - that seems rather dirty, but it works. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You

view as downloadable text/plain

2010-04-12 Thread Melanie Sommer
I want to have the output as plain text offered with a download dialog. This works fine on my server with a .php file outside of cake that looks like ?php header(Content-Type: text/plain); header('Content-Disposition: attachment; filename=test.tex'); echo aa\n\na\ta\ta? In cake I create a new

Access Control

2010-01-16 Thread Melanie Sommer
I am programming a database front-end. The database contains data for various products, one table for the data, another for the product, one for the company, all related to each other with belongsTo and hasMany. I want to restrict the access of users to individual datasets. Every table has a

paginating - several on one page

2009-12-27 Thread Melanie Sommer
Hello, I try to have several tables with paginated data in one view. ### texttexttexttext div with paginated data 1 div with paginated data 2 div with paginated data 3 ### When loading the page the first time everything seems correct except

Re: Order by Contain field

2009-10-22 Thread Melanie Sommer
Hi does anyone know if it's possible to order by a contained fields? It seems to me like a simple task but I'm unable to manage it.. I have a User model associated with a Group field and I'd like to order User by Group.name. Do you mean paginator function sort() ? There you simpy need to

Re: validate - unique - error message

2009-10-12 Thread Melanie Sommer
Hello Marcelo, Check the CakePHP version you're using is the same used in the tutorial. It is not (I am using the latest version), but that does not help me to learn how I can get error messages. Melanie --~--~-~--~~~---~--~~ You received this message because you

validate - unique - error message

2009-10-11 Thread Melanie Sommer
Hello, I am using code from the bakery tutorials to validate my form elements for unique records. http://bakery.cakephp.org/articles/view/checking-for-duplicate-records-unique-record (I am using the code of comment no. 5 as I need to validate for a unique combination of fields) It works fine,

paginator, containable - sort() does not work for not directly related fields

2009-10-05 Thread Melanie Sommer
Hello, I have a very nested belongsTo/hasMany structure of my models: A belongsTo C B belongsTo C C belongsTo D D belongsTo E F belongsTo E G belongsTo E In E/index I want to list all E with the respective titles of all related models. EsController looks like this:

Re: $form-input('') when database-field contains special characters

2009-10-03 Thread Melanie Sommer
Hello Martin Since the field is empty I suspect you may have Sanitize in place, or some other text cleaner. No (not that I know, just the standard content that cakephp gives you when baking) A simple character set problem should give you garbage but not empty strings. This is also was I

paginator, containable - what $key for sort()

2009-10-02 Thread Melanie Sommer
Hello, I am using containable behaviour in paginate() in my controller namend E. In my view I can use sort('title of cell in table E') to sort the results. But I did not find a way to sort by any fields not belonging to table E. I tried sort('D.cell name') - but the syntax seems to be wrong.

Re: paginator, containable - what $key for sort()

2009-10-02 Thread Melanie Sommer
Hello Brian, $paginator-sort('text in link', 'D.cell name', array('title' = 'title attribute of link')) this works - but only for models which are directly related to the actual model. Cakephp does not recognize Models which belong to a Model that belongs to the actual model (A belongsTo C, C

Re: find() when having nested models

2009-10-01 Thread Melanie Sommer
Hello Brian, thank you for the information about containable. It works fine, except for one problem. I use this code: $this-E-find( 'all', array( 'contain' = array( 'D' = array( 'fields' = array('D.title'),

Re: find() when having nested models

2009-10-01 Thread Melanie Sommer
Hi John, I think I read somewhere (here in the group) that you need to include the foreign keys in the fields definition, so containable can see them! I read contain automatically also includes the foreign keys in it's sql-query. http://book.cakephp.org/view/474/Containable : As you can see,

$form-input('') when database-field contains special characters

2009-10-01 Thread Melanie Sommer
Hello, I have the following problem, I already googled but did not find an answer although I think it must be a quite common problem: When adding or editing and inserting a special character in a text field (for example ä, ö, ü, ², µ, ...) everything seems at first to work fine. The text is

Re: find() when having nested models

2009-10-01 Thread Melanie Sommer
Hello John, I already tried putting all X.id and X.Y_id in the respective field arrays - no change. And this also does not explain, why cakephp does the right thing automatically when I select B, C, D, F, and G, but not when selecting A. What I do not understand is the difference between the

Re: find() when having nested models

2009-10-01 Thread Melanie Sommer
Problem solved. There was a typing error in the C model. Sorry! --~--~-~--~~~---~--~~ 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

interlinked selects

2009-09-29 Thread Melanie Sommer
Hello, Please excuse my bad English, I am not a native speaker. I only started CakePHP two weaks ago, read a book about it and am now trying to program my project. I have some experience in php, mysql, html and css but hardly any knowledge of javascript or ajax. I have several tables linked

find() when having nested models

2009-09-29 Thread Melanie Sommer
of acessing tables A and B? Do I really need query () or is there a different way? Thanks! Melanie Sommer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php