Sorry, typo error, is:
Articles hasandBelognsToMany Tags
--~--~-~--~~~---~--~~
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,
Im using the following structure:
User hasMany Listing
Listing hasMany Contacts
Listings hasAndBelongsToMany Articles
Articles hasMany Tags
When i delete a User or a Listing all their associated Listings and
Articles are successfully deleted. But not their Tags. Listings and
Articles are deleted
Hi!
Im using the media plugin adapter:
http://wiki.github.com/davidpersson/media/configuration
By default this plugin is working with the GD adapter (we have both GD
and ImageMagick). For us everything works fine, but some uploaded
images display a warning: ... gd-jpeg, libjpeg: recoverable erro
Now everything is working like i expected.
To keep the file in {IMAGE}... and delete the file in {APP}... im
using the afterSave callback in my model:
function afterSave() {
if (!empty($this->data[$this->name]['logo'])) {
$baseDir= ROOT .
Hi AD7six,
I was wondering how to auto-delete int add action the file uploaded to
{APP} after the file is converted in {IMAGES}?
Just only to keep the converted file and not the original uploaded
file.
Now i can save my image in a single field. Based in modifications to
allow
using a single fie
After almost 7 days of debuggin is done!
The problem was the fullpath of the convert command, i just
modified by hand the file image_upload.php, in the line 508 i
added the path to convert:
$command = "/usr/local/bin/convert $input $params $output";
My model is:
array(
Im using cakephp 1.2 and the behaviors:
http://trac.assembla.com/cake-base/browser/branches/sample_app/app/models/behaviors/upload.php
http://trac.assembla.com/cake-base/browser/branches/sample_app/app/models/behaviors/image_upload.php
And im trying to upload and save the image without using the
ok im still trying and i think im close:
Im my add action i have:
...
$this->Test->create();
$this->data['Test']['foreign_id'] = '';
$this->data['Test']['dir'] = 'listings';
$this->data['Test']['class']= '/listings';
$this->data['Test']['filename'] = $
Im using ACL and Auth with:
$this->Auth->authorize = 'actions';
My roles are:
Guests
--Contributors
Managers
--Administrators
Is possible to ask for $this->Acl->check in a view?
In a allowed index view Im displaying 3 buttons, how do i display only
1 view to Contributors, Two to Managers
Hi,
Somebody knows how to use and configure at model level the upload
behavior of AD7Six, but without using the attachments table?
http://groups.google.com/group/cake-php/browse_thread/thread/8ac41ad9dfd4bb7d/a1b2160874e5da48
Any help is welcome.
Thanks in advance.
--~--~-~--~~--
Hi AD7Six,
I was seeing your behaviors, they looks very cool and useful. I was
wondering how to use the upload and image_upload behaviors without
using the attachments table.
...can just be a file field in your products table, or a dedicated
'attachments' table...
My field is logo, im using the
I have a habtm association:
Listings <=> Listingcategories
The join table is listingcategories_listing.
>From the Listingcategories controller I get the listings of a given
category id without problem, using the following code:
http://bin.cakephp.org/saved/36634
Now i also need to get the Countr
Thanks to this article:
http://cakebaker.42dh.com/2007/10/17/pagination-of-data-from-a-habtm-relationship/
Form categories controller Im displaying all the Listings name and
description from a given category($current_id)
class CategoriesController extends AppController {
function index($cur
With the following piece of code:
function getJsonStates() {
//Configure::write("debug",0);
$params = array(
'conditions'=> null,
'fields'
Thanks to the kitchen example from:
http://aranworld.com/article/170/cakephp-acl-and-auth-sample-website
Now im having Roles instead of Groups working. Now we can add user to
ARO groups without problems. Few minutes ago i noticed when i delete a
user, it is automatically removed from aros table,
This is my situation, i need to create 6 types or groups of users:
# -- Administrators
# Managers
# -- Moderators
# Publishers
# -- Contributors
# Guests
Where Administrators inherit all manager permissions, managers inherit
all moderators permissions, moder
Cool, your tutorial is very helpful.
I was wondering how to name tables, for example if i have
the following problem, i need to tag posts and to tag user profiles in
different tables, then im confuse how to name tables:
posts
posts_tags
tags
profiles
profiles_???
???
Or can i use something lik
I have the model, controller and views necessary to manage a nested
set model using the tree behavior:
http://bin.cakephp.org/view/1041355028
My table is categories.
Now, i need to manage categories of products, services and events.
Because of that i created the tables:
productcategories
servicec
If i have the next groups table:
DROP TABLE IF EXISTS `bm_groups`;
CREATE TABLE `bm_groups` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(60) DEFAULT NULL,
`parent_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=8;
INSERT INTO `bm_groups` (`id`, `name`, `pare
Thank you.
$cities = $this->City->find('all', array('fields' => array('City.id',
'City.name', 'Country.iso2', 'Country.name'),
'order'=>'City.country_id ASC'));
$citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s',
'{n}.Country.iso2', '{n}.City.name'), '{n}.Country.name');
$th
Im trying to generate a select list, but before the value Citiy.name i
need to add Country.name like:
Costa Rica - Heredia
EEUU - New York
$cities = $this->City->find('all', array('fields' => array('City.id',
'City.name', 'Country.name'), 'order'=>'City.country_id ASC'));
My question is, how ca
Well, im using cake 1.2.x.x_01.01.2008, im using the checkunique
function from tempdocs in the app_model.php and when i edit the data
the unique fields doesn´t let me save the form.
Any help is welcome.
--~--~-~--~~~---~--~~
You received this message because you a
t; andhttps://trac.cakephp.org/ticket/2032
>
> ~GreyCells
>
> On Jan 25, 7:17 pm, Josoroma <[EMAIL PROTECTED]> wrote:
>
> > I started to have problems when i was trying to checkDuplicate entries
> > of fields in my models validations. I used on = create to check the
>
I started to have problems when i was trying to checkDuplicate entries
of fields in my models validations. I used on = create to check the
unique value only in the creation but i need to check it in the update
too. The problem with update is that the value already exist then your
validation sucks.
I have an afterSave function inside a model, my two questions are:
#1 How do i use the database prefix?
#2 Do i need to sanitize $data['User']['username'] and $data['User']
['id']?
Thanks in advance.
function afterSave(){
$data = $this->read();
$this->query('UPDATE `bm_aros` SET `alias` = \'
I know how to create a very simple calendar app that let user to post
events:
title
description
category
start_date
end_date
start_hour
end_hour
repetition(dayly-weekly-monthly-yearly)
location_address
email
telephone
fax
Now i need some cool advice from you about which ot
I was playing with Tree behavior, now i can list, add, edit, delete
and view categories an sub-categories without any problem. My new
challenge is to upload a picture for each categeory in the Tree.
Is possible taht my Category Model can actsAs tree and actsAs upload,
if it is possible how do i d
Hi,
I need to use an index action without paginate, then if add comments
to:
//$this->set('categories', $this->paginate();
I get a lot errors. Then if I use:
$this->set('categories', $this->paginate('Category.id = 0'));
the errors gone.
How i can use an Index Action without paginate?
Thanks
Im very motivated, now im starting to understand the cool Tree
Behabior in Cake. Im going to share some of my code with you (i hope
you contribute and fix what you think needs to be fixed).
I can add and delete categories without problems, im still a newbee,
any advice or comment is welcome.
Dat
Sorry!
To avoid the forbidden message, you need to copy and paste each link
directly in the browser.
--~--~-~--~~~---~--~~
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@goo
Code example:
Inside a edit action like:
function edit($id = null) {
Im calling generatetreelist like:
$this->set('categoriesSelect', $this->Category-
>generatetreelist("Ca
You must to copy and paste the url in the browser:
http://www.sukialogic.com/cakephp/screen_capture/dbdesigner_habtm.png
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group
Hi!
Im stuck trying to undersatnd how to represent hasAndBelongsToMany
using DbDesginer.
--
hasOne
1:1
belongsTo
1:1
hasMany
1:n
HasAndBelongsToMany
¿ ?
--
Is right to use sanitize in controller(index function) or do i have
to clean the array inside some model function, if yes?
How do i send $data array from controller function to model function?
Thanks in advance.
--~--~-~--~~~---~--~~
You received this message beca
Thanks Nate, Maritn,
Just a few questions more:
1. How do i send or use $this->data inside the afterSave
function in Model?
2. Do i have to use:
$this->data['Report']['id'] = $this->Benchlink->getLastInsertId();
Before to save the second model or cakephp can automatically
handle that?
Tha
I clean a little bit the code :)
This works for me, but my question is:
Where do i have toi clean the data for this search, here in the
controller or inside the model?
function index() {
$this->Benchlink->recursive = 0;
uses('sanitize');
Using 1.2
In my index view:
create('formFind', array('url' => 'index'));
echo $form->input('find', array('value' => $findUrlNotCleaned, 'label'
=> 'Buscar', 'type' => 'text'
In my benchlink_controller.php im saving the benchlink model data and
the report model data associated.
function add() {
if (!empty($this->data)) {
$this->cleanUpFields();
$this->Benchlink->create();
Hi,
I almost know how to manage a Hierarchical Data using Joomla. But now
i want to start a Listing Directory project using cakePHP. I was
wondering based on:
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
AND
http://cakeforge.org/snippet/detail.php?type=snippet&id=26
if th
Now reading:
http://www.xaprb.com/blog/2006/08/16/how-to-build-role-based-access-control-in-sql/
http://www.xaprb.com/blog/2006/08/18/role-based-access-control-in-sql-part-2/
Will be great to create together the models, controllers and views to
create an admin part first to create groups, actions
Thanks scragz.
-
My ARO model change a little bit:
-
[1]Frontend
[6]Members
[2]Backend
[3]Moderators
[4]Managers
[5]Administrators
-
I was wondering how to create parent groups or child groups using
acl.php script, for example, i just used "php acl.php initdb" and
every table was created well. Then i used:
php acl.php create aro 0 null Users
php acl.php create aro 0 null Members
and those groups were created without proble
I was learning cake with the IBM tutorials, and everything is working
nice, is a piece of art, a piece of cake.
My question, what can i have to add an use in: model, controller and
view to add a select of Country in a user table? Cuz, a user can edit
the information later, how to show the country
43 matches
Mail list logo