Re: Join returns 2 arrays - how can I change that?

2010-09-27 Thread Zaky Katalan-Ezra
Seeing the query and the result array could be very helpful. If the fetched data is read only you can use a database view. 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

Re: model->delete error

2010-09-27 Thread Frobozz
We have exactly the same problem on production server now with CakePHP 1.3.x applications. Did you succeed in solving this issue? On 27 авг, 03:20, lloydhome wrote: > Hi, > > I have v1.3.2 running on a production site that has in a controller: > (effectively, some non-related code removed) > > $r

how stand up bake on Denwer?

2010-09-27 Thread Коля
C:\Users\1>cake PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/ php5/ext\p hp_gd2.dll' - =х эрщфхэ єърчрээvщ ьюфєы№. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/ php5/ext\p hp_mbstring.dll' - =х эрщфхэ єърчрээvщ ьюфєы№. in Unk

Join returns 2 arrays - how can I change that?

2010-09-27 Thread quas
Hi there, I have a problem with the returning data of my database when I use cakephp. when I make a join with 2 tables I get as returnvalue 2 arrays. One for each table... for example join: user & usergroup results in array[user] and array[usergroup] I am not sure if this is the normal cakeph

htaccess and domain

2010-09-27 Thread leafchild
I set webroot to app/webroot Also I edited .htaccess file to redirect user to domain without www url, if a user access the site with www.mydomain, user is redirected to mydomain.com. Not sure which .htaccess file I edited but before I set webroot to app/ webroot, redirecting www.mydomain to mydom

Fixture file is not being loaded during tests.

2010-09-27 Thread Zé Ricardo
Hi guys, I'm trying to test a model. The first problem I faced was having to load all fixtures from all the related models. The issue is well known and, just to get up and running fast, I loaded all fixtures in my startTest function, as I show bellow: function startTest() { $fixturesPath = APP

Re: How can I populate data belonging to TWO NON-RELATED TABLES in ONE Controller

2010-09-27 Thread Ancy DSouza
thank you guys Ancy On Sun, Sep 26, 2010 at 7:42 PM, emmexx wrote: > > > On 26 Set, 15:22, Divya Banik wrote: >> Or you can use ClassRegistry::init('ServerInfo')->find('all'); > > For the record the manual lists the cake way to load a model: > > http://book.cakephp.org/view/67/Understanding-Mode

Re: id field as char(40) and id number is automatically created

2010-09-27 Thread euromark
i guess mariano probably ment char(36) - which are cake UUIDs and just messed it up. well... On 27 Sep., 19:55, Jeremy Burns | Class Outfit wrote: > And char(40) isn't *the Cake way*. It's an alternative that can be attractive > in some cases. For instance, if you have a table of orders, the pe

Re: acl and admin routing?

2010-09-27 Thread BrendonKoz
Sorry, I did misunderstand. By default CakePHP automatically has an admin route. The prefix can be changed in the core.php file. You'd also want to uncomment it if you haven't yet. What this does is that you can add to your Users controller a "prefix"_login() method to correspond to an admin login.

Re: shared controller functions

2010-09-27 Thread Jeremy Burns | Class Outfit
Use components - that's what they were born for. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 27 Sep 2010, at 21:05, Michael Gaiser wrote: > So I want to use some of the functions from my locations controller in my > domains controller. I know how to load

shared controller functions

2010-09-27 Thread Michael Gaiser
So I want to use some of the functions from my locations controller in my domains controller. I know how to load a model, which is working, but when I tried to load a controller, it didnt seem to work is there some special syntax for this? ~Michael Check out the new CakePHP Questions site http://

Re: JS helper

2010-09-27 Thread cricket
On Mon, Sep 27, 2010 at 4:56 AM, l...@poczta.fm wrote: > Hi, > > I needed a simple Ajax feature to load box with additional info and > close it after reading. I am new to Ajax and seldom used JS scripts > till now. I need your opinion/help on optimizing following piece of > code. The JS helper doc

Re: habtm saving: is my really simple solution fragile? using a model for habtm-table

2010-09-27 Thread Tomfox Wiranata
hey sam, now when u mention it, i think i heard about this and 1.2 tooand i have a primary key field "id"...i can sleep in peace now... thank you. i appreciate your help. :) On 27 Sep., 15:18, Sam wrote: > AFAIK, that's actually fine- any time I've used a join table to store > meta/more than

Re: "Pages" database table

2010-09-27 Thread lado77
Hi LipeDjow, thanks for your advice and example, that sounds like most suitable solution (also suggestion of j.blotus) in such situations. Ladislav On Sep 25, 9:33 pm, Felipe Tadeu wrote: > Hi Ladislav, > > I had a similar problem, but in my case the table was called 'files'. > My simple soluti

Re: updating a value when user clicks a link

2010-09-27 Thread cricket
On Mon, Sep 27, 2010 at 10:24 AM, james livsey wrote: > Thanks Cricket, > > I added that code as you suggested. While it doesnt cause any errors it > doesnt seem to modify the field data either. > > what I have is: > >    function add($appointment_id = null){ >    //existing code >    $thi

Re: editing rows from index.cttp

2010-09-27 Thread cricket
You should add the action to the create() line. And that should come before your foreach() loop. Also, include a hidden element for the record's id at each iteration (where you echo 'ad_size') or the form will have nothing to submit. But saving multiple records with Cake has always been a bit conf

Re: id field as char(40) and id number is automatically created

2010-09-27 Thread Jeremy Burns | Class Outfit
And char(40) isn't *the Cake way*. It's an alternative that can be attractive in some cases. For instance, if you have a table of orders, the perception of being order no. 5 might not be that great, and this can be somewhat masked by the 40 char string - although I do think they are severely ugl

Re: JS helper

2010-09-27 Thread Jeremy Burns | Class Outfit
I concur with your feelings about the guide with respect to the JS helper - but did you know that you can create yourself an account and add to the guide? It would be a good community spirited thing to pass on some of your knowledge. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://

Re: setFlash

2010-09-27 Thread Taffarel de Lima
você tem que setar o Helper Session no seu controller para que funcione o metodo setFlash() var $helpers = array('Session'); 2010/9/26 Gilvan Jr. > Olá pessoal, aguem saberia me dizer o motivo: > > Notice (8): Undefined property: UsersController::$Session [APP > \controllers\users_controller.ph

Re: id field as char(40) and id number is automatically created

2010-09-27 Thread euromark
you can always set up a local environment to test! WAMP, XAMPP there you got everything you need to develop On 27 Sep., 19:09, "Mariano C." wrote: > I'm waiting for a serious host, in the mainwhile i'm testing source on > a freehost, I suppose they have suppressed char for varchar, avoiding > sp

Re: Big problems trying to use "medium" as a model name

2010-09-27 Thread cricket
On Mon, Sep 27, 2010 at 3:16 AM, Joshua Muheim wrote: > I didn't change anything in the source, and it worked under v1.2.0.x, > and now it doesn't anymore. So I presume it's because of the upgrade > to v1.3.4, and I also found this: > > "Adding media as an uninflected word" on > https://trac.cake

Re: id field as char(40) and id number is automatically created

2010-09-27 Thread Mariano C.
I'm waiting for a serious host, in the mainwhile i'm testing source on a freehost, I suppose they have suppressed char for varchar, avoiding space with newbie issue. Sure, I can use int! Matter of fact i'm using int right now, but looking to the future (when DB will grow up) cake approch will be be

setFlash

2010-09-27 Thread Gilvan Jr.
Olá pessoal, aguem saberia me dizer o motivo: Notice (8): Undefined property: UsersController::$Session [APP \controllers\users_controller.php, line 50] Code | Context UsersController::edit() - APP\controllers\users_controller.php, line 50 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204

Re: "Pages" database table

2010-09-27 Thread Felipe Tadeu
Hi Ladislav, I had a similar problem, but in my case the table was called 'files'. My simple solution was to keep the table name, and change the name at application. i.e: table name as 'pages' and controller/model names as BookPagesController/BookPage (following the suggestion of j.blotus). At th

JS helper

2010-09-27 Thread l...@poczta.fm
Hi, I needed a simple Ajax feature to load box with additional info and close it after reading. I am new to Ajax and seldom used JS scripts till now. I need your opinion/help on optimizing following piece of code. The JS helper documentation is terrible - I'll share my experience on this at the en

MeioUpload + hasMany + JavaScript-Generated Fields

2010-09-27 Thread LarryTX
I'm using CakePHP 1.3.3/MeioUpload 2.1.1/PHP 5.3.1. I've got a very standard hasMany/belongsTo set of models. On the many side is a simple table with id, filename, mimetype, and dir using actsAs MeioUpload. I know that I will always have at least one file on the many side so, in my add.ctp for the

Re: id field as char(40) and id number is automatically created

2010-09-27 Thread Jeremy Burns | Class Outfit
varchar? Is it a MySQL database? If so, what's the restriction for? If you really really can't (and I'd be surprised) then can you work with an int instead? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 27 Sep 2010, at 17:48, Mariano C. wrote: > I've a pr

id field as char(40) and id number is automatically created

2010-09-27 Thread Mariano C.
I've a problem with my free host, I cant' create char! Can I specify another field type for magic id creation. And if I can, where I have to explain that? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message be

Re: config.php debug =2 But no debug data

2010-09-27 Thread hvannia
I placed the line on my default.ctp file THANK YOU On Sep 5, 1:26 am, Jeremy Burns | Class Outfit wrote: > Have you moved from 1.2 to 1.3? If so, you no longer get the SQL dump by > default. See > here:http://book.cakephp.org/view/1567/Model-Databases-and-Datasources. You > need to add elemen

Trouble making javascript->link() work

2010-09-27 Thread McScreech
Hi, I can't seem to find what I am doing wrong here after scouring the web for hints. The relevant (I hope) code bits are included below. I am using cakePHP 1.2.6 and jquery 1.4.2. In my default.ctp, the 'javascript->link' form does NOT include the .js files but the direct '' tags form DOES. Any

Re: conditions

2010-09-27 Thread Tilen Majerle
if relationship is belongsTo or HasMany (i don't know for HasOne, but probably too), then u can use it...something like thatif User hasMany Post and Post belongsTo Userbecause LEFT JOINs are generate automatically $conditions = array( "Post.enabled" => 1, //only enabled posts "User

conditions

2010-09-27 Thread james
Is it possible to use conditions from other models' fields? For example if model Advert belongs to model Media and Media has a field called active, is there anyway to use the active field as a condition in the Advert controller? for example $conditions = array('Advert->Media.active'=>'Active');

Re: Admin interface templates / themes for CakePHP

2010-09-27 Thread Alex Bovey
On Thu, Sep 23, 2010 at 12:49 PM, Mike Karthauser wrote: > > I tend to build admin styles off the back of cake.generic.css which has > improved no end on the recent versions of cake 1.3.* > > i'm also using jquery ui themeroller styles for the rest of it as they are > pretty easy to integrate and

Re: updating a value when user clicks a link

2010-09-27 Thread james livsey
Thanks Cricket, I added that code as you suggested. While it doesnt cause any errors it doesnt seem to modify the field data either. what I have is: function add($appointment_id = null){ //existing code $this->Advert->Appointment->id = $appointment_id; $this->Advert->Appo

http routes ok, https alsways redirects to pages/home at first call...

2010-09-27 Thread DigitalDude
Hey, in one of my apps I have a route to an action in controller 'admins' which is called 'signup'. As you probably already get what this action is doing, the normal route would be: http://myapp/admins/signup so I made a route for this in my routes.php and the route is now: http://myapp/signup

Re: editing rows from index.cttp

2010-09-27 Thread james livsey
Hi Jeremy thankyou for replying. yes there are multiple rows and the idea is that it would be more user friendly if the user could 'batch update' multiple records in one view. so in my index i have the normal columns of data eg   but at the end there is the addition of: $this->For

Re: Paginate and Order

2010-09-27 Thread Sam
Have you tried sorting with a virtual field using pagination? As far as I know, virtual fields are sortable using pagination... both from experience and according to http://book.cakephp.org/view/1608/Virtual-fields Modifying definitely does create problems(unless it is a bugfix that you submit, wh

Re: habtm saving: is my really simple solution fragile? using a model for habtm-table

2010-09-27 Thread Sam
AFAIK, that's actually fine- any time I've used a join table to store meta/more than foreign keys I usually end up doing this... The 1.2 cookbook actually recommended this, but in 1.3 it just says "If you plan to add any extra information to this table, it's a good idea to add an additional primary

Re: cakephp pick-list/multi-select.

2010-09-27 Thread euromark
thats a highly sophisticated script you are referring to not easy to copy :) i only know: http://quasipartikel.at/multiselect/ maybe it works for you On 27 Sep., 13:00, fadhli wrote: > Hi everyone. > > i want to make a HABTM picklist like invite friends on facabook. > > i have 3 tables:. > 1.

Re: CakePHP Above Webroot

2010-09-27 Thread euromark
its just really ugly to do so i still dont get how major frameworks didn't figure it out yet. even wordpress and other very popular scripts expose their files. every file starting with "if (directAccess) { die'whatever'; '} gosh :) i personally am glad you can do it the right way with cake. and so

cakephp pick-list/multi-select.

2010-09-27 Thread fadhli
Hi everyone. i want to make a HABTM picklist like invite friends on facabook. i have 3 tables:. 1. clients; 2. groups; 3. messages. clients table HABTM with groups and messages table I want to build an application that sends messages to the client with CakePHP 1.3 and MySQL. I want to make it l

Re: CakePHP Above Webroot

2010-09-27 Thread nurvzy
Is it safe to have the cake folder exposed? It's safe, but rather unprofessional. I'd be more worried that the root of your client's account is accessible more than the cake library. Nick On Sep 27, 3:03 am, jbgillet wrote: > Hi Guys, > > Just wondering how dangerous it was to have cakePHP run

CakePHP Above Webroot

2010-09-27 Thread jbgillet
Hi Guys, Just wondering how dangerous it was to have cakePHP running entirly above webroot in a subfolder. The hosts my client is using have the account root the same as the webroot so i am unable to have any files below document root. Safe or no ? Using the latest version of Cake 1.3.4 Cheers,

Re: Big problems trying to use "medium" as a model name

2010-09-27 Thread Joshua Muheim
I didn't change anything in the source, and it worked under v1.2.0.x, and now it doesn't anymore. So I presume it's because of the upgrade to v1.3.4, and I also found this: "Adding media as an uninflected word" on https://trac.cakephp.org/changeset/5104 Anyone could try to bake a small applicatio