Re: Why some classes starts with Cake, others not?

2011-02-02 Thread red
ng with other frameworks like "Zend_xyz" or whatever > > well, just my 5 cents tonight > > On 1 Feb., 22:05, Tilen Majerle wrote: > > > > > > > > > probably because of copyrights toowho knows... > > > -- > > Lep pozdrav, Tilen Maj

Why some classes starts with Cake, others not?

2011-02-01 Thread red
Hello, question of curiosity - why some class names in CakePHP starts with Cake* prefix, but majority not? Is the only reason the collision of names with generally used classes in PHP (eg. Session => CakeSession or Log => CakeLog)? If yes, why there is more like CakeRoute or now in developed CakeP

Re: Override or not

2010-12-03 Thread red
What exactly do you need to add to this form inputs? Built-in Form(Html)Helper allows to define many parameters to inputs and all other form/html elements, so maybe there is no need to write own helpers. Anyway regardless of this things 'hacking' core of Cake is unacceptable and the key is inherit

Re: query conditions problem - OR is always replaced by AND

2010-09-01 Thread red
The part with or should be: 'OR' => array( 'AlbumsUser2.user_id' => null, 'AlbumsUser2.user_id' => 1 ) On 1 Wrz, 11:36, "Mariano C." wrote: > I have to write a simple query something like: > > SELECT ... FROM ... > LEFT JOIN ... > ON (`AlbumsUser`.`album_id` = 'AlbumsUser2.album_id' AND

Re: How could controller inform about layout or view existing?

2010-07-22 Thread red
According to the documentation: http://book.cakephp.org/view/1093/Themes "If a view file can't be found in the theme, CakePHP will try to locate the view file in the /app/views/ folder. This way, you can create master view files and simply override them on a case-by-case basis within your theme fo

Re: read REST API

2010-07-12 Thread red
HttpSocket will be very helpful for making requests: http://book.cakephp.org/view/1517/HttpSocket On 11 Lip, 23:04, Davor Ilic wrote: > Hi, > > how i can read like youtubes api xml or json with cake is there a method > which i can use or i have to write it by my self. Check out the new CakePHP

Re: Auth component not showing login errors

2010-07-10 Thread red
sion->flash('auth') too instead > $session->flash('auth') right? > > 2010/7/10 red > > > > > flash(); ?> > > And > > Session->flash(); ?> > > > Are exactly the same - from 1.3 you should use second notation. > > >

Re: Wrapping form elements inside ?

2010-07-10 Thread red
Form->input('field', array('div' => false)); ?> or: Form->input('field', array('div' => false, 'before' => '', 'after' => '')); ?> On 10 Lip, 08:48, "matzeh...@googlemail.com" wrote: > Hi, > > with the option 'div'=>false you can disable the surrounding div > Container. > But adding a p with

Re: Auth component not showing login errors

2010-07-10 Thread red
flash(); ?> And Session->flash(); ?> Are exactly the same - from 1.3 you should use second notation. flash('auth'); ?> This display flash message with key 'auth'. On 10 Lip, 17:40, Hugo M wrote: > What's the difference between: > >  flash(); ?> > flash('auth'); ?> > > and > > Session->flash

Re: REST and SecurityComponent - how to properly secure appilaction?

2010-07-09 Thread red
uting prefix in config for REST API? It'll be easier to dermine API request. On 9 Lip, 12:15, red wrote: > Hi, > I wan't to secure my REST API with basic access authentication. My app > also contains normal open-public views and admin panel (also secured > with

REST and SecurityComponent - how to properly secure appilaction?

2010-07-09 Thread red
Hi, I wan't to secure my REST API with basic access authentication. My app also contains normal open-public views and admin panel (also secured with SecurityComponent and basic authentication). I've put this peace of code to the controller: public function beforeFilter() { parent::beforeFilter

Re: Best way to implement a filter?

2010-07-03 Thread red
Check this filter plugin: http://github.com/josegonzalez/cakephp-filter-plugin On 2 Lip, 23:40, Aircule wrote: > Hi, > > I have a model with many fields and many records in the database. To > avoid clutter, I want users to be able to apply some filters when > viewing all records (ie: model->ind

Re: How to build 3 column page?

2010-07-03 Thread red
You don't need another controller or action if all of this elements applies to posts. First prepare 3 column layout: http://book.cakephp.org/view/1080/Layouts And then use view elements: http://book.cakephp.org/view/1081/Elements One element for latest 20 posts, one for top viewed and one for to

Re: Upgrading from 1.3.0.0.(alpha) to current stable version 1.3.2

2010-07-03 Thread red
Migrating from 1.3 alpha to 1.3.2 should be similiar as 1.2 to 1.3 (probably even easier). Just follow the migration guide: http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3 On 3 Lip, 15:31, Warren wrote: > Hey guys, I've got a bit of a noob request.  What's the easiest way t

Re: MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread red
You're welcome. And also thanks :) On 2 Lip, 21:25, Miles J wrote: > Thanks, I will patch this :] > > On Jul 2, 7:09 am, red wrote: > > > > > Ok, I've figured it out - Uploader won't work if there is multiple > > models in form (SecurityComponent ad

Re: MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread red
$fileToUpload = $file; } else { $fileToUpload = $Model->alias.'.'.$file; } // Upload file and attache to model data if ($data = $this->Uploader->upload($fileToUpload, $options)) { [...] On 2 Lip, 14:53, red wrote: > Hi, > I'm using MilesJ's Uploader pl

MilesJ's Uploader plugin doesn't work with SecurityComponent

2010-07-02 Thread red
Hi, I'm using MilesJ's Uploader plugin [1][2] and it works very well. I'm using it as the behavior for model. Now I need to enable SecurityComponent, but uploading doesn't work any more. I'm getting error from Upload Behavior: "There was an error attaching this file!". I've also set Security->vali

Re: CakePHP 1.3-beta has landed

2010-01-17 Thread red
As always, thank you and keep up good work! On 17 Sty, 05:25, mark_story wrote: > The CakePHP development team is happy to announce the release the > CakePHP 1.3-beta. We've been hard at work implementing new features > and fixing issues in existing features in the 1.3 branch.  Since 1.3- > alp

Re: how i can download cakebook source from the chaw?!!

2009-12-24 Thread red
Here are some guides how to generate public ssh keys: http://thechaw.com/wiki/guides/setup http://help.github.com/key-setup-redirect On 24 Gru, 09:53, cherif_Gsoul wrote: > hi, i have an acount on the chaw and i want to download cakebook > source, wheni use to download it with git bash i use th

Re: How to validate HABTM model with extra fields?

2009-12-10 Thread red
, euromark wrote: > actually its usually the other way around > it may validate more fields, but can save only the foreign keys > (not even created/modified automagic timestamps!) > > On 9 Dez., 15:08, red wrote: > > > > > Yes, probably I'll do as you

Re: How to validate HABTM model with extra fields?

2009-12-09 Thread red
sually always use those split tables as they are way more powerful! > > On 9 Dez., 14:28, red wrote: > > > > > Hello, I've already asked on cakeqs.org but I'll try also here. > > > My case is: Order HABTM Product. In joining table orders_products I've >

How to validate HABTM model with extra fields?

2009-12-09 Thread red
Hello, I've already asked on cakeqs.org but I'll try also here. My case is: Order HABTM Product. In joining table orders_products I've extra field - quantity. Now, when editing Order I can add Products and enter quantitiy. Here is what I've done already: In model Order: public $hasAndBelongsToMan

Saving extra fields in the join table in CakePHP 1.3

2009-11-18 Thread red
Here is the magic trick, how to save some extra data in joining table: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/ Is this magic still working in 1.3? Or something has changed in saving behavior for HABTM? I'm asking, because when I do: Product H

Re: Hot out of the oven CakePHP 1.3 alpha

2009-11-04 Thread red
Good work, I really appreciate! On 4 Lis, 06:28, mark_story wrote: > The CakePHP development team is happy to release the alpha build of > CakePHP 1.3.  We've been hard at work improving upon the already great > 1.2 and implementing new features to ease development and increase the > flexibility

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-03 Thread red
way must be used for actual save before > beforeSave is called. So saveAll thinks that it should save one record > of one structure, but then you change it to many records of other > structure. So save fails. Make your own mySave method, convert array > there and then call saveAll.

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread red
saveAll() will try to create the > entries which could be why it fails. Try copying the generated queries > from the SQL log and running them from phpMyAdmin for more detailed > error messages. > > On Nov 2, 6:16 pm, red wrote: > > > > > Oh, the table structure i

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread red
Oh, the table structure is: settings(id, key, value, created, modified) key & value are of course VARCHARS. On 2 Lis, 11:04, red wrote: > Hi, > I've pasted code here:http://bin.cakephp.org/saved/52122 > > The problem is that the saveAll() doesn't work at all. Ok

Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread red
Hi, I've pasted code here: http://bin.cakephp.org/saved/52122 The problem is that the saveAll() doesn't work at all. Ok, it's invoked and $this->data is modified, but saveAll() does not save any records and debug($this->data) after success of saveAll() shows the old structure of $this->data. What

Fat models - design question, where to put logic?

2009-10-26 Thread red
Hi, I've design question, where to put the code for situations like this: 1. Shop -> hasMany -> Categories 2. Categories are TreeBehavior 3. For every Shop I put new root Category, so it look like: - Root Category for Shop #1 --- Category 1 --- Category 2 - Root Category for Shop #2 --- Category

Re: What to use? Elements? Behaviors? Helpers?

2009-10-14 Thread red
As I understand, you try to build some kind of dashboard. Check this tutorial, maybe this works for you: http://teknoid.wordpress.com/2008/12/16/how-to-build-a-dashboard-for-your-application-in-cakephp/ On Oct 14, 5:54 pm, "gimperdan...@gmail.com" wrote: > I kinda understand what you're saying,

Re: Save translated content in model

2009-10-06 Thread red
I've figure out the problem It won't work with validation disabled: return $this->save($data, false); If the validation is turned on it works: return $this->save($data); You think it's a bug? Should I submit a ticket? On Oct 6, 5:16 pm, red wrote: > Hello, > I&

Save translated content in model

2009-10-06 Thread red
Hello, I'm trying to save translated content in model: class Page extends AppModel { public $actsAs = array( 'Translate' => array( 'name' => 'nameTranslation' ), ); public function createRoot($shop_id) {

Re: Translate Behavior and not obligatory fields

2009-08-25 Thread red
n Aug 25, 12:39 pm, red wrote: > Hi all, > I've following problem - simple model: Shop (id, url, title) and title > field can be translated and is not obligatory, so can be NULL. > > I've defined TranslateBehavior in Shop model like that: >         public $actsAs = ar

Translate Behavior and not obligatory fields

2009-08-25 Thread red
Hi all, I've following problem - simple model: Shop (id, url, title) and title field can be translated and is not obligatory, so can be NULL. I've defined TranslateBehavior in Shop model like that: public $actsAs = array( 'Translate' => array( 'titl

Re: Show Multiple Controllers in one View

2009-07-02 Thread red
Check $uses attribute of Controller: http://book.cakephp.org/view/51/Controller-Attributes#components-helpers-and-uses-53 var $uses = array('Portfolio', 'Section'); and later for example in view action in Portfolio controller simply: $this->Section->find('all'); On Jul 2, 4:07 am, Deuce wrot

Re: Help with CSS Rollover Links

2009-06-15 Thread red mcgee
Re: Andreas: that's a foul way to respond to someone. please don't browse the forums looking for others to belittle. the users here are merely looking for support - not criticism. how ugly of you... On Jun 12, 12:21 pm, Andreas wrote: > Hi, > well i think you first need to learn the basics. e.

Re: Validate HABTM

2009-05-01 Thread red
Here you'll find the solution: http://teknoid.wordpress.com/2008/10/16/how-to-validate-habtm-data/ On 1 Maj, 00:00, "Dave Maharaj :: WidePixels.com" wrote: > I have tried figuring this out on my own to no avail. > > Where do I validate data being saved into a HABTM table? I have > USERS: > id

Re: Undefined index when saving HABTM with extra fields

2008-10-09 Thread red
quot; But when I look into database of course is not updated. Weird... On 9 Paź, 19:30, red <[EMAIL PROTECTED]> wrote: > Hello all, > I'm getting something strange with HABTM relations. I follow > instruction from > here:http://teknoid.wordpress.com/2008/09/24/saving-ex

Undefined index when saving HABTM with extra fields

2008-10-09 Thread red
Hello all, I'm getting something strange with HABTM relations. I follow instruction from here: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/ Now, two examples: When I'm creating new Product this works perfect: $this->Product->bindModel(array('ha

Re: How do i remove the query results

2008-09-04 Thread red
Perfect solution with beforeRender (beforeFilter), thanks guys! On 4 Wrz, 03:18, Jaime <[EMAIL PROTECTED]> wrote: > class AppController extends Controller { > >   var $components = array(..., 'RequestHandler'); > >   function beforeRender() { >     if ($this->params['isAjax']) >       Configure

Re: How do i remove the query results

2008-09-03 Thread red
Extra question - is there any way to hide debug output on div's, that are returned from Ajax request (without turning on production mode)? I update one cell in table and this debug output blows my table up. On 3 Wrz, 17:50, phanorcoll <[EMAIL PROTECTED]> wrote: > thanks.. > > On Sep 3, 11:34 am,

Re: Ruby on Rails 2.0 Removed Scaffold Generation?

2008-02-23 Thread red
Just about scaffolding - they did not removed the generator. Check this: http://wiki.rubyonrails.org/rails/pages/Scaffold Anyway changes in RoR 2.0 are big, but look at Cake 1.2 - some tutorials from 1.1 also won't work. Every software sometimes get 'big changes'. On 23 Lut, 12:43, Baz <[EMAIL

Re: Simple 1.2 Beta Form Example?

2008-01-29 Thread red
Why just don't bake this simple example? On 29 Sty, 22:33, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Can someone post a simple 1.2 beta example of a form w/ validation? I > have tried all kinds of examples on various sites, but none work. I'd > like to see the view for a simple form, an

Re: Price with commas

2008-01-29 Thread red
Storing and calculating prices with float type isn't perfect, particularly dividing prices or just making many math operations on them. Make all operations for example in cents for USD or EUR and if you want display then divide it by 100. On 29 Sty, 13:18, lgarcia <[EMAIL PROTECTED]> wrote: > Wh

How to prepare table for HABTM and an extra field?

2008-01-28 Thread red
Hi, I have two models: Cart and Product, the HABTM relation and carts_products table. Now I have action connecting carts and products (without form): blabla/carts/add/16/product_id:2 So I build data like this and save: array(2) { ["Cart"]=> array(1) { ["id"]=> string(2) "16" } ["

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?

Re: Problem with AuthComponent - not completly working?

2008-01-25 Thread red
t; array(6) { ["id"]=> string(1) "1" ["login"]=> string(6) "root" ["group_id"]=> string(1) "1" ["active"]=> string(1) "1" ["created"]=> NULL ["modified

Re: Problem with AuthComponent - not completly working?

2008-01-25 Thread red
alse; I can see this debug with affected rows = 1 5. But when I try to get any actions it still redirect's me to the login page... Damn. On 25 Sty, 17:05, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Jan 25, 2008 10:57 AM, red <[EMAIL PROTECTED]> wrote: > >

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? --~--~-~--~~~-

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: 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: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread red
#x27;Friend'] = $friends; $this->data['Admirer']['Admirer'] = $admirers; if ($this->User->save($this->data)) { $this->Session->setFlash('Added to Friends.'); } } U

Re: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread red
On 29 Wrz, 12:23, AD7six <[EMAIL PROTECTED]> wrote: > ... which is by design, otherwise how could you (easily) delete an > association. There are a few posts/threads/bakery articles/etc. around > with "working with habtm" in the title, after a quick google I am sure > you will find the info you

Re: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread red
iend_id) VALUES (5,14) And of course the DELETE command removes my earlier connections of id 5... On 29 Wrz, 08:23, AD7six <[EMAIL PROTECTED]> wrote: > On Sep 28, 11:36 pm, red <[EMAIL PROTECTED]> wrote: > > > > > Hello everybody! > > I want to make

Another HABTM self referencing question - cannot save data?

2007-09-28 Thread red
Hello everybody! I want to make something similliar to friend list, so I used self referencing HABTM - users_users. The tables are: users (id, friend_id, bla bla bla) - pk (id, friend_id) // and id of course == friend_id users_users (user_id, friend_id)- pk (user_id, friend_i

The best way to back to the previous place?

2007-09-13 Thread red
Some parts of my app need user to be logged in. So in this places I've put links to 'log in' page. But after user log correctly, the app always back to the main page (as I set it up). I want to back to place, where the user was before login action. I can of course add optional param to the /users/

Re: Column names not showing in bake.php

2007-09-06 Thread red
Yes, I have the same problem. Use previous stable release 1.1.16.5421. I don't know why this bug wasn't fixed yet :( On 6 Wrz, 18:27, jm <[EMAIL PROTECTED]> wrote: > When I use the bake.php script from the command line and try to bake a > model and select to supply validation criteria for the fid

Re: Fatal errors using bake

2007-09-03 Thread red
In the first attempt probably you haven't baked the Model first. If you wan't to live 'stressless' use Vertrigo (http:// vertrigo.sourceforge.net/?lang=eng) instead of XAMPP. Small, fresh and everything works perfect. On 3 Wrz, 16:37, mejpark <[EMAIL PROTECTED]> wrote: > I am developing my appli

Re: Cake Bake and Validation Problem

2007-09-03 Thread red
I have the same problem (look at "Release: 1.1.17.5612" thread). It looks that is problem of this build, the previous one was good. On 3 Wrz, 08:50, "Gould, Adrian" <[EMAIL PROTECTED]> wrote: > Anyone seen this problem before... > > When using bake.php from the last build of CakePHP [Stable: 1.1.

Re: Release: 1.1.17.5612

2007-09-02 Thread red
Is everything ok with a the bake script in this release? I can't bake anything, because the script seems to not recognize field names from table when I wan't to add some validation rules to the model. The types of fields are ok... strange :/ On 30 Sie, 06:06, "Larry E. Masters aka PhpNut" <[EMA

Re: can't use xampp on win XP SP2 ????????

2007-08-24 Thread red
Use Vertrigo (http://vertrigo.sourceforge.net/?lang=eng) and forget about problems. It works on XP SP2, and CakePHP runs on it perfectly. On 24 Sie, 06:37, "sixs" <[EMAIL PROTECTED]> wrote: > Hi, > I am still trying to use cakephp and I removed wamp and cakephp and installed > xampp. I see that

Digg (Pligg) CakePHP clone?

2007-07-08 Thread red
Hi everyone! Does anybody know some simple Digg/Pligg CMS clone written in CakePHP? I need to make something simmilard, but maybe somebody knows a good base for project like this? Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are