CakeResponse force zip download

2014-05-30 Thread fabio mangolini


i'm trying to force a .zip archive to download. I used as shown in the 
manual: $this->response->file($path . DS . $zip_name . '.zip', 
array('download' => true, 'name' => $zip_name)); return $this->response;

but instead of download, my browser keep showing strange characters. Seems 
that the headers are not correct...can someone help me with that because i 
didn't find anything useful in the cakebook? Thanks in advance. Fabio.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Research about frameworks

2013-05-15 Thread Fabio Schunig
Hello!

I'm doing a research about frameworks for PHP.
Currently, I'm researching the frameworks Zend, CakePHP, CodeIgniter, Yii 
and Symfony.

I'm new in the subject, and I'm reading a lot of tutorials and manuals.
The materials are good, and I could learn a lot of what these frameworks 
can do.

But, in the moment, I came here trying to know what CakePHP **can't do**.
In other words, those features that we miss after working some time with 
the framework.

Can you please tell me some features that you miss in CakePHP for the 
improvement of my research?

Thank you!
Fabio Schunig

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't locate the database?

2011-09-30 Thread Fabio Batista Araujo
Yves,

The *cake_posts* is your MySql database and what is missing, accordingly the
error response, is the *table* posts for the model Post.

To fix it, create the table *posts* inside *cake_posts* database.

If it is not the case, you have to be sure that you application is running
the correct database configuration, $cake_posts instead $default.

The simpler way to fix it is doing:

var $default = array(
'driver' => 'mysqli',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => 'summer11',
'database' => 'cake_posts',
'prefix' => '',
//'encoding' => 'utf8',
);

For additional help, take a look at :
http://book.cakephp.org/view/922/Database-Configuration

"*The $default connection array is used unless another connection is
specified by the $useDbConfig property in a model. For example, if my
application has an additional legacy database in addition to the default
one, I could use it in my models by creating a new $legacy database
connection array similar to the $default array, and by setting var
$useDbConfig = ‘legacy’; in the appropriate models."*

Hope it helped you,
Fábio


2011/9/29 Yves S. Garret 

> Yes.  I called the database cake_posts.  Do I set something up so that it
> points to that specific db?
>
>
> 2011/9/29 Vinícius Moraes de Araújo 
>
>> You have the table posts created on your database ?
>>
>> Atenciosamente,
>>
>> Vinícius Moraes
>>
>>
>> 2011/9/29 Yves S. Garret 
>>
>>>  By the way, this is my database.php file:
>>>
>>> >> /**
>>>  * This is core configuration file.
>>>  *
>>>  * Use it to configure core behaviour ofCake.
>>>  *
>>>  * PHP versions 4 and 5
>>>  *
>>>  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
>>>  * Copyright 2005-2011, Cake Software Foundation, Inc. (
>>> http://cakefoundation.org)
>>>  *
>>>  * Licensed under The MIT License
>>>  * Redistributions of files must retain the above copyright notice.
>>>  *
>>>  * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (
>>> http://cakefoundation.org)
>>>  * @link  http://cakephp.org CakePHP(tm) Project
>>>  * @package   cake
>>>  * @subpackagecake.app.config
>>>  * @since CakePHP(tm) v 0.2.9
>>>  * @license   MIT License (
>>> http://www.opensource.org/licenses/mit-license.php)
>>>  */
>>> /**
>>>  * In this file you set up your database connection details.
>>>  *
>>>  * @package   cake
>>>  * @subpackagecake.config
>>>  */
>>> /**
>>>  * Database configuration class.
>>>  * You can specify multiple configurations for production, development
>>> and testing.
>>>  *
>>>  * driver => The name of a supported driver; valid options are as
>>> follows:
>>>  *mysql - MySQL 4 & 5,
>>>  *mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
>>>  *sqlite- SQLite (PHP5 only),
>>>  *postgres- PostgreSQL 7 and higher,
>>>  *mssql- Microsoft SQL Server 2000 and higher,
>>>  *db2- IBM DB2, Cloudscape, and Apache Derby (
>>> http://php.net/ibm-db2)
>>>  *oracle- Oracle 8 and higher
>>>  *firebird- Firebird/Interbase
>>>  *sybase- Sybase ASE
>>>  *adodb-[drivername]- ADOdb interface wrapper (see below),
>>>  *odbc- ODBC DBO driver
>>>  *
>>>  * You can add custom database drivers (or override existing drivers) by
>>> adding the
>>>  * appropriate file to app/models/datasources/dbo.  Drivers should be
>>> named 'dbo_x.php',
>>>  * where 'x' is the name of the database.
>>>  *
>>>  * persistent => true / false
>>>  * Determines whether or not the database should use a persistent
>>> connection
>>>  *
>>>  * connect =>
>>>  * ADOdb set the connect to one of these
>>>  *(http://phplens.com/adodb/supported.databases.html) and
>>>  *append it '|p' for persistent connection. (mssql|p for example, or
>>> just mssql for not persistent)
>>>  * For all other databases, this setting is deprecated.
>>>  *
>>>  * host =>
>>>  * the host you connect to the database.  To add a socket or port number,
>>> use 'port' => #
>>>  *
>>>  * prefix =>
>>>  * Uses the given prefix for all the tables in this database.  This
>>> setting can be overridden
>>>  * on a per-table basis with the Model::$tablePrefix property.
>>>  *
>>>  * schema =>
>>>  * For Postgres and DB2, specifies which schema you would like to use the
>>> tables in. Postgres defaults to
>>>  * 'public', DB2 defaults to empty.
>>>  *
>>>  * encoding =>
>>>  * For MySQL, MySQLi, Postgres and DB2, specifies the character encoding
>>> to use when connecting to the
>>>  * database.  Uses database default.
>>>  *
>>>  */
>>> class DATABASE_CONFIG {
>>>
>>> var $default = array(
>>> 'driver' => 'mysqli',
>>> 'persistent' => false,
>>> 'host' => 'localhost',
>>> 'login' => 'root',
>>> 'password' => 'summer11',
>>> 'databa

DavidPersson Media plugin HABTM

2010-06-17 Thread Fabio
Hello everyone, I just started using CakePHP. I followed the blog
tutorial and would like to attach images to posts with David Persson
media plugins, but I wonder if it's possible to use a "many to many"
relation (habtm).
I made this structure in the database:

posts table:
   id
   title
   body

attachments table:
   id
   model
   dirname
   basename
   checksum

attachments_posts table:
   attachment_id
   post_id

Models:
class Post extends AppModel {
var $name = 'Post';
var $hasAndBelongsToMany = array(
'Attachment' => array(
'className' => 'Media.Attachment',
'joinTable' => 'attachments_posts',
'foreignKey' => 'post_id',
'associationForeignKey' => 'attachment_id',
)
);
--
class Attachment extends AppModel {

var $name = 'Attachment';
var $actsAs = array(
'Media.Transfer' => array(
'trustClient' => false,
'baseDirectory' => MEDIA_TRANSFER,
'destinationFile' => 
':Medium.short::DS::Source.basename:',
'createDirectory' => true
),
'Media.Media' => array(
'metadataLevel' => 2,
'makeVersions' => true,
'filterDirectory' => MEDIA_FILTER
)
);

var $hasAndBelongsToMany = array(
'Post' => array(
'className' => 'Post',
'joinTable' => 'attachments_posts',
'foreignKey' => 'attachment_id',
'associationForeignKey' => 'post_id',
)
);


This doesn't work: when i add a post it stores the post record in post
table but it doesn't upload the attachment and saves the attachment
record in the database...

Sorry for my English.
Many thanks.
Biusso

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


disable single in a select

2010-05-23 Thread fabio
Hello mates,

do you know if it's possible with FormHelper to set the attribute
disable="disabled" in a single  of a select ?

I mean a thing like this:

Spider

(see 
http://www.lattimore.id.au/2005/06/18/disable-options-in-a-select-dropdown-element/)

thanks a lot

3s

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Cake 1.3 problem setting admin layout in app_controller.php

2010-05-09 Thread fabio
Hello mates,

i'm experimenting a problem while passing from 1.2 to 1.3 regarding
how to set a style from app_controller.php

Basicly i've a simple kind of admin area using the Auth component and
what i need is to set a custom style for all the views in the admin
area:

ie

app/views/users/admin_add.ctp
app/views/users/admin_index.ctp
app/views/users/admin_edit.ctp
app/views/users/admin_view.ctp

app/views/posts/admin_add.ctp
app/views/posts/admin_index.ctp
app/views/posts/admin_edit.ctp
app/views/posts/admin_view.ctp

..
..
..

Now, to get this in Cake 1.2 I did define custom layout&style files,
like this:

---
app/views/layouts/admin.ctp
---




Html->css('admin');
echo $scripts_for_layout;
?>








-
app/webroot/css/admin.css
-
...
...
...

and then added the following:

--
app/app_controller.php
--

params['admin'])) {
$this->layout = 'admin';
}
}
}
?>

Strangely the same approach is not working on Cake 1.3: when I point
to an admin view i keep on seeing the default cake layout with style
cake.generic.css

Is there anybody who can see where I am wrong and why it works on 1.2
and not on 1.3 ?


Thanks a lot in advance


Tres

P.S.
Maybe it's worth to say also that i have the following line in app/
config/routes.php:

Router::connect('/admin', array('controller' => 'users', 'action' =>
'index', 'admin' => true));

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread fabio
Dear Mike,

thanks a lot for sharing your good work...

I'm trying to get Kaching working, but i've encountered an obstacle
regarding plugin routing... i guess
I'm trying and trying to solve this but I couldn't solve it yet...
that's why I'll try to explain it and hope on a little help...

Basicly I've correctly installed a fresh version of CakePHP 1.3 RC4 in
a subdirectory "kache" of my site:

http://www.example.com/kache

Then, I've followed all your precious guidelines on
http://code.google.com/p/kaching-php/wiki/Installation and it seems
that Kaching works fine "underground", except for the routing problem
i'm going to explain with the following facts:

- if i point the browser to http://www.example.com/kache/kaching/ i
get a 403 Forbidden error
- if i point the browser to http://www.example.com/kache/kaching i get
a redirect to url http://www.example.com/kache/app/webroot/kaching/
which ends with a 403 Forbidden error as well
- i could correctly create an admin user by pointing to url
http://www.example.com/kache/kaching/users/install (even if css style
was missing)
- i can correctly login to the admin interface by pointing to url
http://www.example.com//kache/kaching/users/login (even if css style
is missing)
- looking at html source of the pages i've noticed that all referred
elements (css stylesheet, images, ... ) are missing the "kache" part
in their url, and if i add it by virtually modifying the code with
FireBug everything renders fine...
- similarly, all the internal url-links in the pages are missing the
"kache" part and pointing to 404 error, but if i add the the "kache"
part to url they point fine

es.
http://www.example.com/kaching/categories/index --> 404error
http://www.example.com/kache/kaching/categories/index  --> OK (with no
css style)

http://www.example.com/kaching/shoppingcarts/view  --> 404error
http://www.example.com/kache/kaching/shoppingcarts/view --> OK (with
no css style)

..
..

and so on for all the pages...

In the end, since i think this is probably a rounting problem, I'm
trying to modify something in the files:

app/config/core.php
app/config/routes.php
app/plugins/kaching/config/routes.php

but with no succes til now... :-(

Actually i'm a web developer not yet 100% skilled in CakePHP and i
think i'm possibly missing both some basic routing concepts or maybe
something very stupid (as often happens)...

Did you maybe recognize where could be the problem looking at my
description ? Any useful tips ?

Thanks a lot in advance for a little help ;-)

Best regards

Tres

On 16 Mar, 03:12, Mike  wrote:
> If your looking for a shoppingcart plugin for CakePHP that is
> distributed under the MIT License, here you 
> go...http://code.google.com/p/kaching-php
>
> Kachingis tailored for developers that want full control on building
> their online store.  Kachingprovides the store administration and
> lots of features (see project page).  You build the store's look and
> feel interacting with our controllers.
>
> Hopefully people can find this useful and either contribute features
> back or at least be able to use it as a starting point for their own
> online stores.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Kaching: CakePHP Shopping Cart Framework Plugin

2010-04-21 Thread fabio
Dear Mike,

thanks a lot for sharing your good work...

I'm trying to get Kaching working, but i've encountered an obstacle
regarding plugin routing... i guess
I'm trying and trying to solve this but I couldn't solve it yet...
that's why I'll try to explain it and hope on a little help...

Basicly I've correctly installed a fresh version of CakePHP 1.3 RC4 in
a subdirectory "kache" of my site:

http://www.example.com/kache

Then, I've followed all your precious guidelines on
http://code.google.com/p/kaching-php/wiki/Installation and it seems
that Kaching works fine "underground", except for the routing problem
i'm going to explain with the following facts:

- if i point the browser to http://www.example.com/kache/kaching/ i
get a 403 Forbidden error
- if i point the browser to http://www.example.com/kache/kaching i get
a redirect to url http://www.trebiano.it/kache/app/webroot/kaching/
which ends with a 403 Forbidden error as well
- i could correctly create an admin user by pointing to url
http://www.example.com/kache/kaching/users/install (even if css style
was missing)
- i can correctly login to the admin interface by pointing to url
http://www.example.com//kache/kaching/users/login (even if css style
is missing)
- looking at html source of the pages i've noticed that all referred
elements (css stylesheet, images, ... ) are missing the "kache" part
in their url, and if i add it by virtually modifying the code with
FireBug everything renders fine...
- similarly, all the internal url-links in the pages are missing the
"kache" part and pointing to 404 error, but if i add the the "kache"
part to url they point fine

es.
http://www.example.com/kaching/categories/index --> 404error
http://www.example.com/kache/kaching/categories/index  --> OK (with no
css style)

http://www.example.com/kaching/shoppingcarts/view  --> 404error
http://www.example.com/kache/kaching/shoppingcarts/view --> OK (with
no css style)

..
..

and so on for all the pages...

In the end, since i think this is probably a rounting problem, I'm
trying to modify something in the files:

app/config/core.php
app/config/routes.php
app/plugins/kaching/config/routes.php

but with no succes til now... :-(

Actually i'm a web developer not yet 100% skilled in CakePHP and i
think i'm possibly missing both some basic routing concepts or maybe
something very stupid (as often happens)...

Did you maybe recognize where could be the problem looking at my
description ? Any useful tips ?

Thanks a lot in advance for a little help ;-)


Best regards

Tres





I'm a web developer not yet 100% skilled on CakePHP



On 16 Mar, 03:12, Mike  wrote:
> If your looking for a shoppingcart plugin for CakePHP that is
> distributed under the MIT License, here you 
> go...http://code.google.com/p/kaching-php
>
> Kachingis tailored for developers that want full control on building
> their online store.  Kachingprovides the store administration and
> lots of features (see project page).  You build the store's look and
> feel interacting with our controllers.
>
> Hopefully people can find this useful and either contribute features
> back or at least be able to use it as a starting point for their own
> online stores.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: help on a textarea in edit.ctp

2009-12-12 Thread fabio
Dear j0n4,

tnx a lot for your reply, yes i'm using MySQL and i've change the
option 'collation' from Latin1_Swedish_ci to UTF8_bin as you suggested
and it has solve the problem :-)

By the way, there are many different utf8 options availiable and i
don't know if it was maybe better to choose for example
utf8_unicode_ci instead... do you think my choice utf8_ bin is ok ?

Thanks again for your precious help

best regards

fabio



On 12 Dic, 08:50, "j0n4s.h4rtm...@googlemail.com"
 wrote:
> You are using MySQL?
> Try switching the text encoding from whatever it is to UTF-8
>
> On Dec 11, 1:57 pm, fabio <3bi...@gmail.com> wrote:
>
> > Hello mates, just an update...
>
> > I've partially solve the thing by substituting the form-helper comand:
>
> > echo $form->input('description_long', array('rows'=>'10',
> > 'cols'=>'70'));
>
> > with pure HTML  tag:
>
> > echo ' > rows="6" id="PropertyDescriptionLong" >'.$this->data['Property']
> > ['description_long'].'';
>
> > Like this, in edit.ctp i can get all the texts in their right
> > textareaplace with only one problem... every apostrophes and quotation
> > marks are not showing: in their place there is a weird character (kind
> > of black romb with inside a white questio mark...)
>
> > Any idea how can i manage and solve this thing ?
>
> > Tnx a lot
>
> > fabio

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: help on a textarea in edit.ctp

2009-12-11 Thread fabio
Hello mates, just an update...

I've partially solve the thing by substituting the form-helper comand:

echo $form->input('description_long', array('rows'=>'10',
'cols'=>'70'));

with pure HTML  tag:

echo ''.$this->data['Property']
['description_long'].'';

Like this, in edit.ctp i can get all the texts in their right
textareaplace with only one problem... every apostrophes and quotation
marks are not showing: in their place there is a weird character (kind
of black romb with inside a white questio mark...)

Any idea how can i manage and solve this thing ?

Tnx a lot

fabio

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: help on a textarea in edit.ctp

2009-12-11 Thread fabio
Hi sphereweb, i had it initially as TEXT then i change it to LONGTEXT
(as stated in my previous post), but lately i realized that the
problem was not solved completely with changing to LONGTEXT...
pheraphs the problem is not the character lenght of texts (average
lenght is 2000-3000 char that should be widely supported by LONGTEXT,
isn't it ?)

any advice ?

tnx a lot

fabio



On Nov 18, 2:47 pm, sphereweb  wrote:
> What about in textarea field in the db? Do you have it as TEXT or
> VARCHAR?
>
> On Nov 17, 11:45 am, fabio <3bi...@gmail.com> wrote:
>
> > Dear Cakers,
>
> > I'm experimenting a strange behaviour on a baked edit.ctp view...
>
> > Basicly in the edit.ctp there's a textarea (included by Form Helper)
> > that when it's filled and the Submit button is press everything seems
> > to work fine... and even the whole text inserted is correctly saved in
> > the proper mysql table. The problem is that if i re-edit the same
> > record recalling (edit.ctp) the textarea appears to be empty so it's
> > not possible to apply any further changes (moreover you have to be
> > aware that if you push the Submit button you're going to overwrite all
> > the current content in the database field).
>
> > Now the thing is even more strange because all this happens only if i
> > fill the textarea with a long text, while if the text is short, it
> > will correctly be rendered in when i re-open the edit.ctp view.
>
> > How is this possible since I haven't specified any limit on the
> > textarea's lenght?
>
> > Is it possible that when you bake a edit.ctp view it has a limit on
> > textareas lenght by default ?
>
> > I'm totally stucked with this thing  :-(
> > ...and I hope someone could suggest me something to check to handle
> > this thing...
>
> > Thaks a lot for any little advice...
>
> > fabiox

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: help on a textarea in edit.ctp

2009-11-17 Thread fabio
Hello is me again :-)

I feel a bit stupid, but happy because I've solved the thing.
I had just to change the type of the relative field in the database
table: from TEXT to LONGTEXT
Now the text limit is wide enough to be always rendere inside the text
area when i call the edit.ctp view.

I hope this tip will save time to other people in the future...

cheers

fabiox

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.




Re: Simple Multiple File upload

2009-11-17 Thread fabio
I also suggest you this component that I've succesfully tried... by
the way it has recently been updated to handle multiple uploads:

http://www.webtechnick.com/blogs/view/221/CakePHP_File_Upload_Plugin

On 17 Nov, 09:21, Jeremy Burns  wrote:
> Try 
> this:http://bakery.cakephp.org/articles/view/file-upload-component-w-autom...

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.




help on a textarea in edit.ctp

2009-11-17 Thread fabio
Dear Cakers,

I'm experimenting a strange behaviour on a baked edit.ctp view...

Basicly in the edit.ctp there's a textarea (included by Form Helper)
that when it's filled and the Submit button is press everything seems
to work fine... and even the whole text inserted is correctly saved in
the proper mysql table. The problem is that if i re-edit the same
record recalling (edit.ctp) the textarea appears to be empty so it's
not possible to apply any further changes (moreover you have to be
aware that if you push the Submit button you're going to overwrite all
the current content in the database field).

Now the thing is even more strange because all this happens only if i
fill the textarea with a long text, while if the text is short, it
will correctly be rendered in when i re-open the edit.ctp view.

How is this possible since I haven't specified any limit on the
textarea's lenght?

Is it possible that when you bake a edit.ctp view it has a limit on
textareas lenght by default ?

I'm totally stucked with this thing  :-(
...and I hope someone could suggest me something to check to handle
this thing...

Thaks a lot for any little advice...

fabiox

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.




Re: How I can integrate cakephp into Joomla.

2009-11-17 Thread fabio
Hello Landed.at,

I like your vision of intengration between CakePHP and Joomla, not as
a bridging like Jake was supposed, but as two separate entities:
Joomla as good website administrable, CakePHP as a good webapp to
manage additional databases totally separated from Joomla database (ie
database of properties in a Real Estate Website).

Did you came up with any working experiment using this model ?

cheers

fabio


On 22 Ott, 12:37, "www.landed.at"  wrote:
> I was thinking that it was also useful to know how one might have both
> frameworks working in the same folder structure but no bridge so to
> speak.
> Advantages could be thatjoomlaprovides a very good looking easy to
> administer website.then cakephp provides some really cool bespoke
> applications that it is hard to do withjoomla.
> The support forjoomlaseems to be dropping off in my opinion and the
> framework isnt really easy to pick up on to do something specific.
>
> But what would the folder structure be
>
> /root/cake
> /root/joomla
>
> or
>
> /root/cake/...vendors/joomla
>
> or
>
> /root/joomla/cake

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.




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

2009-11-16 Thread fabio
Hi Melanie, I have a problem with the same effect that you described
but I've noted a different thing: the text I insert on edit is
correctly saved on database, but if it's a long text it doesn't appear
in the textarea when i re-open edit.ctp; instead if it's a short text
(let's say one single row) it correctly shows in the textarea on
edit.ctp

Could you maybe suggest me how could I solve this strange behaviour ?

thanks a lot in advance

fabio



On 3 Ott, 18:01, Melanie Sommer  wrote:
> Hello Martin> Since the field is empty I suspect you may have Sanitize in 
> place, or
> > some other text cleaner.
>
> No (not that I know, just the standard content that cakephp gives you
> when baking)
>
> > A simple character set problem should give you garbage but not empty 
> > strings.
>
> This is also was I thought. But when changing the default settings of
> my webhoster from latin1 (iso-something) to utf-8 everything worked
> fine. Strange but impressive.
>
> Melanie

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.




Re: checkboxes with alternative value

2009-08-31 Thread fabio

Dears delocalizer and DrLoboto,

tnx for your suggestions... i'm working in that way now but i hade
some difficulties...

Basically I have this portion of the $form array:

[Amenity] => Array
(
[0] => Array
(
[id] => 6
[name] => Pets
[AmenitiesProperty] => Array
(
[id] => 17
[property_id] => 1
[amenity_id] => 6
[specify] => no
)

)

[1] => Array
(
[id] => 1
[name] => Type
[AmenitiesProperty] => Array
(
[id] => 16
[property_id] => 1
[amenity_id] => 1
[specify] => no
)

)

[2] => Array
(
[id] => 2
[name] => Floors
[AmenitiesProperty] => Array
(
[id] => 15
[property_id] => 1
[amenity_id] => 2
[specify] => no
)

)

[3] => Array
(
[id] => 3
[name] => Last Remodeled
[AmenitiesProperty] => Array
(
[id] => 14
[property_id] => 1
[amenity_id] => 3
[specify] => no
)

)

[4] => Array
(
[id] => 4
[name] => Constructed
[AmenitiesProperty] => Array
(
[id] => 13
[property_id] => 1
[amenity_id] => 4
[specify] => no
)

)

[5] => Array
(
[id] => 5
[name] => Smoking
[AmenitiesProperty] => Array
(
[id] => 12
[property_id] => 1
[amenity_id] => 5
[specify] => no
)

)

)


and i need looping through it and echoing separte elements
individually...

I know how i can access and echo elements from this array:

ie.
echo $this->data['Amenity'][0]['name'];

and i think i should use a "for each ... " statement... but how can i
loop this kind of multidimensional associative array in CakePHP ?

tnx a lot


fabio



On 30 Ago, 06:50, delocalizer  wrote:
> Hi Fabio;
> Dr Loboto is correct - you'll have to output the elements individually
> rather than as a group. You can use the form helper to create the
> individual checkboxes, but getting the text field to display inline
> nicely may require some tinkering. Or just code the html yourself -
> that's what I ended up doing recently for a similar scenario with
> radio buttons. Form helper is nice but can't be expected to cover
> every formatting possibility.
> Don't forget to add some javascript that will clear the text field
> again if its checkbox is unselected
> regards,
> C.
>
> On 28 Ago, 19:01, fabio <3bi...@gmail.com> wrote:
>
>
>
> > Thanks again Dr.Loboto,
>
> > that's what i came up to as well, but it works only for the last
> > checkbox of the list (or the first if i used 'before' parameter)...
> > what i need is a text field associated for each checkbox of a group of
> > checkboxes... don't know if it's possible at this point... :-(
>
> > damn ! i think i'll end avoiding the FormHelper and

Re: Form with saving of true/false/null

2009-08-28 Thread fabio

Hi, i'm a CakePHP newbie and i'm handling on a quite similar topic for
which i've opened a specific thread here:
http://groups.google.it/group/cake-php/browse_thread/thread/405946857d2f8ed3/8dbac8722596a58b
Could you maybe have a look on it a give me some little help ?

thanks a lot in advance for any suggestion

fabio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: checkboxes with alternative value

2009-08-28 Thread fabio

Thanks again Dr.Loboto,

that's what i came up to as well, but it works only for the last
checkbox of the list (or the first if i used 'before' parameter)...
what i need is a text field associated for each checkbox of a group of
checkboxes... don't know if it's possible at this point... :-(

damn ! i think i'll end avoiding the FormHelper and coding it with
pure html even if like this i'm gonna loose all the benefits of Cake

Anyway thank you again for your tips

fabio



On 28 Ago, 10:16, "Dr. Loboto"  wrote:
> Read 
> manual.http://book.cakephp.org/view/191/options-before-options-between-optio...
>
> echo $form->input(
>     'Amenity',
>     array(
>         'type' => 'select',
>         'multiple' => 'checkbox',
>         'after' => $form->input(
>             'User.name',
>             array('onfocus' => 'CheckCheckBox(this.form)')
>         )
>     )
> );
>
> On Aug 28, 2:57 pm, fabio <3bi...@gmail.com> wrote:
>
>
>
> > Dear Dr.Loboto, thank you very much for your suggestion... i'm
> > handling on it but i would first need to know how to set the
> > FormHelper options to show one text field beside each checkbox...
>
> > I was thinking about something like  markup injections using
> > parameters "between[string]" or "after[string]" but i'm not really
> > sure it make sense...
>
> > Any additional suggestion ?
>
> > thanks a lot, really appreciate
>
> > fabio
>
> > On 28 Ago, 07:59, "Dr. Loboto"  wrote:
>
> > > echo $form->input('User.name', array('onfocus' => 'CheckCheckBox
> > > (this.form)'));
>
> > > On Aug 27, 9:18 pm, fabio <3bi...@gmail.com> wrote:
>
> > > > Dear all,
>
> > > > i'm a CakePHP newbie and i'm looking for some help regarding a
> > > > particular use of checkboxes in a form.
>
> > > > Basically i've got a check-boxes-section in the form of a baked
> > > > edit.ctp, called with a basic
>
> > > > echo $form->input('Amenity', array( 'type' => 'select', 'multiple' =>
> > > > 'checkbox' ));
>
> > > > The models refers to a join table with an additional field 'specify':
>
> > > > CREATE TABLE IF NOT EXISTS `amenities_properties` (
> > > >   `id` int(11) unsigned NOT NULL auto_increment,
> > > >   `property_id` int(11) NOT NULL,
> > > >   `amenity_id` int(11) NOT NULL,
> > > >   `specify` varchar(100) NOT NULL default 'yes',
> > > >   PRIMARY KEY  (`id`)
> > > > );
>
> > > > The idea is to set values like this:
>
> > > > 'no' if unchecked
> > > > 'yes' ..if checked
> > > > 'whatever'... if checked and a string 'whatever' is inserted
>
> > > > In other words I need to associate to each checkboxes an additional
> > > > input text field to be eventually filled only if the checkboxes are
> > > > previously checked
>
> > > > I've found what it seems a perfect solution for this, but now I need
> > > > some help to implement it in CakePHP terms.
>
> > > > Here it is:
>
> > > > http://www.w3.org/
> > > > TR/html4/strict.dtd">
> > > > 
> > > >         
> > > >                 
> > > >                 Test Checkbox
> > > >                 
> > > >                         function CheckCheckBox(frm)
> > > >                         {
> > > >                         if (!frm.CheckThis.checked)
> > > >                         frm.CheckThis.focus()
> > > >                         }
> > > >                 
> > > >         
> > > >         
> > > >          
> > > >                 
> > > >                 To insert your name check the box.
> > > >                 
> > > >                 Name:
> > > >                  > > > onfocus="CheckCheckBox
> > > > (this.form)">
> > > >      
> > > >         
> > > > 
>
> > > > (see it in action here:http://www.html.it/articoli/1756/esempio.html
> > > > )
>
> > > > How you can see, the javascript function allows the user to input an
> > > > alternative value to yes/no only if the checkbox is previously checked
>
> > > > So the point is:
> > > > how to get done this behaviour togheter with CakePHP default Form
> > > > Helper ?
> > > > Do you think it's possible somehow or another approach would be better
> > > > to achieve the same result ?
>
> > > > Thanks a lot in advance for some suggestions
>
> > > > Best regards
>
> > > > fabio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: checkboxes with alternative value

2009-08-28 Thread fabio

Dear Dr.Loboto, thank you very much for your suggestion... i'm
handling on it but i would first need to know how to set the
FormHelper options to show one text field beside each checkbox...

I was thinking about something like  markup injections using
parameters "between[string]" or "after[string]" but i'm not really
sure it make sense...

Any additional suggestion ?

thanks a lot, really appreciate

fabio


On 28 Ago, 07:59, "Dr. Loboto"  wrote:
> echo $form->input('User.name', array('onfocus' => 'CheckCheckBox
> (this.form)'));
>
> On Aug 27, 9:18 pm, fabio <3bi...@gmail.com> wrote:
>
>
>
> > Dear all,
>
> > i'm a CakePHP newbie and i'm looking for some help regarding a
> > particular use of checkboxes in a form.
>
> > Basically i've got a check-boxes-section in the form of a baked
> > edit.ctp, called with a basic
>
> > echo $form->input('Amenity', array( 'type' => 'select', 'multiple' =>
> > 'checkbox' ));
>
> > The models refers to a join table with an additional field 'specify':
>
> > CREATE TABLE IF NOT EXISTS `amenities_properties` (
> >   `id` int(11) unsigned NOT NULL auto_increment,
> >   `property_id` int(11) NOT NULL,
> >   `amenity_id` int(11) NOT NULL,
> >   `specify` varchar(100) NOT NULL default 'yes',
> >   PRIMARY KEY  (`id`)
> > );
>
> > The idea is to set values like this:
>
> > 'no' if unchecked
> > 'yes' ..if checked
> > 'whatever'... if checked and a string 'whatever' is inserted
>
> > In other words I need to associate to each checkboxes an additional
> > input text field to be eventually filled only if the checkboxes are
> > previously checked
>
> > I've found what it seems a perfect solution for this, but now I need
> > some help to implement it in CakePHP terms.
>
> > Here it is:
>
> > http://www.w3.org/
> > TR/html4/strict.dtd">
> > 
> >         
> >                 
> >                 Test Checkbox
> >                 
> >                         function CheckCheckBox(frm)
> >                         {
> >                         if (!frm.CheckThis.checked)
> >                         frm.CheckThis.focus()
> >                         }
> >                 
> >         
> >         
> >          
> >                 
> >                 To insert your name check the box.
> >                 
> >                 Name:
> >                 
> >      
> >         
> > 
>
> > (see it in action here:http://www.html.it/articoli/1756/esempio.html
> > )
>
> > How you can see, the javascript function allows the user to input an
> > alternative value to yes/no only if the checkbox is previously checked
>
> > So the point is:
> > how to get done this behaviour togheter with CakePHP default Form
> > Helper ?
> > Do you think it's possible somehow or another approach would be better
> > to achieve the same result ?
>
> > Thanks a lot in advance for some suggestions
>
> > Best regards
>
> > fabio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



checkboxes with alternative value

2009-08-27 Thread fabio

Dear all,

i'm a CakePHP newbie and i'm looking for some help regarding a
particular use of checkboxes in a form.

Basically i've got a check-boxes-section in the form of a baked
edit.ctp, called with a basic

echo $form->input('Amenity', array( 'type' => 'select', 'multiple' =>
'checkbox' ));

The models refers to a join table with an additional field 'specify':

CREATE TABLE IF NOT EXISTS `amenities_properties` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `property_id` int(11) NOT NULL,
  `amenity_id` int(11) NOT NULL,
  `specify` varchar(100) NOT NULL default 'yes',
  PRIMARY KEY  (`id`)
);

The idea is to set values like this:

'no' if unchecked
'yes' ..if checked
'whatever'... if checked and a string 'whatever' is inserted

In other words I need to associate to each checkboxes an additional
input text field to be eventually filled only if the checkboxes are
previously checked

I've found what it seems a perfect solution for this, but now I need
some help to implement it in CakePHP terms.

Here it is:

http://www.w3.org/
TR/html4/strict.dtd">



Test Checkbox

function CheckCheckBox(frm)
{
if (!frm.CheckThis.checked)
frm.CheckThis.focus()
}



 

To insert your name check the box.

Name:

 



(see it in action here: http://www.html.it/articoli/1756/esempio.html
)

How you can see, the javascript function allows the user to input an
alternative value to yes/no only if the checkbox is previously checked

So the point is:
how to get done this behaviour togheter with CakePHP default Form
Helper ?
Do you think it's possible somehow or another approach would be better
to achieve the same result ?

Thanks a lot in advance for some suggestions

Best regards

fabio

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Mocking render method

2009-05-20 Thread Fabio Kreusch

Hello all,

For the functional test of my system, I am mocking some of the
controller methods.
The only one I am having problems with is the render method.
This is in my AppController:

function render($action = null, $layout = null, $file = null) {
if (CAKE_UNIT_TEST) {
} else {
  parent::render($action, $layout, $file);
}
  }

This works well for the test, but for the real system it just prints a
blank screen.
Am I doing something wrong?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom queries test

2009-01-22 Thread Fabio Kreusch

I'm working with no prefixes..

On Jan 21, 10:04 pm, "websta*" 
wrote:
> If you get your database connection details from the ConnectionManager you
> will at least be able to deduce your table prefix and integrate this into
> your querries.
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
>
> Of Fabio Kreusch
> Sent: Thursday, January 22, 2009 10:48 AM
> To: CakePHP
> Subject: Custom queries test
>
> Hello all!
>
> I'm thinking about on how to test custom queries in a model.
>
> Suppose I have something like this in a model:
>
> function doSomethingWithCustomQuery() {
>   return $this->query('SELECT * FROM table');
> }
>
> How can I test this using the fixtures and all?
> My main problem is how to detect the test environment
> so I can, for exemple, attach 'test_suite' to the table name,
> so the query will run on the test table.
>
> How can I do this?
>
> Internal Virus Database is out of date.
> Checked by AVG -http://www.avg.com
> Version: 8.0.176 / Virus Database: 270.10.8/1899 - Release Date: 1/17/2009
> 5:50 PM
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Custom queries test

2009-01-21 Thread Fabio Kreusch

Hello all!

I'm thinking about on how to test custom queries in a model.

Suppose I have something like this in a model:

function doSomethingWithCustomQuery() {
  return $this->query('SELECT * FROM table');
}

How can I test this using the fixtures and all?
My main problem is how to detect the test environment
so I can, for exemple, attach 'test_suite' to the table name,
so the query will run on the test table.

How can I do this?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use the controller flash() method and what's the expected behaviour and output?

2008-12-20 Thread Fabio M

I try to be more clear. It's me who apologize: English is not my first
language, sorry. : )

> Heres your scenario  (as I understand it);
>
> Controller calls flash layout passing it a url,delay and message ->
> Flash layout displays. If debug == 0 it will redirect in the time
> specified. to the url specified.  ->
> the redirect lands on add.ctp where you set debug = 0.

> If that is indeed the case than I think you can see the problem.
> The code in add.ctp comes into play only AFTER the would be redirect.

No, wait, the redirect I set doesnt not land to add... it's a redirect
to the index action (to '/movies').
So, let's resume, I wanted to perform an add action: the browser
requests for the 'movies/add' url. Since I know that the code for the
save of the model will wait for a not empty $data array I'm sure that
the code of add.cpt (with the creation of the form and the change of
the debug value) will be executed before the second call of the add
action (with the flash method call inside).
It should have been worked. Well...  if I get right how the request
flow goes.

> You could illustrate this by logging the display of the flash layout
> and debug the display of add.ctp.

I'm not really into the logging by now. But I'll certainly use it to
better understand how things work and which the execution flow is.

> So I would recommend using Configure::write('debug', 0);  in the
> actual controller just before calling flash...
>
> Or you might just do as I did and override the default flash layout
> with your own, and remove the whole check for debug. I never
> understood why the page is frozen for debug to begin anyhow.

I did kind of the second way: I placed the line for the change of
debug value in the flash layout itself, and it worked. But again: I
dont understand, this change lasts till...  when? I noticed that since
the very next operation all works as the debug value was back to the
default (2, with all debug messages. And that's also what happened
before when it didnt work, I guess). So I think I didnt understand
well which is the lifecycle of this Configure object.

Thank you for your patience  : )

Fabio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use the controller flash() method and what's the expected behaviour and output?

2008-12-18 Thread Fabio M

Wait. Changing the debug value in the core configuration make the
flash messages work.
Contrarily the change I tried to do in the add.ctp view was not holded
outside that context. So the question is: why?

Thank you, Fabio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to use the controller flash() method and what's the expected behaviour and output?

2008-12-18 Thread Fabio M

Hi all.
I'm starting to move my first steps in a personal application. By now
I use a lot the given examples included in the cookbook, like the blog
example.

At this page...

http://book.cakephp.org/view/337/Adding-Posts

...I see a handy usage of the flash() method to show a message to the
user. I wanted to use it myself, so I copied the default flash layout
to my application folder and I temporarily chaged the 'debug' value to
enable automatic redirects.
Here is the essential code. The view:

movies/add.ctp

create('Movie');
echo $form->input('title',array( 'label' => 'Title' ));
echo $form->end('Save');
?>

and the add() method in the controller:

function add()
{
if (!empty($this->data))
{
if ($this->Movie->save($this->data))
{
$this->flash('Movie saved','/movies/');
}
}

}


So: the redirect doesnt work and the content of the page includes some
messages about the sql queries, beyond my custom message (that is
clickable and links to the redirect url).
I guess something is not working fine.

I checked the default flash layout, and I see that redirect is
performed with the following.





Any help?

Thank you, Fabio

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Understanding if a model-controller couple is needed

2008-12-03 Thread Fabio M

Thank you very much. I had reached the same conclusion while I was
waiting for replies and now you make me more self-confident.
I have no much experience in actual developing, so an extremely
minimal approach to the E-R diagram influenced me.

Again, thank you.


> Are your relationships really HABTM, or are they parent-child? I would
> think that you'd have:
>
>    1. Movies has many Reviews
>    2. Reviewers has many Reviews
>    3. Reviews belong to Movies and Reviewers
>
> On Nov 29, 11:43 am, Fabio M <[EMAIL PROTECTED]> wrote:
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Understanding if a model-controller couple is needed

2008-11-29 Thread Fabio M

Hi all. This is my first message here.
I want to make it clear first that I read the (almost) whole
documentation and now I'm going to develop a first application. I
still have a doubt about dealing with HABTM relationship.

I give you the precise picture.

I have two entities: movie (motion picture) and reviewer. These are in
a HABTM relationship, which represents the review. I'll create the
conventional db tables: movies, reviewers and movies_reviewers. Note
that movies_reviewers isnt just a join-table, it includes other
informations beyond the foreign key (the vote of the review, the text
of the review).

Now I ask: do I need a model for the review? Is the review an object
in my application?

If so, which table should this model class be linked to? Directly to
join-table?

Should I make a whole another design? Dont know...  with three
entities (movie, review, reviewers) and two merely associative
relationships (with a movie_id and a reviewer_id in the reviews
table)?

Thank you. And forgive me for bad explanation and for not having found
this topic in other threads. I'm italian and I'm a bit in difficulty
at retrieving technical infos in a foreign language.

Thank you in advance.  : )

      Fabio M

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



$javascript->object problem

2008-11-26 Thread Fabio Kreusch

Hello all,

I'm starting with CakePHP, and I'm having this problem:

When I use $javascript->object() to convert an array to a json object,
it simply cut out my values with accents (áêé etc).
Is there an option to stop doing this?

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Favicon Path

2008-09-06 Thread fabio . sfuncia

On Sat, Sep 6, 2008 at 3:32 PM, Michael <[EMAIL PROTECTED]> wrote:
>
> In my layout I initially used:
> meta('favicon.ico', '/favicon.ico', array('type' =>
> 'icon')); ?>

use only:
$html->meta('icon');
the first parameter is type (and not title... it's a mistake for version 1.2)

If you want set path use second parameter and look API ;)


Fabio

/fiblan

> However, the correct path was not being generated.  In other words,
> the href attribute was always set to "/favicon.ico" even if the
> application was installed to a sub web.  The $html->css(), $html-
>>image() and $javascript->link() all work as expected.
>
> I changed my favicon tags to be:
>  type="image/x-icon"/>
> 
>
> and now the correct path is always generated.  My concern is that I
> don't see $html->url() in the 1.2 API reference.  Is it deprecated?
> Is my usage of the $html->meta() method correct?  Is the favicon path
> a known issue?
>
> thanks,
> Michael
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Creating and Destroying Associations

2008-09-06 Thread fabio . sfuncia

Hi bakers,
Quickly, in cookbook (3.7.6.6):
   1.  $this->Model->unbindModel(
   2. array('associationType' => array('associatedModelClassName'))
   3. );

Is not more proper this ?:
   1.  $this->Model->unbindModel(
   2. array('associationType' => array('associatedAlias')) //assocName
   3. );

what do you think?


/fiblan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: scaffold

2008-09-03 Thread fabio . sfuncia

Scaffold is wonderfuland cake is very flexible (gymnast :D) framework ;)

I suggest to exclude field with beforeRender (controller) + array_diff:

//example to exclude created & modified

function beforeRender(){
if ($this->action=='index'){

$this->viewVars['scaffoldFields']=array_diff($this->viewVars['scaffoldFields'],array('created','modified'));
}
return true;
}

//if you want custom scaffold views
1- copy default scaffold views: index, view,edit  from
cake/libs/view/scaffolds/  to your app/views//
2- rename index=>scaffold.index,view=>scaffold.view,edit=>scaffold.edit
3- edit scaffold views as you prefer.



/fiblan


On Tue, Sep 2, 2008 at 4:22 PM, hydra12 <[EMAIL PROTECTED]> wrote:
>
> The easiest way to do this is to bake your application and have bake
> create the default views for you.  Then you can go in and edit those
> views any way you want.  Otherwise, scaffolding is pretty much non-
> editable.  I think you can edit the scaffold templates, but I don't
> know how to do that.
>
> On Sep 2, 4:02 am, "Ranjana Sriavastava" <[EMAIL PROTECTED]>
> wrote:
>> Hello
>>
>> I want remove some fields from scaffold views. which type that possible pls
>> help me.
>>
>> thanks
>>
>> Ranjana
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 404 Error When Accessing Controllers Using XAMPP

2008-08-31 Thread fabio . sfuncia

On Sun, Aug 31, 2008 at 6:24 PM, Wole <[EMAIL PROTECTED]> wrote:
>
> Thanks for the reply. I tried adding RewriteBase /myapp to app/
> webroot/.htaccess but no luck. I still get the same error. I'm not
> even sure mod_rewrite is working properly in XAMPP, because even if I
> make an error in a .htaccess file, say like purposefully misspelling
> RewriteBase, I don't get a 500 server error. I've followed all the
> suggested configurations from various forums and Websites but none
> seem to work. Any other suggestions? Thanks.

The problem is mod_rewrite or .htaccess?

Test in .htacces (webroot)
Deny from all

no forbidden? .htaccess is set correctly in httpd.conf?

 AccessFileName .htaccess


> On Aug 31, 7:10 am, [EMAIL PROTECTED] wrote:
>> Try to add
>> RewriteBase /myapp
>>
>> in app/webroot/.htaccess
>>
>> On Sun, Aug 31, 2008 at 12:26 PM, Wole <[EMAIL PROTECTED]> wrote:
>>
>> > So far I have successfully setup CakePHP using XAMPP on my Mac. I am
>> > able to view the main page for my application with the CSS working.
>> > Next I created a users table, user.php model, users_controller.php,
>> > and my views/users/index.ctp page. The problem is when I view
>> >http://localhost/myapp/usersin my browser I get a "404 Not Found"
>> > error. It says "The requested URL /myapp/users was not found on this
>> > server." But, if I view the "pretty url" version 
>> > athttp://localhost/myapp/index.php/users
>> > I can see the main page for the users controller.
>>
>> > I checked my httpd.conf file and everything looks right:
>>
>> > - I uncommented the LoadModule rewrite_module modules/mod_rewrite.so
>> > line
>>
>> > - I added the alias and directory information
>>
>> > Alias /myapp /Applications/xampp/xamppfiles/htdocs/myapp/app/webroot
>> > 
>> >AllowOverride All
>> >Options All
>> >Order allow,deny
>> >Allow from all
>> > 
>>
>> > - In the  section
>> > of httpd.conf I also changed
>>
>> > AllowOverride AuthConfig to read AllowOverride All
>>
>> > I'm not sure what I'm doing wrong here. I've tested my configuration
>> > on  MAMP but still the same problem. I would greatly appreciate it if
>> > anyone can help me out here. Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 404 Error When Accessing Controllers Using XAMPP

2008-08-31 Thread fabio . sfuncia

Try to add
RewriteBase /myapp

in app/webroot/.htaccess



On Sun, Aug 31, 2008 at 12:26 PM, Wole <[EMAIL PROTECTED]> wrote:
>
> So far I have successfully setup CakePHP using XAMPP on my Mac. I am
> able to view the main page for my application with the CSS working.
> Next I created a users table, user.php model, users_controller.php,
> and my views/users/index.ctp page. The problem is when I view
> http://localhost/myapp/users in my browser I get a "404 Not Found"
> error. It says "The requested URL /myapp/users was not found on this
> server." But, if I view the "pretty url" version at 
> http://localhost/myapp/index.php/users
> I can see the main page for the users controller.
>
> I checked my httpd.conf file and everything looks right:
>
> - I uncommented the LoadModule rewrite_module modules/mod_rewrite.so
> line
>
> - I added the alias and directory information
>
> Alias /myapp /Applications/xampp/xamppfiles/htdocs/myapp/app/webroot
> 
>AllowOverride All
>Options All
>Order allow,deny
>Allow from all
> 
>
> - In the  section
> of httpd.conf I also changed
>
> AllowOverride AuthConfig to read AllowOverride All
>
> I'm not sure what I'm doing wrong here. I've tested my configuration
> on  MAMP but still the same problem. I would greatly appreciate it if
> anyone can help me out here. Thanks.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Unable to read $this->session() in AppController when using Admin Routes

2008-08-30 Thread fabio . sfuncia

On 8/29/08, Jaime <[EMAIL PROTECTED]> wrote:
>
> Weird: it only happens when Routing.admin is set to 'admin'. When I
> change it, everything works perfectlly.
>
> On 29 ago, 13:13, Jaime <[EMAIL PROTECTED]> wrote:
>> I've been dealing with this for two days; hope it's not a lame
>> question. On 1.2.0.7296 (RC2) I set "Configure::write('Routing.admin',
>> 'admin')" in core.php, and my app_controller.php looks like this:
>>
>> class AppController extends Controller {
>>   function beforeFilter() {
>> die(pr($this->Session->read()));
>>   }
>>
>> }
>>
>> My $this->Auth->userModel is 'Login'.
>>
>> Now when I log in as a valid user (I'm using Acl + Auth) and go to /
>> news I get, as expected:
>>
>> /news/index:
>> Array (
>> [Config] => Array ( ... )
>> [Message] => Array ( ... )
>> [Auth] => Array (
>> [Login] => Array ( **LOGGED USER DATA** )
>> )
>> )
>>
>> But when using admin prefix (/admin/news/index), the logged-in user
>> data is not shown (probably overwritten by redirect info):
>>
>> Array (
>> [Config] => Array ( ... )
>> [Message] => Array ( ... )
>> [Auth] => Array (
>> [redirect] => /admin/news/index
>> )
>> )
>>
>> Because of this I cannot use admin routes (I have no loggin info).
>> After deep debugging and searching everywhere,  I just cannot figure
>> out the solution :-(
>>
>> Any ideas?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP php5?

2007-05-26 Thread Fabio

Hi,
I remember another app that had significative performance
improvements, when turned to PHP5 only, without compatibility to PHP4
in the PHP5 interpreter. It would in fact be interesting to know if
this will ever happen (ie, be possible) to CakePHP, with this in mind.

Bye,
Fabio

On May 26, 2:09 am, nate <[EMAIL PROTECTED]> wrote:
> Okay, seriously, why are people sooo ignorant about this issue???
>
> There is nothing, no thing, not *anything* preventing you from writing
> PHP5-only apps with Cake, even though we support PHP4.  The one and
> only thing you *cannot* do with a Cake app is run it in E_STRICT
> mode.  That's it, that's all.  In fact, the Cake core itself has
> several PHP5-specific features which are used by default, and we
> provide fallbacks for PHP4 compatibility.
>
> So can we please just drop this already?
>
> On May 25, 5:33 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On 5/25/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > > When will CakePHP be turned to PHP5 code?
>
> > You can build CakePHP apps with PHP 5 already.
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> > @TheBallpark -http://www.littlehart.net/attheballpark
> > @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Drag hoverclass not effect, within my code

2006-12-01 Thread Fabio Esposito
try to use drag me



On 11/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Drag Demo
>
> drag me
>  $options = array(
> 'revert'=>  true,
> );
> echo $ajax->drag('product1', $options);
> ?>
>  $html->image('ajax-loader.gif') ?>
> 
> 
>
> 
> 
>
>  $options = array(
> 'accept'=>  'products',
> 'hoverclass'=>  "cart-active"
> );
>
> $ajaxoptions = array(
> 'url'   =>  '/drags/hello',
> 'update'  => 'items',
> 'loading' =>
> "Element.hide('items');Element.show('searchloading');",
> 'complete'=>
> "Element.hide('searchloading');Effect.Appear('items')"
> );
> echo $ajax->dropRemote('cart', $options, $ajaxoptions);
> ?>
>
>
> >
>


-- 
[]'s
Fábio Espósito Pires
(11) 9248-


--~--~-~--~~~---~--~~
 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---


ajax doubt

2006-11-29 Thread Fabio Esposito
Hi people!

I'm loving cake-php but have some doubt can you help me?

I cant understand very well how to use scriptaculous and prototype ajax
libraries. How and where i define my own method for example?
In my experience with mojavi framework I uses xajax as ajax library and
seems to me very easy to make my functions and interact with templates

How to make a loading message like ruby on rails?? its an image?

To make comboboxes and date comboboxes exists any helper?  its inside html
helper?

Anybody have a drag and drop ajax example? In my project just de drag works
:(

thanks a lot!

Fabio Esposito


--~--~-~--~~~---~--~~
 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---


Re: $ajax->drop problem

2006-11-28 Thread Fabio Esposito
not work :( neither div /div span /span

On 11/27/06, Alex <[EMAIL PROTECTED]> wrote:
>
>
> >  Drop
>
> hi,
>
> seems that you've a typo ("span")
>
>
> >
>


-- 
[]'s
Fábio Espósito Pires
(11) 9248-


--~--~-~--~~~---~--~~
 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---