hasMany question

2008-01-25 Thread bob
i have a User table with 'id' and 'name' columns, and a Email table with 'user_id' and 'email' columns. if i have User hasMany Email, and in my UsersController, i do $this->User->findByEmail(...), it returns all of 'id', 'name', 'user_id', and 'email' columns. how do i make it so that it only retu

Re: Change layouts depending on conditions?

2008-01-25 Thread justradar
i'm trying to use this below code snippet and i'm having trouble ... // this code is located in app/app_controller.php function beforeRender() { if ($isUserLoggedIn){ $this->layout = 'new_layout'; } else { $this->layout = 'default';

admin in $params

2008-01-25 Thread FrenchEscapes
Is it just me or has the admin "params" disapeared when using admin routing. << isset($this->params[Configure::read('Routing.admin')]) >> would return true if in admin/controller and false if in /controller. This was a useful feature to tell if a page was being called as admin or `normally`. If

Re: Formhelper error

2008-01-25 Thread ProFire
Wow! It really worked! Thanks! I have been suspecting that the Model Class was at fault, but couldn't pin point the error. Thanks a lot! On Jan 26, 8:14 am, arambi <[EMAIL PROTECTED]> wrote: > Hello > > I had the same problem and I have solved it. The problem was that I > had the property $vali

Re: Newb - Auth Component Help

2008-01-25 Thread Neil
Forgot to memntion. The problem seems to be when I add "var $components = array('Auth');" to my UsersController. If I do not try to access the component my site works fine again (minus the the benefits of authComponent). On Jan 25, 8:16 pm, Neil <[EMAIL PROTECTED]> wrote: > Hello, > > I am simply

Newb - Auth Component Help

2008-01-25 Thread Neil
Hello, I am simply trying to mimic what is written in the manual about how to use AuthComonent at it's simplest form (http://tempdocs.cakephp.org/ #TOC142176). I am running into two problems. 1. my login page works but gives the following error: "Notice (1024): Please change the value of 'Secur

Re: Formhelper error

2008-01-25 Thread arambi
Hello I had the same problem and I have solved it. The problem was that I had the property $validate of the model defined but without pointing out that it is an array. The solution is the following one. You must write in the model var $validate = array () And it should work well Greetings On

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread [EMAIL PROTECTED]
Write wrappers for the find() function in your Library model. function adminFind() { return $this->find(); } fuction userFind() { $this->deleteStuff(); return $this->find(); } On Jan 25, 9:57 am, powtac <[EMAIL PROTECTED]> wrote: > In the beforeFind() I delete some data of the current user whi

Re: Auth / Acl and plugins

2008-01-25 Thread francky06l
Thanks David, I think I have solved my problem .. In any case, I can't make work the Auth is I have my user table in a plugin in a different DB. Looking at the node function is quite normal since the plugin name is not pass when searching for the User model. I am doing use management in the plugin

Re: TIP :: checkUnique on Update solution

2008-01-25 Thread Josoroma
Thanks greycells. Im using cake 1.2.x.x_01.01.2008, and the function checkUnique in: http://cakephp.pastebin.com/f7a7a9894 is using Model->isUnique(). How do i have to call this function from the validation in Model? Or what im doing wrong because i was having that problem with validation o upda

Re: Database design considerations

2008-01-25 Thread John David Anderson (_psychic_)
On Jan 25, 2008, at 3:11 PM, judouk wrote: > > ///sorry, gmail let me post it first before I'd finished and now > that I've had the time to rethink what I was typing, I think I've > solved my own problem ! > > > CREATE TABLE jobs ( > id int(10) not null auto_increment, > typeofjob varch

Database design considerations

2008-01-25 Thread judouk
///sorry, gmail let me post it first before I'd finished and now that I've had the time to rethink what I was typing, I think I've solved my own problem ! CREATE TABLE jobs ( id int(10) not null auto_increment, typeofjob varchar(20) not null, primary key(id) ) type = myisam; CREATE TABL

Database design considerations

2008-01-25 Thread judouk
Hi guys Before I start to create a database structure which I may end up changing, I wanted to run something past you all first. I have a list of jobs to do (JOBS). Each of these jobs may require one or more actions to complete it (ACTION). It would be nice to be able to report on how many act

Display Model Validation Messages with Form->month?

2008-01-25 Thread EchoChargen
Good afternoon, I have a form that will collect data for several models. One of them is a creditcards table that has 'ccexmonth' and 'ccexyear' fields. I bumbled around with the form helper until I came up with something, but it seems like there must be a slicker way to do it. I have the proble

Re: Defining private functions in controller

2008-01-25 Thread Samuel DeVore
http://manual.cakephp.org/appendix/conventions has the answer for you On Jan 25, 2008 1:08 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > Hello guys, > > It may be a novice question but i dont had an alternative apart from asking > you guys. I want to define some functions in controller that

hasOne association question

2008-01-25 Thread Corie
Using Cake 1.2, when I perform a findAll() on a model with a hasOne association it's returning an array for the associated table even if there is no record. Here's an example. // question.php class Question extends AppModel { var $name = 'Question'; var $hasOne = 'Answer'; } //

Defining private functions in controller

2008-01-25 Thread Novice Programmer
Hello guys, It may be a novice question but i dont had an alternative apart from asking you guys. I want to define some functions in controller that are private i.eno one should be able to use them as an action. What are the best practices to do so? -- Thanks & Regards, Novice (http://ishuonweb.

Re: Am I ready to learn the cake framework?

2008-01-25 Thread Baz
Ditto. If you're starting out, 1.2 makes more sense. There's more stuff in it, and it's different enough from 1.1 that there would be an unnecessary learning curve to upgrade. Especially if you've already got some projects in 1.1. -- Kevin Lloyd 3HN Designs http://www.3HNDesigns.com/ On Jan 25, 2

Re: TIP :: checkUnique on Update solution

2008-01-25 Thread GreyCells
For 1.2 this functionality exists in Model->isUnique() and was updated to deal with updates. See http://api.cakephp.org/1.2/class_model.html#e631f2cba7ec7fff079d3a7b62c46f0e and https://trac.cakephp.org/ticket/2032 ~GreyCells On Jan 25, 7:17 pm, Josoroma <[EMAIL PROTECTED]> wrote: > I started

Re: Am I ready to learn the cake framework?

2008-01-25 Thread [EMAIL PROTECTED]
I would go with 1.2 it has a lot for features and some pretty essential fixes as well. You can find the documentation here: http://tempdocs.cakephp.org/ Dave On Jan 25, 11:15 am, Neil <[EMAIL PROTECTED]> wrote: > Thanks for the thoughts, > > One other quick questions, should i start with cakePHP

TIP :: checkUnique on Update solution

2008-01-25 Thread Josoroma
I started to have problems when i was trying to checkDuplicate entries of fields in my models validations. I used on = create to check the unique value only in the creation but i need to check it in the update too. The problem with update is that the value already exist then your validation sucks.

Re: Auth / Acl and plugins

2008-01-25 Thread david_setwise
Hi Franky, Not sure if this will help, but I have recently started looking into the ACL Management Plugin. http://bakery.cakephp.org/articles/view/acl-management-plugin David On Jan 24, 10:09 am, francky06l <[EMAIL PROTECTED]> wrote: > Hi Bakers, > > I am having a problem withACLand Auth compo

Re: Am I ready to learn the cake framework?

2008-01-25 Thread Neil
Thanks for the thoughts, One other quick questions, should i start with cakePHP 1.2 or use the stable version? Currently I have been playing with the stable vesrion of cake but i notice lots of tutorials at the bakery are using 1.2. --~--~-~--~~~---~--~~ You recei

Re: Business Benifit?

2008-01-25 Thread nate
On Jan 24, 9:42 pm, "b logica" <[EMAIL PROTECTED]> wrote: > On Jan 24, 2008 4:36 PM, Doug @ Straw Dogs <[EMAIL PROTECTED]> wrote: > > > > I'm a developer by heart and know I'd love to code in CakePHP. > > However, I'm failing to see any solid business benifit in using it > > that can help me sell

Re: Where is the documentation?

2008-01-25 Thread Samuel DeVore
and http://tempdocs.cakephp.org/ for 1.2 Sam D On Jan 25, 2008 11:01 AM, Baz <[EMAIL PROTECTED]> wrote: > http://manual.cakephp.org/ > if you're just starting out. > > > > On Jan 25, 2008 10:15 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > > > > > > On Jan 25, 2008 9:23 AM, GardenWeazeL <[EMA

View data via relationship

2008-01-25 Thread judouk
Hi All I have three tables (A,B,C) which each contain data. TABLE USER TABLE COMPANY TABLE JOB id id id b_id c_id job name cname I have taken advice from my previ

Re: Am I ready to learn the cake framework?

2008-01-25 Thread [EMAIL PROTECTED]
I agree, with the above poster. Go ahead and start learning but really jump into OOP at the same time. Start using classes, understand how inheritance works and how to reference objects inside a class, and outside it. You can definitely start using CakePHP now but it helps to understand what's go

Re: Where is the documentation?

2008-01-25 Thread Baz
http://manual.cakephp.org/ if you're just starting out. On Jan 25, 2008 10:15 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > On Jan 25, 2008 9:23 AM, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > Thought that I would ask, is it me or does the cakephp web site not > > function corr

Re: Am I ready to learn the cake framework?

2008-01-25 Thread Baz
I think that learning the framework will actually help u with OOP a lot. Read some general tutorials and stuff, but you don't need to run through a 500pg OPP PHP before you start with cake. I will however say this though: Beef up your array knowledge a bit. Because that is the primary way that we

Re: Debug messages in 1.2 beta

2008-01-25 Thread [EMAIL PROTECTED]
Well I think the error is pretty straight forward. It seems like you have a controller that is trying to use a database table (pages) which does not exist. Have you created a custom model Page with a PagesController? If so I would recommend naming it something else (or at least change your routing

Re: dAuth v0.3 [Session losing 'salt' variable]

2008-01-25 Thread volve
I have found the cause of the problem. I appended a trac bug about it: https://trac.cakephp.org/ticket/830#comment:7 Basically high & medium security modes trigger PHP's session.referer_check and tell it to look for $this->host in every request's HTTP_REFERER. This logic immediately breaks down

Re: Importing and Executing Raw SQL: Problems with Semicolons

2008-01-25 Thread daphonz
At the moment, there is no reason beyond the fact I hadn't thought to do it. I ideally would like be able to read a straight SQL-dump, so I guess that would work, though I'd have to parse through the SQL first to construct the arrays. But those are the kind of philosophical changes that I'm look

Re: Conditional blocks in default layout

2008-01-25 Thread grigri
Just use the Session helper in the layout: check('User')) : ?> Hello again read('User.name'); ?> Welcome, guest! On Jan 25, 4:22 pm, Igor <[EMAIL PROTECTED]> wrote: > Perhaps i should add that what I'm trying to do is a single session > check that is accessible from different views. --~--~

Re: How to use Model->deconstruct()

2008-01-25 Thread grigri
> Without some special tricks, protected functions are only available in > PHP 5, and since Cake 1.x is supposed to work on both PHP 4 and PHP 5, > well, you can fill in the rest. Yes, I know :) And since quite a few hosts my clients' websites run on still use PHP4, I'm really greatful for that.

Re: How to use Model->deconstruct()

2008-01-25 Thread Chris Hartjes
On Jan 25, 2008 12:07 PM, grigri <[EMAIL PROTECTED]> wrote: > > > > You don't call it directly. Just use Model::set(). > > Shouldn't it be protected then? > Without some special tricks, protected functions are only available in PHP 5, and since Cake 1.x is supposed to work on both PHP 4 and PHP

Re: How to use Model->deconstruct()

2008-01-25 Thread grigri
> You don't call it directly. Just use Model::set(). Shouldn't it be protected then? On Jan 25, 4:06 pm, nate <[EMAIL PROTECTED]> wrote: > You don't call it directly. Just use Model::set(). > > On Jan 25, 10:14 am, chad <[EMAIL PROTECTED]> wrote: > > > try this: $this->Section->deconstruct('p

Am I ready to learn the cake framework?

2008-01-25 Thread Neil
Hello, I started PHP about 5months ago and I would say my skill level is early intermediate. I can do lots of things with php like create members areas, message boards, profiles and more, but when I build these applications a barely make use of things like arrays and loops. I code in a persudal f

Re: Conditional blocks in default layout

2008-01-25 Thread Igor
Perhaps i should add that what I'm trying to do is a single session check that is accessible from different views. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email t

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread powtac
In the beforeFind() I delete some data of the current user which should only be in the database for 60 minutes. But when I want to take a look on the data as admin I dont want to delete anything... --~--~-~--~~~---~--~~ You received this message because you are subs

Re: Problem with AuthComponent - not completly working?

2008-01-25 Thread red
Heh, problem solved... I had: Configure::write('Session.cookie', 'ADMIN panel'); When I removed lowercased letters and space session works perfect. It's a bug or a feature? :) The name of CakePHP's session cookie always must be uppercase and without spaces? On 25 Sty, 17:19, red <[EMAIL PROTE

Re: Beyond black and white validation?

2008-01-25 Thread John David Anderson (_psychic_)
Not sure if this is a good idea or not, but let me think out load for second. What if you created an additional model just for warnings? You could create all the rules just for that model, and use vanilla form helper error messages, controller workflow, etc. Then you could also validate th

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread grigri
> How can I access to the params in model? You can't. You're not supposed to. The params belong to the controller - who processes the user action. Your 'Library' model should not know or care whether the user is an administrator. It just does whatever the controller tells it to, which DOES know

Re: Beyond black and white validation?

2008-01-25 Thread grigri
> Can you tell us more about why you need warnings? Sure, no problem. It's quite simple really. I need to set up some validation rules that, when not matched, don't mean "the data is definitely not valid and cannot be saved" but "the data is probably not valid and I want to double-check if the u

Re: Problem with AuthComponent - not completly working?

2008-01-25 Thread red
Another thing: function login() { echo ""; var_dump($this->Auth->user()); echo ""; } and $this->Auth->autoRedirect = false; So when I click Login I see: array(1) { ["User"]=> array(6) { ["id"]=> string(1) "1" ["l

Re: Where is the documentation?

2008-01-25 Thread Chris Hartjes
On Jan 25, 2008 9:23 AM, GardenWeazeL <[EMAIL PROTECTED]> wrote: > > Hi All, > Thought that I would ask, is it me or does the cakephp web site not > function correctly when viewing the docs in some areas such as the > class info. ? > > Are there any sites that you can recommend with _solid_ tutori

Debug messages in 1.2 beta

2008-01-25 Thread Virtim
Hey guys. I just upgraded to 1.2 beta and i see the debug messages have changed. In the earlier versions of Cakephp they were very detailed ( file, line number, etc ) and now all I get is sometihng like: Missing Database Table Error: Database table pages for model Page was not found. Notice: I

Conditional blocks in default layout

2008-01-25 Thread Igor
Hi! Could anyone please tell me where do i place the user authentication check ($this->Session->check('User')) that allow me to show the conditional content in default layout? Thanks. /Igor --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Business Benifit?

2008-01-25 Thread jonknee
If I was trying to sell CakePHP to a boss, here's the route I'd take: * Rapid development which means more projects can be completed with the same staff (and a higher per hour billing rate) * Using a framework keeps code organized which means it's significantly easier to maintain and bring new pe

View this page "Cake Apps/Sites In The Wild"

2008-01-25 Thread Bo-oz
Added my site. http://www.iamin.com thanks... happy baking. Click on http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild - or copy & paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ You received this messag

Where is the documentation?

2008-01-25 Thread GardenWeazeL
Hi All, Thought that I would ask, is it me or does the cakephp web site not function correctly when viewing the docs in some areas such as the class info. ? Are there any sites that you can recommend with _solid_ tutorials for people new to cakephp? For example, I want to add a class to my existi

Re: Problem with AuthComponent - not completly working?

2008-01-25 Thread red
I've tried - it's not problem with redirecting :( It looks like this: 1. I'm entering /admin/customers/index 2. It redirects me to /users/login, I'm entering data and click Login 3. I'm still on the /users/login :( 4. When I set $this->Auth->autoRedirect = false; I can see this debug with affecte

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread powtac
Hi red, I'm sorry this seems not to be working in the (1.2) model: Undefined property: library::$params How can I access to the params in model? powtac --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" gro

Re: How to use Model->deconstruct()

2008-01-25 Thread nate
You don't call it directly. Just use Model::set(). On Jan 25, 10:14 am, chad <[EMAIL PROTECTED]> wrote: > try this: $this->Section->deconstruct('publicationday', $this- > > >data['Section']['publicationday']) > > On Jan 25, 8:55 am, laeffe <[EMAIL PROTECTED]> wrote: > > > Hello all. > > Just plo

Re: Problem with AuthComponent - not completly working?

2008-01-25 Thread Chris Hartjes
On Jan 25, 2008 10:57 AM, red <[EMAIL PROTECTED]> wrote: > function beforeFilter() { > $admin = Configure::read('Routing.admin'); > > $this->Auth->userModel = 'User'; > $this->Auth->fields = array('username' => 'login', 'password' > => > 'pa

Re: Beyond black and white validation?

2008-01-25 Thread John David Anderson (_psychic_)
Can you tell us more about why you need warnings? The simplest alternative might be a completely alternate approach. -- John On Jan 25, 2008, at 8:19 AM, grigri wrote: > > I am using 1.2 (have been for a while), and I'm very impressed by its > validation system. But I can't see how I can do

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread red
Don't know any. But you can still put this 'global' things in global AppController. On 25 Sty, 16:49, powtac <[EMAIL PROTECTED]> wrote: > Great! Thanks. > > Is there an other more global solution to prevent before*() after*() > functions to be executed? --~--~-~--~~~-

Re: Business Benifit?

2008-01-25 Thread powtac
Cake or any other MVC php framework is the state-of-the-art way of php/ web programming. This is could be a margeting argument. Show your boss the 15 minute setting up a blog on a ready mysql database. And ask him then for improvement he would like to see. Then just explain him how and where (con

Problem with AuthComponent - not completly working?

2008-01-25 Thread red
Hi all, I have really strange problem with AuthComponent. Let me explain - the global AppController: class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { $admin = Configure::read('Routing.admin'); $th

Re: Functions in models

2008-01-25 Thread powtac
http://groups.google.com/group/cake-php/browse_frm/thread/4d8e4e0d5f33e5bb/4845ef32ed9c304d?lnk=gst&q=models+in+other+models http://groups.google.com/group/cake-php/browse_frm/thread/20d47ead223f4df7/c468e97fa443ecc9?lnk=gst&q=models+in+other+models http://groups.google.com/group/cake-php/browse_f

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread red
Try this: function beforeFilter() { if (isset($this->params[Configure::read('Routing.admin')])) { // things for admins } else { // things for not admins } } On 25 Sty, 16:39, powtac <

Re: Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread powtac
Great! Thanks. Is there an other more global solution to prevent before*() after*() functions to be executed? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cak

Re: fileinfo help needed

2008-01-25 Thread powtac
And also on this google search result: http://www.google.com/search?aq=f&hl=en&client=firefox-a&rls=org.mozilla%3Ade%3Aofficial&hs=yOl&q=pecl+fileinfo+supplied+argument+is+not+a+valid+file_info&btnG=Search --~--~-~--~~~---~--~~ You received this message because you

Re: fileinfo help needed

2008-01-25 Thread powtac
Take a look at this bug report on PECL: http://pecl.php.net/bugs/bug.php?id=7391 --~--~-~--~~~---~--~~ 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 unsu

Re: How to implement "Export to CSV" link in cake-php

2008-01-25 Thread powtac
To display just the link you can use this in your view: link( 'Export to CSV', '/link/to/your/export/csv/ controller', array('target'=>'_new'), null, false);?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PH

Preventing the execution of beforeFind() on calling an admin function?

2008-01-25 Thread powtac
How can I avoid the execution of any before*() function in the modell when calling an admin function in ancontroller? Example: http://www.example.com/admin/libraries/ In my Libraries-controller I have a function named admin_index(). Now the beforeFind() in my model "Library" is called. But I on

Looking for help working through a logic problem (shopping cart related)

2008-01-25 Thread designvoid
Hi all, I'm currently trying to complete what I thought would be a fairly simple shopping cart, however I have run into some issues with the logic side of add/updating a users cart. As it stands I have a cart table & a cart options table (to store users product variation choices), now I have it

Re: Beyond black and white validation?

2008-01-25 Thread grigri
I am using 1.2 (have been for a while), and I'm very impressed by its validation system. But I can't see how I can do what I need without more code. I'll try and explain. The basic system of "warnings" could be implemented by having a beforeValidate() method (in a Behavior or Model) which enumera

Re: How to use Model->deconstruct()

2008-01-25 Thread chad
try this: $this->Section->deconstruct('publicationday', $this- >data['Section']['publicationday']) On Jan 25, 8:55 am, laeffe <[EMAIL PROTECTED]> wrote: > Hello all. > Just plowed thru a couple of posts discussing (and looked in the api) > this issue but I couldn't figure out to use Model->decon

Re: Business Benifit?

2008-01-25 Thread Baz
That's what I'm talking bout AD7six, you gotta show them. Even for me (as a developer) I've read all the Ruby on Rails hype, never really bought into it. A colleague of mine mentioned that he was going to start developing in RoR, to which my response was "Why?". Until I saw the screen cast (hey, t

Re: views without controllers or models??

2008-01-25 Thread [EMAIL PROTECTED]
On Jan 24, 6:41 pm, CodeKing <[EMAIL PROTECTED]> wrote: > What I would do would be rework the routing so all requests go to a > controller no matter what path, and have the path be passed to an > argument for the action function.  Then in the view have it use > include to get a page from the exi

Re: Form field values after postback

2008-01-25 Thread Chris Hartjes
On Jan 25, 2008 8:43 AM, Geo <[EMAIL PROTECTED]> wrote: > > It works fine if i put the Model name into the $form->text like so: > > $form->text('Model.test') ... however i am not using a database table > for this model and would prefer not to change all the $form->text in > if possible First of a

Re: Business Benifit?

2008-01-25 Thread Chris Hartjes
On Jan 24, 2008 9:42 PM, b logica <[EMAIL PROTECTED]> wrote: > > Like it or not, CakePHP needs a bit of a sales pitch that management > can understand. > So CakePHP is supposed to provide marketing materials for people to convince their bosses to let them use it? I know we're getting close to fl

Re: Beyond black and white validation?

2008-01-25 Thread John David Anderson (_psychic_)
On Jan 25, 2008, at 6:38 AM, grigri wrote: > > I'd like to hear some suggestions on cakeifying an existing system. > > Cake's validation is wonderful, but it only allows "yes this is good" > and "no it isn't". I've got an application I need to port that has > automated warnings built in for some

Re: Cake 1.2 open_basedir ERROR

2008-01-25 Thread MonkeyGirl
> Hi, > > When I update my 1.19 to 1.2 beta, I saw these below: > > "open_basedir restriction in effect" > > What's going on? Hmm... Are you using Plesk by any chance? If so, you may need to update your vhost.conf with the following: DocumentRoot /[full path to your website]/app/webroot php_adm

How to use Model->deconstruct()

2008-01-25 Thread laeffe
Hello all. Just plowed thru a couple of posts discussing (and looked in the api) this issue but I couldn't figure out to use Model->deconstruct().. I thought I could use it like this print_r($this->data); $data = $this->Section->deconstruct("publicationday", $this- >data["Section"]); var_dump($da

Re: Form field values after postback

2008-01-25 Thread Geo
It works fine if i put the Model name into the $form->text like so: $form->text('Model.test') ... however i am not using a database table for this model and would prefer not to change all the $form->text in if possible On 25 Jan, 12:04, Geo <[EMAIL PROTECTED]> wrote: > hmmm, > > Just noticed tha

Re: Form field values after postback

2008-01-25 Thread MonkeyGirl
> Just noticed that this only happens if i do a : > > $form->text('test'); > > rather than: > > > > anyone know why? Usually any bug to do with just the first character of a string is a sign that the string's being treated as an array. For example, echoing out $string[0] will just return its fir

Beyond black and white validation?

2008-01-25 Thread grigri
I'd like to hear some suggestions on cakeifying an existing system. Cake's validation is wonderful, but it only allows "yes this is good" and "no it isn't". I've got an application I need to port that has automated warnings built in for some fields. Although my system is quite specific (it's a h

Re: Propagating validationErrors from Behavior to View

2008-01-25 Thread GreyCells
Hi grigri The way I thought of is assign any Behaviour validationErrors to a controller instance of that particular model (via a model- >getBehaviourErrors() method) - but it sorta defeats the idea of having a behaviour acting at the model level... hence the question - the implementation seems a

Re: enum

2008-01-25 Thread MonkeyGirl
> How would you get the enum values from the model or controller? By far the easiest way is to go to http://cakeforge.org/snippet/detail.php?type=snippet&id=112 and copy and paste the code that's there into app_model.php, then you can just use lines like the following in your code: $types = $th

HABTM data after Validation Error

2008-01-25 Thread stefan
so i have another simple question: i have a simple edit form with some habtm-relations. if i use data validation and get a validation error while saving, in the following edit-view none of the related data is loaded. but if i manually do a $model->read i loose the user-input from the post data. i

Re: Can't scaffold a table named line_items in cake_1.1.19.6305

2008-01-25 Thread chun-hoo N
I had the same problem for baking I check the problem, it seems like cakePHP doesn't like underscored table name anymore so to pass through i hacked the bake.php : 900 $modelObj =& ClassRegistry::getObject($modelKey); replace by : 901 $modelObj =& ClassRegistry::getObject($currentModelName);

Re: Propagating validationErrors from Behavior to View

2008-01-25 Thread grigri
Controller, Model, View and Helper all have a class variable called 'validationErrors'; When Model::invalidFields() is called (e.g. from Model::save()), the model's $validationErrors is set. This array is field-keyed, like `array( 'title' => ..., 'description' => ...) When the controller goes to

Re: Model->Del() causes SQL Error

2008-01-25 Thread stefan
thanks for your tips. i'm using 1.2.0.6311 beta right now, hopefully there are no other problems when updating On 25 Jan., 11:37, villas <[EMAIL PROTECTED]> wrote: > This may be related to the thread I started 'Problem with Delete'. > > I decided that DELETE {Alias} FROM Table must be non-standa

Re: Updating a generateList() to use find("list") - problems with syntax?

2008-01-25 Thread grigri
Glad it's finally working! It's odd, because trac says that this area of the model file hasn't been changed since changeset 6360 (10th Jan 2008). > It must have been fixed by those mysterious code fairies > that work so tirelessly behind the scenes. Maybe it really is a case of the Elves and th

Propagating validationErrors from Behavior to View

2008-01-25 Thread GreyCells
I have a model that has a behavior. e.g. Post var $actsAs = array('Attachment'); When the Post model is saved, the behaviour->beforeSave callback is fired to save or update the Attachment model. My question is: How do I cleanly propagate any errors raised by the Attachment model back to the Vie

Re: Form field values after postback

2008-01-25 Thread Geo
hmmm, Just noticed that this only happens if i do a : $form->text('test'); rather than: anyone know why? On 25 Jan, 10:39, Geo <[EMAIL PROTECTED]> wrote: > Hi, > > I have an issue with my site. when i submit a form that fails > validation and returns back to the form - only the 1 chara

Discussion on cake-apps-sites-in-the-wild

2008-01-25 Thread Thrilller
Hi to all bakers please add http://upfitness.co.uk/ a CMS , BLOG , Articles management website developed in cake 1.1.X happy baking --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this

Re: Installing CakePHP on MAMP

2008-01-25 Thread gerhardsletten
If you install in in your own homedirectory /Users/name/Sites check you httpd prefs for this folder, you find it in /private/etc/apache2/ users/. If not present create it. In mine I have this: # # This may also be "None", "All", or any combination of "Indexes", # "Includes", "FollowSymLinks", "

Re: Updating a generateList() to use find("list") - problems with syntax?

2008-01-25 Thread RichardAtHome
I tried the very latest nightly build this morning (25th) and its working as intended. /cheer I had previously tried the nightly build on the 23th (as recommended by grigri) which still exhibited the problem. It must have been fixed by those mysterious code fairies that work so tirelessly behind

Re: How to implement "Export to CSV" link in cake-php

2008-01-25 Thread gerhardsletten
If you want to automaticly download the cvs file, you have to create the function in you controller that uses an own layout, where you set the php headers to download or something. Google "headers download php" and you should find! --~--~-~--~~~---~--~~ You receive

Re: Why appears this error (Undefined offset)?

2008-01-25 Thread grigri
In case you haven't seen it, I've replied to your post on cakephpforum.net: http://www.cakephpforum.net/index.php?showtopic=155&st=0&#entry953 Long story short: you can't have the same Alias (key) for 2 different associations. Change one or both keys. On Jan 25, 10:47 am, dandreta <[EMAIL PROTE

Re: Why appears this error (Undefined offset)?

2008-01-25 Thread dandreta
On 24 ene, 14:13, dandreta <[EMAIL PROTECTED]> wrote: > Hi! > I have been verifying it and I have a problem with the relations, > concretly with one: > 1 Project - N Persons > N Persons - N Projects > I have two different relations between the same models (Project and > Person). I explain it: >

Form field values after postback

2008-01-25 Thread Geo
Hi, I have an issue with my site. when i submit a form that fails validation and returns back to the form - only the 1 character of every field value is set for example: I have a page named "signup" with a form with an text input in. If i type in "hello" and submit the form to the acti

Re: Using CalendarHelper in Cakephp

2008-01-25 Thread Evert
Maybe this is usefull? http://www.flipflops.org/2007/09/21/a-simple-php-calendar-function/ On Jan 11, 6:17 am, goldenray <[EMAIL PROTECTED]> wrote: > Has anyone used CalendarHelper in your application? Do you have any > working examples for the same. --~--~-~--~~~-

Re: Model->Del() causes SQL Error

2008-01-25 Thread villas
This may be related to the thread I started 'Problem with Delete'. I decided that DELETE {Alias} FROM Table must be non-standard because you don't normally put {alias} in that position. I posted a bug report: #3984 (Delete {alias} from Table - non-standard SQL which stops Firebird working) See

enum

2008-01-25 Thread bob
Does Cake support enum types for tables? How would you get the enum values from the model or controller? Any examples? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group,

Re: fileinfo help needed

2008-01-25 Thread bob
No, its still not working I might just move to Ubuntu Linux to see if that solves the problem... On Jan 24, 2008 8:46 AM, b logica <[EMAIL PROTECTED]> wrote: > > On Jan 24, 2008 12:53 AM, bob <[EMAIL PROTECTED]> wrote: > > Just magic.mime > > > > Maybe it's a Windows thing. Try adding the fo

Re: How to implement "Export to CSV" link in cake-php

2008-01-25 Thread bhushan A
hi I got helper class.But i want to put "Export to CSV" link on view page(.thtml page). What changes do i need to do in controller, model and view page? Please explain., On Jan 9, 6:49 pm, nate <[EMAIL PROTECTED]> wrote: > On Jan 9, 1:32 am, bhushan A <[EMAIL PROTECTED]> wrote: > > > Hi all, > >

Re: Beginning CakePHP book with Apress

2008-01-25 Thread [EMAIL PROTECTED]
Congrats Dave! We need some good CakePHP literature. Dave wrote: > Hello all, > > Just wanted to share some great news... Apress has picked up my > manuscript for a CakePHP book which will come out in July. Things are > moving along nicely and I'm excited to contribute some documentation > to t

  1   2   >