Model input approach

2007-07-20 Thread Stuart
Hello, I'm stumbling through my first CakePHP project, and have hit a bit of a snag. The system that involves the following models: Product hasMany Revisions Revision hasMany Answers Each answers is of type Question Answers can have supporting documents I have a form that will input one new pr

Re: form helper dateTime (cake 1.2)

2007-07-20 Thread Phurter
http://www.nabble.com/form-helper-dateTime-(cake-1.2)-t4070834.html On Jul 12, 5:00 pm, pete <[EMAIL PROTECTED]> wrote: > hi, > is there a way to set the minYear, maxYear for dateTime? > > dateTime('dateTime','DMY',24,null,null); ?> > > i want to reduce the number of years within the form > > tha

Re: Objects and Arrays when fetching models

2007-07-20 Thread Grant Cox
In CakePHP the model class is used as an interface to the database - the actual data you get back is always associative arrays. If you have a fullname() function that perhaps concatenates your first and surnames, you could have class YourModel { function fullname( $id ){ // get the data

Re: Objects and Arrays when fetching models

2007-07-20 Thread Pablo Viojo
$name = $numberfour["MyModel"]["fullname"]; Try doing: print_r($numberfour) -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 7/20/07, youthoftoday <[EMAIL PROTECTED]> wrote: > > > I'm new to cakePHP, but experienced with Rails. I can't find the > answer to the following anywhere. > > Let

Re: Workflow engine for cake

2007-07-20 Thread francky06l
Hi Felix, It can be done for sure, but in there I was meaning something "built- in" where you could play/rules the different parts of the framework itself We all fail in the same trap in such "workflow" concept, that is "it has no end to what can be added" :-) On Jul 21, 2:14 am, Felix Geis

Re: Workflow engine for cake

2007-07-20 Thread Felix Geisendörfer
I'm developing such an engine right now. It allows the company to take the items from their orders through different steps from order processing, to production to shipment. All steps require different stuff to be done to the items, certificates to be printed out, etc.. So yes you can do this in

Re: Workflow engine for cake

2007-07-20 Thread francky06l
I am not good at example, but I'll try ...(In a business sector that I know a bit).. Let's say you are in a banking environnement, you have an application to capture loans and process them. In order to make decision, you would probably call external sources of data (risk estimation), some of the

Sortable.create

2007-07-20 Thread [EMAIL PROTECTED]
Has anyone successfully used Sortable.create with cake 1.2. I have prototype included but it does not recognized the object Sortable. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To pos

Re: Workflow engine for cake

2007-07-20 Thread Chris Hartjes
On 7/20/07, francky06l <[EMAIL PROTECTED]> wrote: > > I like the idea of workflow engine or "rules" engine. Actually, Cake > is a framework to design application, but having the user (or > parameters) designing is own "flow" once the application is done is a > step further. I still don't get it.

Re: My first experience using the new AuthComponent in cake1.2

2007-07-20 Thread francky06l
Well, maybe the $hashMethod will be included in Auth component later ... your solution is similar to mine, except to keep the possibility of another hashMethod On Jul 21, 12:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Here was my (not so pretty solution) > > In controllers/compon

Re: Only include js in certain views

2007-07-20 Thread francky06l
have a look to Nate's articles about this, especially the 3rd section : http://cake.insertdesignhere.com/posts/view/17 On Jul 20, 7:55 pm, Joshua Benner <[EMAIL PROTECTED]> wrote: > Put $javascript->link in the view instead of the [EMAIL PROTECTED]:Is there a > way to only include a javascript

Re: My first experience using the new AuthComponent in cake1.2

2007-07-20 Thread [EMAIL PROTECTED]
Here was my (not so pretty solution) In controllers/components/mycustomauthcomponent.php: The in the app_controller: var $components = array ('Acl', 'Mycustomauth'); $this->Mycustomauth->authorize = 'actions'; ...etc... It appears to work (not getting parentNode() to execute, but I think

Re: Changes to table not reflected in Model

2007-07-20 Thread francky06l
Delete all files in the tmp/cache/model directory. On Jul 21, 12:06 am, RTigger <[EMAIL PROTECTED]> wrote: > Sorry, I should've tested this sooner, it does work if I specify the > column in an array as an argument with the findAll($condition, > $fields) method. I'm assuming this does mean that

Re: Passing values to renderElement

2007-07-20 Thread francky06l
renderElement('representation_type_select', array('id' => $id)) On Jul 20, 8:26 pm, peterhf <[EMAIL PROTECTED]> wrote: > I have an, representation_type_select.thtml, which consists of a > selectTag. > > $html->selectTag( > $model_name . '/type_' . $id, >

Re: Workflow engine for cake

2007-07-20 Thread francky06l
I like the idea of workflow engine or "rules" engine. Actually, Cake is a framework to design application, but having the user (or parameters) designing is own "flow" once the application is done is a step further. The danger is to become very complex and degrading performances. In my mind, it wou

Re: My first experience using the new AuthComponent in cake1.2

2007-07-20 Thread francky06l
Well, I had a chat with Gwoo yesterday about this. Actually the security object accept 3 hash methods : sha1 (default), md5 and sha256.. The idea, with a derived Auth, to declare $var hashMethod = 'sha1'; Overwrite the hashPassword function with : function hashpassword($password) { Security::has

Re: Changes to table not reflected in Model

2007-07-20 Thread RTigger
Sorry, I should've tested this sooner, it does work if I specify the column in an array as an argument with the findAll($condition, $fields) method. I'm assuming this does mean that the fields for the model are cached somehow (which makes sense, instead of running a desc query every time), but ho

Changes to table not reflected in Model

2007-07-20 Thread RTigger
Hi All, N00b question I'm sure, as I'm just maintaining someone else's cakephp project, but I've run into a problem: I have a table that is tied to a model. I've added another column to the end of the table (IsFile tinyint(1)), but after running a model- >findAll($condition) in my controller it

Oracle Driver problem for delete

2007-07-20 Thread starkey
Hello! I am a developer at the University of Richmond; we are an Oracle shop. I am testing Cake for some projects we have planned and am using the Oracle driver (the version in 1.2alpha). To learn Cake's functionality I'm walking through the 15 minute Blog tutorial from the manual. I am having

Re: db table design

2007-07-20 Thread rtanz
i am using the previous version of cakephp, i dont understand why francky said for 1.2 only, any explanation for that, i would like to know since im using the previous version thanks On Jul 19, 11:07 pm, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > > @Felix, yes you right for cake 1.2, sorry >

Re: My first experience using the new AuthComponent in cake1.2

2007-07-20 Thread [EMAIL PROTECTED]
Can you provide more information on how you overwrote the hash method (Auth::password()) in AuthComponent *without* actually touching the cakephp core code? I've been tearing my hair out attempting to do this. I would think you could create a component (e.g., CustomAuth) and override the method,

Re: Workflow engine for cake

2007-07-20 Thread Chris Hartjes
On 7/20/07, Kunthar <[EMAIL PROTECTED]> wrote: > 2. If cake claims to be a real alternative MVC it has to own workflow > engine internal, What does having it's own internal workflow engine have to do with Cake's implementation of MVC? Chris Hartjes Senior Developer Cake Development Corporation

Workflow engine for cake

2007-07-20 Thread Kunthar
Hello all, I need to manage some conditional behaviour for my app. Samples; 1. customer adds new campaign to discount product x and also want to show banner in selected pages, 2. if basket.order.totals > 100 USD then do some favour to him, 3. check conditions and send email to some customers, etc

Re: i18n and sprintf

2007-07-20 Thread Fran Simó
Is there any tutorial about i18n on static templates for Cake 1.1? 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 unsubscri

ionCube's encoder and CakePHP

2007-07-20 Thread Christian \"Jippi\" Winther
Hello Does ionCube's encoder works okay with CakePHP ? /Regards Christian Winther Nb. This is ment as a phun ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group,

Passing values to renderElement

2007-07-20 Thread peterhf
I have an, representation_type_select.thtml, which consists of a selectTag. selectTag( $model_name . '/type_' . $id, array( 'option_1' => 'option_1', .

Re: Best Practices with: Model->beforeValidate()

2007-07-20 Thread [EMAIL PROTECTED]
According to cakephp's core library model_php[4|5].php beforeValidate() gets called on every save, regardless of whether its an update or new row. not sure about telling whether its new or an update -- the save() function seems to use $this->exists() On Jul 20, 8:20 am, phirschybar <[EMAIL PROTE

Re: Heavy loaded sites

2007-07-20 Thread Chris Hartjes
On 7/20/07, mutabor <[EMAIL PROTECTED]> wrote: > > Hi guys, > > I am wondering does anybody know a Cake based sites with a lot of > traffic? A kind of big sites. And how good and fast Cake behaves with > such conditions? > Mozilla's FireFox addons site uses it http://addons.mozilla.org I won't r

Re: Heavy loaded sites

2007-07-20 Thread Felix Geisendörfer
Maybe I should have phrased my last post differently: * *CakePHP is not an application*, it's a framework * You can build applications with CakePHP * How well those applications perform is largely the responsibility of the developer * Looking at other big cake site tells you

Re: generateList with multiple values

2007-07-20 Thread Tane Piper
Seems a rather long-winded way of doing it. Instead you can use cakephp's standard generateList(), and use afterFind to generate the arrays you want pass in. Paul Herron has a good article on this: http://www.paulherron.net/articles/view/cakephp_afterfind_psuedofields On 7/20/07, mithnik <[EM

Re: Heavy loaded sites

2007-07-20 Thread Felix Geisendörfer
> > I am wondering does anybody know a Cake based sites with a lot of > traffic? A kind of big sites. And how good and fast Cake behaves with > such conditions? No all traffic goes to: http://groups.google.com/groups/search?q=cakephp+high+traffic for some reason these days ... : / -- Felix -

Re: Only include js in certain views

2007-07-20 Thread Joshua Benner
Put $_javascript_->link in the view instead of the layout? [EMAIL PROTECTED] wrote: Is there a way to only include a _javascript_ file in certain selected views. I have it as being included in the default layout with link('tooltip')."\n"; ?> but I it's causing errors on views I don't

Only include js in certain views

2007-07-20 Thread [EMAIL PROTECTED]
Is there a way to only include a javascript file in certain selected views. I have it as being included in the default layout with link('tooltip')."\n"; ?> but I it's causing errors on views I don't need it on. I'm using cake 1.2.x if that makes a difference. Matt --~--~-~--~~

Re: Heavy loaded sites

2007-07-20 Thread pyrobot
http://snook.ca is built on cakephp and gets a good amount of traffic. For a list of other sites: http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild On Jul 20, 10:32 am, mutabor <[EMAIL PROTECTED]> wrote: > Hi guys, > > I am wondering does anybody know a Cake based sites

Heavy loaded sites

2007-07-20 Thread mutabor
Hi guys, I am wondering does anybody know a Cake based sites with a lot of traffic? A kind of big sites. And how good and fast Cake behaves with such conditions? Thanks, Kostya. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Objects and Arrays when fetching models

2007-07-20 Thread youthoftoday
I'm new to cakePHP, but experienced with Rails. I can't find the answer to the following anywhere. Let's say I have a model for which I've defined a custom function, for example one that joins concatenates two fields. I retrieve this object from the database and I want to call a method. For insta

Re: Software Design Dilemma -- getting data from Model to View

2007-07-20 Thread oleonav
Maybe a suggestion which does not infects performance; 1. Add a collumn to the photoset table containing the number of photos in the set. You can use this in your users/view action with no loss of performance 2. When adding or deleting photos to a set this collumn in the photoset model needs to b

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-20 Thread oleonav
Sorry, my post was not about labels or div's. The input tag transforms Model.Fieldname to a forminput named Model.Fieldname with the value of the fieldname applied to it, for example $Article['title'] $form->input('Article.title') will become http://bakery.cakephp.org/articles/view/multiple-rule

Best Practices with: Model->beforeValidate()

2007-07-20 Thread phirschybar
I want to use beforeValidate() to make some edits to data before it gets validated (combining 2 input fields, etc.). Does beforeValidate get called on EVERY save, including on UPDATE? Or just the initial save? What is the best practice here. If I want to just look for an initial SAVE, rather tha

How to cache views with no layout

2007-07-20 Thread Joel Stein
Does anyone know why views that have no layout ($this->layout = false) don't get cached? I'm caching many of my pages, but there's one which uses a special layout, so in order to make it cache, I have to create a layout just for this one view, and then it works. Any ideas? --~--~-~--~-

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-20 Thread zwobot
I have found a way here in the google group (don't memorize the exact source though): input('player.vorname', array('div' => false, 'label' => false));?> The options in the secon parameter prevent the input function to automatically wrap a div tag and the column name as label around the input ta

generateList with multiple values

2007-07-20 Thread mithnik
Hi all, I needed a function to return more than one value for a key so this is what I have done. I hope it will helps someone. /** * Generates an array with keys defined by $keyPath and concatenated values from $valuePath * * @param array $conditions limites the arra

[PATCH] Configurable aliases for nodes created by Acl Behaviour

2007-07-20 Thread Magnus Bergmark
I just submitted my first patch to CakePHP. I was thinking some of you might like it. https://trac.cakephp.org/ticket/2942 Look in the comments as it's not my ticket. So what does it do? Well, it makes the default aliases for ACL nodes configurable - and yes, they are dynamic. It's very useful if

Re: Accessing username with only id from foreign model

2007-07-20 Thread Magnus Bergmark
If you have User associated, you might already have the info in $this- >data. Here's an example: class Message extends AppModel { var $name = 'Message'; var $belongsTo = array('User'); } class MessagesController extends Appcontroller { function view($id) { $result = $this-

Re: $this->cakeError refuses to load a custom layout.

2007-07-20 Thread Ski
Hi, I managed to override the default layout and individual templates locally but cannot get it working live: I did this by setting the layout at the top of my custom template files... I have overridden my error handler to mail some messages before calling parent methods, but I guess I am

Re: $this->cakeError refuses to load a custom layout.

2007-07-20 Thread Ski
Hi, I managed to override the default layout locally but cannot get it working live: I did this by setting the layout at the top of my custom template files... Seems a bit bollox to have to override a whole error handler just to use custom layouts and templates, maybe this will get fixed

Re: Date format with $form->input

2007-07-20 Thread Braindead
> There is already a Enhancement ticket in the trac for this > athttps://trac.cakephp.org/ticket/2405(along with a few other dateTime > enhancements). > > If you want it now you can apply the patch in the ticket. Thanks for the link. The first attachment already includes a patch for my problem.

Re: $this->cakeError refuses to load a custom layout.

2007-07-20 Thread Ski
Hi, On Jul 19, 10:16 pm, francky06l <[EMAIL PROTECTED]> wrote: > Sorry guys did not know "errors always use the default layouts". > > On Jul 18, 12:00 am, phpjoy <[EMAIL PROTECTED]> wrote: > > > that's great to know, "errors always use the default layouts". :) > > didn't see it in the manual..

Re: Software Design Dilemma -- getting data from Model to View

2007-07-20 Thread tawm
Hey Geoff, Thanks for your reply. I guess your approach is the best possible one. I do not like it tremendously though. Thanks to CakePHP's associations all photosets are automatically part of a user data-array. So we already have them, and therefore would rather not findAll them again. Also, sin

Re: Best way to make controllers

2007-07-20 Thread Geoff Ford
If you are asking about access control - which user role can perform what action - have a look on the Frequent Discussions page for ACL and Auth. http://groups.google.com/group/cake-php/web/frequent-discussions Geoff -- http://lemoncake.wordpress.com On Jul 20, 1:52 am, Cacho <[EMAIL PROTECTED]

Re: Software Design Dilemma -- getting data from Model to View

2007-07-20 Thread Geoff Ford
Option 3. From the model via the controller e.g. Users controller. $this->set('photosets', $this->User->PhotoSet- >findWithCount($conditions)); PhotSet Model function findWithCount($conditions){ $this->recursive = -1; //stops all associations $photosets = $this->findAll($conditions); // if

Re: Date format with $form->input

2007-07-20 Thread Geoff Ford
Looks like you are right, I read the source a little closer. I saw that input was just using dateTime() and assume you could pass along a the format option, but when you get to the switch statement MDY is hardcoded. There is already a Enhancement ticket in the trac for this at https://trac.cakep

Re: AuthComponent Tutorial

2007-07-20 Thread Geoff Ford
Hey cakeFreak, I have a slightly different approach for development bypassing. I have a condition like if (Config::read()) { $this->Auth->allow(); } This checks if CAKE_DEBUG is greater than 0 and bypass authentication and authorization. Personally I think it is safer than the extra propert

Software Design Dilemma -- getting data from Model to View

2007-07-20 Thread tawm
Hello, I'm dealing with the following dilemma, simply cannot decide what's the best approach. Your $0.02 is highly appreciated! Consider the following structure: User hasMany Photoset, which in turn hasMany Photo. The UserController has a view (/users/view/{id}) action, which shows the user's d

Re: i18n translation in db tables - how to do this like Symfony?

2007-07-20 Thread oleonav
If we could use something like $form->input('TransTitle.fra.content') that would be nice. Using this produces a form input but the value is lost. We can write some logic (like I have shown in my recent posts about this topic) to loop through the TransTitle & TransContent array, but this seems not

Accessing username with only id from foreign model

2007-07-20 Thread CakeSpork
Hi, I have a pretty basic question that I've still not gotten through to after these past weeks of plunging into Cake and I thought I might find some help here. How do you guys mostly go around to finding the associated User to a user_id? I seem to do this so often that at the very least uses('Use

Re: Date format with $form->input

2007-07-20 Thread Braindead
On Jul 20, 1:02 am, Geoff Ford <[EMAIL PROTECTED]> wrote: > It is possible, you misread what speccy was saying. Use what you have > and add a dateFormat key in the options array I tried to add the dateFormat key yesterday before posting my question and I tried it 2 minutes ago. Both times the se

Re: View this page "Create an interactive production wiki using PHP: IBM D

2007-07-20 Thread Mike Green
Very interested in reading this! thankyou to those involved. MIke On 18/07/07, margin <[EMAIL PROTECTED]> wrote: > > Update: I downloaded the source code and uploaded a complete zip: > > http://download.yousendit.com/BE0382DB2EB95D0F > > > > > -- Mike Gr

Re: AuthComponent Tutorial

2007-07-20 Thread cakeFreak
Hey Geoff Ford, cheers for the tutorial! Great! I just modified a bit you beforeFilter function in the AppController to basically allow access to all controllers during development with ease! --

Re: Paginating the results after creating a dummy model to filter HABTM results?

2007-07-20 Thread cakeFreak
I have a similar problem: I have a Tag model that has a HABM association with Post and Photos. I wanna to retrieve 2 separate pagination results for the records for a given Tag, iin order to display the reults with 2 pagination blocks via Ajax on the same page. I'm trying to call 2 separate fun

Re: Intermittently no-response to ajax request

2007-07-20 Thread francky06l
Can you spot an action where this problem happen ? I mean does that happen randomly on different action ? Did you also check the Apache log ? On Jul 20, 5:47 am, cdomigan <[EMAIL PROTECTED]> wrote: > Greetings! > > I'm having an intermittent problem (ie very difficult to debug :-) > with CakePHP