Re: CakePHP Cache Help Needed

2012-04-21 Thread stork
- rewrite this component as a helper
- use cached element 
http://book.cakephp.org/2.0/en/views.html#caching-elements
- done

If you want to keep your code as a component, use beforeRender() callback 
instead of beforeFilter(), example:

# app/Config/bootstrap.php
Cache::config('short', array(

'duration' => '+15 minutes'
));

class AppController extends Controller {

public function beforeRender() {
$wordpress_posts = Cache::read('wordpress_posts', 'short');
if (empty($wordpress_posts)) {
$wordpress_posts = 
$this->Components->load('Wordpress')->getPosts();
Cache::write('wordpress_posts', $wordpress_posts, 'short');
}
$this->set('wordpress_posts', $wordpress_posts);
   }
}

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


CakePHP Cache Help Needed

2012-04-20 Thread creat1v1ty
Does anyone have experience with Cake cache who's willing to lend me a hand?

Here is my situation:

In the footer of my website I am pulling in my 3 most recent blog posts 
from Wordpress.com (the website, not a local installation). The way I am 
accomplishing this is by parsing the XML feed from WP. I've created a 
component to do this:

===

App::uses('Component', 'Controller');
App::uses('Xml', 'Utility'); 

class WordpressComponent extends Component {

public $wp_feed = 'http://blog.mydomain.com/feed/';

public $numberOfItems = 3;

public function getPosts() {
// Parse XML from Wordpress Blog
$xml = Xml::build($this->wp_feed);
$parsed_xml = Set::reverse($xml);
$blog_posts = $parsed_xml['rss']['channel']['item'];

// Build simplified array of post title and link
$result = array();
$counter = 0;
foreach ($blog_posts as $post) {
$tmp = array();
$tmp['title'] = $post['title'];
$tmp['link'] = $post['link'];
$tmp['pubDate'] = date("F d, Y", strtotime($post['pubDate']));
array_push($result, $tmp);
$counter++;
if ($counter >= $this->numberOfItems) {
break;
}
}
return $result;
}

}

===

Then, since I need the posts to show up on all my pages, I've done the 
following in my AppController:

===

class AppController extends Controller {

public $components = array('Session', 'Wordpress');

public function beforeFilter() {
$wordpress_posts = $this->Wordpress->getPosts();
$this->set('wordpress_posts', $wordpress_posts);
}

}

===

In am then displaying the results in the footer of my layout file.

The problem is that it's taking a noticeable amount of time to parse the 
XML and relay the posts to my layout. I'm assuming this is because it's 
doing the same thing on every page.

What I would like to know is how I can cache the posts so that I'm not 
having to parse the XML for every page load. Unfortunately, however, I 
don't have any experience working with cache - will someone please help me 
come up with a solution?

Thanks in advance.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Help needed for developing ACL

2012-02-24 Thread Allan Douglas
use the cookbook official of cakephp, there all what do you need

2012/2/24 konda :
> I am new to cakePHP. Please give me guidelines or your suggestions to
> create and work with ACL.
>
> Below is my requirement.
>
> 1. Registered user
> 2. Moderator
> 3. Supervisor
> 4. Admin
>
> Here admin or supervisor will assign permissions to moderator or
> registered user.
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> 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



-- 
Fraternalmente
Allan Douglas de A. Silva
Desenvolvedor de Sistemas
Técnico em Informatica - Escola Técnica Redentorista.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Help needed for developing ACL

2012-02-24 Thread konda
I am new to cakePHP. Please give me guidelines or your suggestions to
create and work with ACL.

Below is my requirement.

1. Registered user
2. Moderator
3. Supervisor
4. Admin

Here admin or supervisor will assign permissions to moderator or
registered user.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Help needed with Warning (512): SQL Error: 1066

2011-03-18 Thread cricket
On Wed, Mar 16, 2011 at 10:23 PM, samjoe  wrote:
> Hi,
>
> I am upgrading from CakePhp1.1 to Cakephp 1.2 When I try to load up my
> page, I get the following error.
>
> Warning (512): SQL Error: 1066: Not unique table/alias:
> 'ShoppingCart' [CORE/cake/libs/model/datasources/dbo_source.php, line
> 514]
>
> Now below is the line that generates the error in the
> shopping_carts_controller.php controller file.
>
> **
>
> $this->ShoppingCart->unbindModel(array('belongsTo'=>array('User')));**
>
> Below are the definitions of the models that get used through
> association
>
> user.php:
>
> 
> class User extends AppModel
>
> {
>
> var $name = 'User';for php4 firstname'=>'/[a-z0-9 _-]{3,}$/i',
>
> var $hasMany = 'Purchase';
>
> var $belongsTo = array('Country', 'State', 'PaymentMethod' ,
> 'ShippingMethod');
>
> }
>
> ?>
> ===
> shopping_cart.php
>
> 
> class ShoppingCart extends AppModel
>
> {
>
> var $name = 'ShoppingCart';
>
> var $belongsTo = array('User');
>
> var $hasMany = array('ShoppingCartProduct' =>
>
> array('className' => 'ShoppingCartProduct',
>
> 'dependent' => true));
>
> }
>
> ?>
> =
> shopping_cart_product.php
>
> 
> class ShoppingCartProduct extends AppModel
>
> {
>
> var $name = 'ShoppingCartProduct';
>
> var $belongsTo = array('ShoppingCart', 'Product', 'Subproduct');
>
> }
>
> ?>
>
> Now when I check the sql generated, I see something unusual which has
> driven me crazy.
>
> The SQL it generates is below. I have removed unnecessary fields in
> SQL to make the post smaller.
>
>
>
> SELECT ShoppingCart.id,
>
> ...,
>
> ShoppingCart.offer_id, ShoppingCart.subscription_id,
>
> ShoppingCart.persistent, ShoppingCart.decoration_id,
>
> ShoppingCart.coupon_code, ShoppingCart.coupon_price,
>
> Product.id, Product.active, Product.name,
>
> Product.description, Product.price, Product.quantity,
>
> Product.weight, Product.lead_time, Product.featured,
>
> ..
>
> Product.user_design_id, Product.size_chart,
>
> Product.min_quantity, Product.allow_customization,
>
> Product.gender, Subproduct.id, Subproduct.product_id,
>
> Subproduct.name, Subproduct.price, Subproduct.weight,
>
> Subproduct.quantity, Subproduct.sort, Subproduct.created,
>
> Subproduct.modified, Subproduct.reorder_level,
>
> Subproduct.reorder_quantity, Subproduct.po_comments,
>
> Subproduct.reorder_date, Subproduct.product_code FROM
>
> shopping_cart_products AS **ShoppingCart** LEFT JOIN
>
> shopping_cart_products AS **ShoppingCart** ON
>
> (ShoppingCart.shopping_cart_id = ShoppingCart.id) LEFT JOIN
>
> products AS Product ON (ShoppingCart.product_id =
>
> Product.id) LEFT JOIN subproducts AS Subproduct ON
>
> (ShoppingCart.subproduct_id = Subproduct.id) WHERE
>
> ShoppingCart.session = 68900733 LIMIT 1
>
>
>
> Question: Why is the ALIAS of the table shopping_cart_products coming
> up as ShoppingCart???

It looks like you missed some of the User definition. Does User hasOne
ShoppingCart?

What's the purpose of ShoppingCartProduct? Is that a join model? If
that's the case, it should be ProductsShoppingCarts. Are you sure you
need to modelize it? And why are you unbinding User from ShoppingCart?

Also, I think Country & State should be in User's $hasOne array. Ditto
PaymentMethod & ShippingMethod, unless you want to allow Users to have
more than one each, in which case they should be in $hasMany.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Help needed with Warning (512): SQL Error: 1066

2011-03-17 Thread samjoe
Bump. 

Guys !! I really need help with this. Any help is greatly appreciated.

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Help-needed-with-Warning-512-SQL-Error-1066-tp3881729p3898998.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Help needed with Warning (512): SQL Error: 1066

2011-03-17 Thread samjoe
Hi,

I am upgrading from CakePhp1.1 to Cakephp 1.2 When I try to load up my
page, I get the following error.

Warning (512): SQL Error: 1066: Not unique table/alias:
'ShoppingCart' [CORE/cake/libs/model/datasources/dbo_source.php, line
514]

Now below is the line that generates the error in the
shopping_carts_controller.php controller file.

**

$this->ShoppingCart->unbindModel(array('belongsTo'=>array('User')));**

Below are the definitions of the models that get used through
association

user.php:

'/[a-z0-9 _-]{3,}$/i',

var $hasMany = 'Purchase';

var $belongsTo = array('Country', 'State', 'PaymentMethod' ,
'ShippingMethod');

}

?>
===
shopping_cart.php



array('className' => 'ShoppingCartProduct',

'dependent' => true));

}

?>
=
shopping_cart_product.php



Now when I check the sql generated, I see something unusual which has
driven me crazy.

The SQL it generates is below. I have removed unnecessary fields in
SQL to make the post smaller.



SELECT ShoppingCart.id,

...,

ShoppingCart.offer_id, ShoppingCart.subscription_id,

ShoppingCart.persistent, ShoppingCart.decoration_id,

ShoppingCart.coupon_code, ShoppingCart.coupon_price,

Product.id, Product.active, Product.name,

Product.description, Product.price, Product.quantity,

Product.weight, Product.lead_time, Product.featured,

..

Product.user_design_id, Product.size_chart,

Product.min_quantity, Product.allow_customization,

Product.gender, Subproduct.id, Subproduct.product_id,

Subproduct.name, Subproduct.price, Subproduct.weight,

Subproduct.quantity, Subproduct.sort, Subproduct.created,

Subproduct.modified, Subproduct.reorder_level,

Subproduct.reorder_quantity, Subproduct.po_comments,

Subproduct.reorder_date, Subproduct.product_code FROM

shopping_cart_products AS **ShoppingCart** LEFT JOIN

shopping_cart_products AS **ShoppingCart** ON

(ShoppingCart.shopping_cart_id = ShoppingCart.id) LEFT JOIN

products AS Product ON (ShoppingCart.product_id =

Product.id) LEFT JOIN subproducts AS Subproduct ON

(ShoppingCart.subproduct_id = Subproduct.id) WHERE

ShoppingCart.session = 68900733 LIMIT 1



Question: Why is the ALIAS of the table shopping_cart_products coming
up as ShoppingCart???

Any ideas?

Any help with this greatly appreciated.

-Samjoe

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Fck editor in cake php... Help needed

2011-01-06 Thread Alex Ciobanu

On 1/6/2011 3:16 PM, Test_deepak wrote:
I cannot add fck editor to cake php. while i am adding to it some 
warning messages are given in my page. please help me.

Here you go!
http://goo.gl/840jo

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: Fck editor in cake php... Help needed

2011-01-06 Thread cricket
On Thu, Jan 6, 2011 at 8:16 AM, Test_deepak  wrote:
> I cannot add fck editor to cake php. while i am adding to it some warning
> messages are given in my page. please help me.

You'll get help quicker if you bother to inform us what the warnings say.

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


Fck editor in cake php... Help needed

2011-01-06 Thread Test_deepak
I cannot add fck editor to cake php. while i am adding to it some warning
messages are given in my page. please help me.

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


Using git to clone I'm so confused.. Help needed here... thanks.

2011-01-02 Thread John Maxim
Hi people,

git clone git://github.com/CakeDC/tags.git plugins/tags

Hi if choose to download instead of doing the tedious work above, I'm
windows user, is it equally accomplished?

Regards,
Maxim

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2011-01-01 Thread John Maxim
..Thanks Jeremy and everyone who contributed here.

Regards,
Maxim

On Jan 1, 2:47 pm, Jeremy Burns | Class Outfit
 wrote:
> I think what AD was saying is that the primary purpose of a UUID *when 
> compared with an integer* is that it is globally unique across all servers, 
> not just 'this' server, which of course I forgot to point out in my original 
> reply. This means you have a choice of data type when creating a primary key, 
> both of which have pros/cons. However, it is still a primary key, which has 
> the primary purpose of ensuring data/model integrity.
>
> As far as coding data saves, 
> seehttp://book.cakephp.org/view/75/Saving-Your-Datafor full details.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 31 Dec 2010, at 17:09, John Maxim wrote:
>
> > So normally we don't use char(36) ? and its primary purpose is not for
> > data /model integrity .. if I hear you right, AD.
>
> > Is the Model::save method the way we usually save by calling
>
> > function add()
> > {
> > }
>
> > are there additional steps ?
>
> > thanks, best regards.
> > Maxim
>
> > On Dec 29 2010, 7:29 am, AD7six  wrote:
> >> On Dec 28, 3:55 am, John Maxim  wrote:
>
> >>> Hi Jeremy, Thanks for your link will definitely look into that.
>
> >>> ~~Continue my question~~
> >>> I was going to ask about using 
> >>> this:http://book.cakephp.org/view/1027/query
>
> >>> There are 2 options if I'm correct based on cookbook 1.3
> >>> ~~
> >>> Rather than using an auto-increment key as the primary key, you may
> >>> also use char(36). Cake will then use a unique 36 character uuid
> >>> (String::uuid) whenever you save a new record using the Model::save
> >>> method.
>
> >>> according 
> >>> to:http://book.cakephp.org/view/903/Model-and-Database-Conventions
> >>> ~~
> >>> What's the advantage of using char(36) ?
>
> >> A uuid (a 36 char string) is unique - always. It's main purpose is to
> >> be unique, nothing else. Obfuscation is a side effect, not the goal.
>
> >> They are most relevant with distributed datastores whereby you need to
> >> synchronize data and inserts across multiple servers. An insert on
> >> server A can safely and without concern be replicated to server B
> >> because a row with the same ID cannot exist originating from another
> >> server.
>
> >>http://en.wikipedia.org/wiki/Universally_unique_identifier
>
> >> AD
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
> > athttp://groups.google.com/group/cake-php?hl=en

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-31 Thread Jeremy Burns | Class Outfit
I think what AD was saying is that the primary purpose of a UUID *when compared 
with an integer* is that it is globally unique across all servers, not just 
'this' server, which of course I forgot to point out in my original reply. This 
means you have a choice of data type when creating a primary key, both of which 
have pros/cons. However, it is still a primary key, which has the primary 
purpose of ensuring data/model integrity.

As far as coding data saves, see 
http://book.cakephp.org/view/75/Saving-Your-Data for full details.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 31 Dec 2010, at 17:09, John Maxim wrote:

> So normally we don't use char(36) ? and its primary purpose is not for
> data /model integrity .. if I hear you right, AD.
> 
> Is the Model::save method the way we usually save by calling
> 
> function add()
> {
> }
> 
> are there additional steps ?
> 
> thanks, best regards.
> Maxim
> 
> 
> On Dec 29 2010, 7:29 am, AD7six  wrote:
>> On Dec 28, 3:55 am, John Maxim  wrote:
>> 
>>> Hi Jeremy, Thanks for your link will definitely look into that.
>> 
>>> ~~Continue my question~~
>>> I was going to ask about using this:http://book.cakephp.org/view/1027/query
>> 
>>> There are 2 options if I'm correct based on cookbook 1.3
>>> ~~
>>> Rather than using an auto-increment key as the primary key, you may
>>> also use char(36). Cake will then use a unique 36 character uuid
>>> (String::uuid) whenever you save a new record using the Model::save
>>> method.
>> 
>>> according to:http://book.cakephp.org/view/903/Model-and-Database-Conventions
>>> ~~
>>> What's the advantage of using char(36) ?
>> 
>> A uuid (a 36 char string) is unique - always. It's main purpose is to
>> be unique, nothing else. Obfuscation is a side effect, not the goal.
>> 
>> They are most relevant with distributed datastores whereby you need to
>> synchronize data and inserts across multiple servers. An insert on
>> server A can safely and without concern be replicated to server B
>> because a row with the same ID cannot exist originating from another
>> server.
>> 
>> http://en.wikipedia.org/wiki/Universally_unique_identifier
>> 
>> AD
> 
> 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

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-31 Thread John Maxim
So normally we don't use char(36) ? and its primary purpose is not for
data /model integrity .. if I hear you right, AD.

Is the Model::save method the way we usually save by calling

function add()
{
}

are there additional steps ?

thanks, best regards.
Maxim


On Dec 29 2010, 7:29 am, AD7six  wrote:
> On Dec 28, 3:55 am, John Maxim  wrote:
>
> > Hi Jeremy, Thanks for your link will definitely look into that.
>
> > ~~Continue my question~~
> > I was going to ask about using this:http://book.cakephp.org/view/1027/query
>
> > There are 2 options if I'm correct based on cookbook 1.3
> > ~~
> > Rather than using an auto-increment key as the primary key, you may
> > also use char(36). Cake will then use a unique 36 character uuid
> > (String::uuid) whenever you save a new record using the Model::save
> > method.
>
> > according to:http://book.cakephp.org/view/903/Model-and-Database-Conventions
> > ~~
> > What's the advantage of using char(36) ?
>
> A uuid (a 36 char string) is unique - always. It's main purpose is to
> be unique, nothing else. Obfuscation is a side effect, not the goal.
>
> They are most relevant with distributed datastores whereby you need to
> synchronize data and inserts across multiple servers. An insert on
> server A can safely and without concern be replicated to server B
> because a row with the same ID cannot exist originating from another
> server.
>
> http://en.wikipedia.org/wiki/Universally_unique_identifier
>
> AD

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: URGENT - Help needed - Model Association

2010-12-31 Thread Karthikeyan P
Thanks @cricket and @John

@John I generated the code and then added the relationships manually .
Tried all from scratch ..and now it associates well and correctly :)

@Cricket will try both now

Thanks for the help

Karthik

On Fri, Dec 31, 2010 at 4:15 AM, John L  wrote:

> Since we both trust the generated code why don't you do the associations
> using the bake command also? Much simpler.
>
> I only mention the incorrect names as these were the names indicated in the
> first message. It matters.
>
>
> On Thu, Dec 30, 2010 at 12:03 AM, Karthikeyan P 
> wrote:
>
>> John
>>
>>   I think the class name conventions are correct as the code is a
>> generated one ..I didn't write the code.It was generated by "cake bake"
>> command .
>>
>>
>> *" Model 'Comment' has a 'comments' table, not a 'Comments'
>> table. "*
>>
>> I have not defined anywhere as *Comments* Table..I have done as *comments
>> * only
>>
>> I guess the problem is in the relationship type during the model
>> association ? Not sure though
>>
>> Thanks
>> Karthikeyan P
>>
>>
>> On Thu, Dec 30, 2010 at 4:08 AM, john lyles wrote:
>>
>>> If the model names are Post and User then the table names should be
>>> 'posts' and 'users' lowercased. The field name is 'user_id' not
>>> 'UserId'. Model 'Comment' has a 'comments' table, not a 'Comments'
>>> table. You have to respect CakePHP's File and Classname conventions,
>>> see section 2.4.1 in the manual.
>>>
>>> On Dec 29, 11:19 am, pinastro  wrote:
>>> > I have created a Blog Application using a base table as 'Posts'. Later
>>> > Model-Associated with another table 'Users' with 'belongsTo'
>>> > relationship like below in the MODEL
>>> >
>>> > var $belongsTo = array(
>>> > 'User' => array(
>>> > 'className' => 'User',
>>> > 'foreignKey' => 'user_id',
>>> > 'conditions' => '',
>>> > 'fields' => '',
>>> > 'order' => ''
>>> > )
>>> > );
>>> >
>>> > But still I am not able to store the UserId in the Posts Table ???
>>> > What's the Problem
>>> >
>>> > Plus what does the following lines of code mean :: I saw the
>>> > comments_controller.php which got generated using the BAKE command
>>> > when MODEL ASSOCIATED the 'Posts' table with the 'Comments' Table :
>>> >
>>> > $posts = $this->Comment->Post->find('list');
>>> > $this->set(compact('posts'));
>>> >
>>> > If not above ; is there anyway I can store the UserId in the Posts
>>> > Table using Model Associated cakePHP application ?
>>>
>>> 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.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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: URGENT - Help needed - Model Association

2010-12-30 Thread John L
Since we both trust the generated code why don't you do the associations
using the bake command also? Much simpler.

I only mention the incorrect names as these were the names indicated in the
first message. It matters.


On Thu, Dec 30, 2010 at 12:03 AM, Karthikeyan P wrote:

> John
>
>   I think the class name conventions are correct as the code is a generated
> one ..I didn't write the code.It was generated by "cake bake" command .
>
>
> *" Model 'Comment' has a 'comments' table, not a 'Comments'
> table. "*
>
> I have not defined anywhere as *Comments* Table..I have done as *comments*only
>
> I guess the problem is in the relationship type during the model
> association ? Not sure though
>
> Thanks
> Karthikeyan P
>
>
> On Thu, Dec 30, 2010 at 4:08 AM, john lyles wrote:
>
>> If the model names are Post and User then the table names should be
>> 'posts' and 'users' lowercased. The field name is 'user_id' not
>> 'UserId'. Model 'Comment' has a 'comments' table, not a 'Comments'
>> table. You have to respect CakePHP's File and Classname conventions,
>> see section 2.4.1 in the manual.
>>
>> On Dec 29, 11:19 am, pinastro  wrote:
>> > I have created a Blog Application using a base table as 'Posts'. Later
>> > Model-Associated with another table 'Users' with 'belongsTo'
>> > relationship like below in the MODEL
>> >
>> > var $belongsTo = array(
>> > 'User' => array(
>> > 'className' => 'User',
>> > 'foreignKey' => 'user_id',
>> > 'conditions' => '',
>> > 'fields' => '',
>> > 'order' => ''
>> > )
>> > );
>> >
>> > But still I am not able to store the UserId in the Posts Table ???
>> > What's the Problem
>> >
>> > Plus what does the following lines of code mean :: I saw the
>> > comments_controller.php which got generated using the BAKE command
>> > when MODEL ASSOCIATED the 'Posts' table with the 'Comments' Table :
>> >
>> > $posts = $this->Comment->Post->find('list');
>> > $this->set(compact('posts'));
>> >
>> > If not above ; is there anyway I can store the UserId in the Posts
>> > Table using Model Associated cakePHP application ?
>>
>> 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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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: URGENT - Help needed - Model Association

2010-12-30 Thread cricket
How are you including $user_id? There are more than one approache you can take:

echo $this->Form->hidden('Post.user_id', array('value' =>
$this->Session->read('Auth.User.id')));

Or you can add it to the submitted data inside the controller:

if (!empty($this->data))
{
$this->data['Post']['user_id'] = $this->Auth->user('id');

On Thu, Dec 30, 2010 at 12:03 AM, Karthikeyan P  wrote:
> John
>
>   I think the class name conventions are correct as the code is a generated
> one ..I didn't write the code.It was generated by "cake bake" command .
>
> " Model 'Comment' has a 'comments' table, not a 'Comments'
> table. "
>
> I have not defined anywhere as Comments Table..I have done as comments only
>
> I guess the problem is in the relationship type during the model association
> ? Not sure though
>
> Thanks
> Karthikeyan P
>
> On Thu, Dec 30, 2010 at 4:08 AM, john lyles 
> wrote:
>>
>> If the model names are Post and User then the table names should be
>> 'posts' and 'users' lowercased. The field name is 'user_id' not
>> 'UserId'. Model 'Comment' has a 'comments' table, not a 'Comments'
>> table. You have to respect CakePHP's File and Classname conventions,
>> see section 2.4.1 in the manual.
>>
>> On Dec 29, 11:19 am, pinastro  wrote:
>> > I have created a Blog Application using a base table as 'Posts'. Later
>> > Model-Associated with another table 'Users' with 'belongsTo'
>> > relationship like below in the MODEL
>> >
>> > var $belongsTo = array(
>> > 'User' => array(
>> > 'className' => 'User',
>> > 'foreignKey' => 'user_id',
>> > 'conditions' => '',
>> > 'fields' => '',
>> > 'order' => ''
>> > )
>> > );
>> >
>> > But still I am not able to store the UserId in the Posts Table ???
>> > What's the Problem
>> >
>> > Plus what does the following lines of code mean :: I saw the
>> > comments_controller.php which got generated using the BAKE command
>> > when MODEL ASSOCIATED the 'Posts' table with the 'Comments' Table :
>> >
>> > $posts = $this->Comment->Post->find('list');
>> > $this->set(compact('posts'));
>> >
>> > If not above ; is there anyway I can store the UserId in the Posts
>> > Table using Model Associated cakePHP application ?
>>
>> 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
>
> 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
>

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: URGENT - Help needed - Model Association

2010-12-29 Thread Karthikeyan P
John

  I think the class name conventions are correct as the code is a generated
one ..I didn't write the code.It was generated by "cake bake" command .

*" Model 'Comment' has a 'comments' table, not a 'Comments'
table. "*

I have not defined anywhere as *Comments* Table..I have done as *comments*only

I guess the problem is in the relationship type during the model association
? Not sure though

Thanks
Karthikeyan P

On Thu, Dec 30, 2010 at 4:08 AM, john lyles wrote:

> If the model names are Post and User then the table names should be
> 'posts' and 'users' lowercased. The field name is 'user_id' not
> 'UserId'. Model 'Comment' has a 'comments' table, not a 'Comments'
> table. You have to respect CakePHP's File and Classname conventions,
> see section 2.4.1 in the manual.
>
> On Dec 29, 11:19 am, pinastro  wrote:
> > I have created a Blog Application using a base table as 'Posts'. Later
> > Model-Associated with another table 'Users' with 'belongsTo'
> > relationship like below in the MODEL
> >
> > var $belongsTo = array(
> > 'User' => array(
> > 'className' => 'User',
> > 'foreignKey' => 'user_id',
> > 'conditions' => '',
> > 'fields' => '',
> > 'order' => ''
> > )
> > );
> >
> > But still I am not able to store the UserId in the Posts Table ???
> > What's the Problem
> >
> > Plus what does the following lines of code mean :: I saw the
> > comments_controller.php which got generated using the BAKE command
> > when MODEL ASSOCIATED the 'Posts' table with the 'Comments' Table :
> >
> > $posts = $this->Comment->Post->find('list');
> > $this->set(compact('posts'));
> >
> > If not above ; is there anyway I can store the UserId in the Posts
> > Table using Model Associated cakePHP application ?
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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: URGENT - Help needed - Model Association

2010-12-29 Thread john lyles
If the model names are Post and User then the table names should be
'posts' and 'users' lowercased. The field name is 'user_id' not
'UserId'. Model 'Comment' has a 'comments' table, not a 'Comments'
table. You have to respect CakePHP's File and Classname conventions,
see section 2.4.1 in the manual.

On Dec 29, 11:19 am, pinastro  wrote:
> I have created a Blog Application using a base table as 'Posts'. Later
> Model-Associated with another table 'Users' with 'belongsTo'
> relationship like below in the MODEL
>
> var $belongsTo = array(
> 'User' => array(
> 'className' => 'User',
> 'foreignKey' => 'user_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => ''
> )
> );
>
> But still I am not able to store the UserId in the Posts Table ???
> What's the Problem
>
> Plus what does the following lines of code mean :: I saw the
> comments_controller.php which got generated using the BAKE command
> when MODEL ASSOCIATED the 'Posts' table with the 'Comments' Table :
>
> $posts = $this->Comment->Post->find('list');
> $this->set(compact('posts'));
>
> If not above ; is there anyway I can store the UserId in the Posts
> Table using Model Associated cakePHP application ?

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


URGENT - Help needed - Model Association

2010-12-29 Thread pinastro
I have created a Blog Application using a base table as 'Posts'. Later
Model-Associated with another table 'Users' with 'belongsTo'
relationship like below in the MODEL

var $belongsTo = array(
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

But still I am not able to store the UserId in the Posts Table ???
What's the Problem

Plus what does the following lines of code mean :: I saw the
comments_controller.php which got generated using the BAKE command
when MODEL ASSOCIATED the 'Posts' table with the 'Comments' Table :

$posts = $this->Comment->Post->find('list');
$this->set(compact('posts'));


If not above ; is there anyway I can store the UserId in the Posts
Table using Model Associated cakePHP application ?

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 NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Thanks Sam, that youtube tutorial helped. I'm continuing with the link
you sent earlier, right after finishing the cookbook soon..hopefully.

Regards,
Maxim

On Dec 29, 10:07 pm, Sam Sherlock  wrote:
> setting cake for commandline is easy - don't be put off
>
> it take minutes
>
> windows or *nix (these require quicktime - I 
> think)http://cakephp.org/screencasts
>
> or (windows setup on 
> youtube)http://www.youtube.com/watch?v=21Rt9HgITig&feature=related
>
> you won't regret setting this up - it opens so many new options :)
>
>  - S
>
> On 29 December 2010 13:46, John Maxim  wrote:
>
> > Hi Sam,
>
> > I tried quite a number of times logging in IRC on cake but there were
> > always connection failure or something..given up and use googlegroup
> > as of now..
>
> > I can't carry on with the link you recommended; it asks me to be
> > familiar with console, I'm not, I don't know what/how exactly to begin
> > with the console, going through the cookbook simultaneously.. I'm
> > aging.
>
> > > see the buildAcl function in the tutorial
>
> > do you mean from cookbook?, yes, I'm viewing it now..
>
> > What's the secret to log in to IRC cake ? something I'm missing ..
>
> > Thanks for the explanation I thought Acl and Bake is one thing.
>
> > Regards,
> > Maxim
>
> > On Dec 29, 9:36 pm, Sam Sherlock  wrote:
> > > you'll find that ACL is a heavy task.
>
> > > setting up a dummy application (own db files etc) -- deleting and
> > > reinstating things over  and over will make things clearer
>
> > > trail and error extremely useful when learning ACL.  if you back up the
> > db
> > > in between and compare what differences after doing things
>
> > > bake creates models, controllers & views (you can scaffold but I don't --
> > or
> > > have'nt found it useful to me personally)
> > > bake is not ACL - both ACL and bake have commandline access in cake
>
> > > your on the right track by the souds of what your doing.
>
> > > being prepared to redo various tutorials will really help you out;
> > > The cookbook tutorial is good - but Marks end to end really hammered it
> > home
> > > for me
>
> > > see the buildAcl function in the tutorial
>
> > > there are an awful lot of different terms involved with ACL and
> > variations
> > > on setup to -
> > > auth is easy to set up ACL not so much (at all); also lots of tla's
> > (three
> > > letter acronyms :)
> > > and this can be overwhelming)
>
> > > stick with it - and keep pens and paper handy = coffee or whatever your
> > > choice beverage in plentiful supply
>
> > > also if you use IRC you'll find lots of helpful people there
>
> > >  - S
>
> > > On 29 December 2010 13:09, John Maxim  wrote:
>
> > > > Thanks Sam, it's clearer now...but still struggling with Acl; I was
> > > > confused when I hear the word "populate" a general term. In oracle, I
> > > > populated db/tables/sql scripts in a batch file, last time. So it
> > > > brought me a meaning of the same when I hear it again. Now I know it
> > > > could mean using command line and here it's Bake. But I created the
> > > > tables already, is there a measurement to check if the tables are
> > > > correctly "populated" ? I may have to drop the 3 tables I created
> > > > earlier..and re-do starting from tutorial Acl(cookbook tutorial)
> > > > again/ the link you've sent to me. Will check on it, now.
>
> > > > Regards,
>
> > > > Maxim
>
> > > > On Dec 29, 8:53 pm, Sam Sherlock  wrote:
> > > > > Hi John,
>
> > > > > you want to setup cake so you can use it from commandline
>
> > > > > bake is one part of cakes commandline
>
> > > > > also acl too: (output from commandline)
>
> > > > > $ cake acl
> > > > > Available ACL commands:
> > > > >          - create
> > > > >          - delete
> > > > >          - setParent
> > > > >          - getPath
> > > > >          - check
> > > > >          - grant
> > > > >          - deny
> > > > >          - inherit
> > > > >          - view
> > > > >          - initdb
> > > > >          - help
>
> > > > > so `cake acl initdb` would setup the db structure which you
> > previously
> > > > > posted
>
> > > > > you don't have to, setup cake to run from commandline, but it is an
> > > > > advantage if you do
>
> > > > > also checkout the ACL tutorial by Mark Story (end to end acl parts 1
> > &
> > > > 2);
> > > > > it covers
> > > > > populating the tables and setting up controllers models etc - its the
> > > > least
> > > > > confusing acl tutorial out there :)
>
> > > > > additionally acl_extras a shell plugin is truly useful (also by Mark
> > > > Story)
>
> > > > > hth  - S
>
> > > > > On 29 December 2010 10:42, John Maxim  wrote:
>
> > > > > > Is Bake continued from scaffolding ? can I jump straight to learn
> > > > > > Bake ?
>
> > > > > > Must we use Bake to populate the Acl tables ?
>
> > > > > > Regards,
> > > > > > Maxim
>
> > > > > > On Dec 29, 6:12 pm, Amit Badkas  wrote:
> > > > > > > Hi,
>
> > > > > > > My question was 'are the ACL tables (aros, acos and aros_acos)
> > > > populated
> >

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Sam Sherlock
setting cake for commandline is easy - don't be put off

it take minutes

windows or *nix (these require quicktime - I think)
http://cakephp.org/screencasts

or (windows setup on youtube)
http://www.youtube.com/watch?v=21Rt9HgITig&feature=related

you won't regret setting this up - it opens so many new options :)

 - S




On 29 December 2010 13:46, John Maxim  wrote:

> Hi Sam,
>
> I tried quite a number of times logging in IRC on cake but there were
> always connection failure or something..given up and use googlegroup
> as of now..
>
> I can't carry on with the link you recommended; it asks me to be
> familiar with console, I'm not, I don't know what/how exactly to begin
> with the console, going through the cookbook simultaneously.. I'm
> aging.
>
> > see the buildAcl function in the tutorial
>
> do you mean from cookbook?, yes, I'm viewing it now..
>
> What's the secret to log in to IRC cake ? something I'm missing ..
>
> Thanks for the explanation I thought Acl and Bake is one thing.
>
> Regards,
> Maxim
>
>
> On Dec 29, 9:36 pm, Sam Sherlock  wrote:
> > you'll find that ACL is a heavy task.
> >
> > setting up a dummy application (own db files etc) -- deleting and
> > reinstating things over  and over will make things clearer
> >
> > trail and error extremely useful when learning ACL.  if you back up the
> db
> > in between and compare what differences after doing things
> >
> > bake creates models, controllers & views (you can scaffold but I don't --
> or
> > have'nt found it useful to me personally)
> > bake is not ACL - both ACL and bake have commandline access in cake
> >
> > your on the right track by the souds of what your doing.
> >
> > being prepared to redo various tutorials will really help you out;
> > The cookbook tutorial is good - but Marks end to end really hammered it
> home
> > for me
> >
> > see the buildAcl function in the tutorial
> >
> > there are an awful lot of different terms involved with ACL and
> variations
> > on setup to -
> > auth is easy to set up ACL not so much (at all); also lots of tla's
> (three
> > letter acronyms :)
> > and this can be overwhelming)
> >
> > stick with it - and keep pens and paper handy = coffee or whatever your
> > choice beverage in plentiful supply
> >
> > also if you use IRC you'll find lots of helpful people there
> >
> >  - S
> >
> > On 29 December 2010 13:09, John Maxim  wrote:
> >
> > > Thanks Sam, it's clearer now...but still struggling with Acl; I was
> > > confused when I hear the word "populate" a general term. In oracle, I
> > > populated db/tables/sql scripts in a batch file, last time. So it
> > > brought me a meaning of the same when I hear it again. Now I know it
> > > could mean using command line and here it's Bake. But I created the
> > > tables already, is there a measurement to check if the tables are
> > > correctly "populated" ? I may have to drop the 3 tables I created
> > > earlier..and re-do starting from tutorial Acl(cookbook tutorial)
> > > again/ the link you've sent to me. Will check on it, now.
> >
> > > Regards,
> >
> > > Maxim
> >
> > > On Dec 29, 8:53 pm, Sam Sherlock  wrote:
> > > > Hi John,
> >
> > > > you want to setup cake so you can use it from commandline
> >
> > > > bake is one part of cakes commandline
> >
> > > > also acl too: (output from commandline)
> >
> > > > $ cake acl
> > > > Available ACL commands:
> > > >  - create
> > > >  - delete
> > > >  - setParent
> > > >  - getPath
> > > >  - check
> > > >  - grant
> > > >  - deny
> > > >  - inherit
> > > >  - view
> > > >  - initdb
> > > >  - help
> >
> > > > so `cake acl initdb` would setup the db structure which you
> previously
> > > > posted
> >
> > > > you don't have to, setup cake to run from commandline, but it is an
> > > > advantage if you do
> >
> > > > also checkout the ACL tutorial by Mark Story (end to end acl parts 1
> &
> > > 2);
> > > > it covers
> > > > populating the tables and setting up controllers models etc - its the
> > > least
> > > > confusing acl tutorial out there :)
> >
> > > > additionally acl_extras a shell plugin is truly useful (also by Mark
> > > Story)
> >
> > > > hth  - S
> >
> > > > On 29 December 2010 10:42, John Maxim  wrote:
> >
> > > > > Is Bake continued from scaffolding ? can I jump straight to learn
> > > > > Bake ?
> >
> > > > > Must we use Bake to populate the Acl tables ?
> >
> > > > > Regards,
> > > > > Maxim
> >
> > > > > On Dec 29, 6:12 pm, Amit Badkas  wrote:
> > > > > > Hi,
> >
> > > > > > My question was 'are the ACL tables (aros, acos and aros_acos)
> > > populated
> > > > > > correctly?', please refer tohttp://
> > > > > book.cakephp.org/view/1543/Simple-Acl-controlled-Applicationto
> > > > > > understand how to populate ACL tables.
> >
> > > > > > Amit Badkas
> >
> > > > > > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > > > > > On Wed, Dec 29, 2010 at 3:35 PM, John Maxim 
> > > wrote:
> > > > > > > Th

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Hi Sam,

I tried quite a number of times logging in IRC on cake but there were
always connection failure or something..given up and use googlegroup
as of now..

I can't carry on with the link you recommended; it asks me to be
familiar with console, I'm not, I don't know what/how exactly to begin
with the console, going through the cookbook simultaneously.. I'm
aging.

> see the buildAcl function in the tutorial

do you mean from cookbook?, yes, I'm viewing it now..

What's the secret to log in to IRC cake ? something I'm missing ..

Thanks for the explanation I thought Acl and Bake is one thing.

Regards,
Maxim


On Dec 29, 9:36 pm, Sam Sherlock  wrote:
> you'll find that ACL is a heavy task.
>
> setting up a dummy application (own db files etc) -- deleting and
> reinstating things over  and over will make things clearer
>
> trail and error extremely useful when learning ACL.  if you back up the db
> in between and compare what differences after doing things
>
> bake creates models, controllers & views (you can scaffold but I don't -- or
> have'nt found it useful to me personally)
> bake is not ACL - both ACL and bake have commandline access in cake
>
> your on the right track by the souds of what your doing.
>
> being prepared to redo various tutorials will really help you out;
> The cookbook tutorial is good - but Marks end to end really hammered it home
> for me
>
> see the buildAcl function in the tutorial
>
> there are an awful lot of different terms involved with ACL and variations
> on setup to -
> auth is easy to set up ACL not so much (at all); also lots of tla's (three
> letter acronyms :)
> and this can be overwhelming)
>
> stick with it - and keep pens and paper handy = coffee or whatever your
> choice beverage in plentiful supply
>
> also if you use IRC you'll find lots of helpful people there
>
>  - S
>
> On 29 December 2010 13:09, John Maxim  wrote:
>
> > Thanks Sam, it's clearer now...but still struggling with Acl; I was
> > confused when I hear the word "populate" a general term. In oracle, I
> > populated db/tables/sql scripts in a batch file, last time. So it
> > brought me a meaning of the same when I hear it again. Now I know it
> > could mean using command line and here it's Bake. But I created the
> > tables already, is there a measurement to check if the tables are
> > correctly "populated" ? I may have to drop the 3 tables I created
> > earlier..and re-do starting from tutorial Acl(cookbook tutorial)
> > again/ the link you've sent to me. Will check on it, now.
>
> > Regards,
>
> > Maxim
>
> > On Dec 29, 8:53 pm, Sam Sherlock  wrote:
> > > Hi John,
>
> > > you want to setup cake so you can use it from commandline
>
> > > bake is one part of cakes commandline
>
> > > also acl too: (output from commandline)
>
> > > $ cake acl
> > > Available ACL commands:
> > >          - create
> > >          - delete
> > >          - setParent
> > >          - getPath
> > >          - check
> > >          - grant
> > >          - deny
> > >          - inherit
> > >          - view
> > >          - initdb
> > >          - help
>
> > > so `cake acl initdb` would setup the db structure which you previously
> > > posted
>
> > > you don't have to, setup cake to run from commandline, but it is an
> > > advantage if you do
>
> > > also checkout the ACL tutorial by Mark Story (end to end acl parts 1 &
> > 2);
> > > it covers
> > > populating the tables and setting up controllers models etc - its the
> > least
> > > confusing acl tutorial out there :)
>
> > > additionally acl_extras a shell plugin is truly useful (also by Mark
> > Story)
>
> > > hth  - S
>
> > > On 29 December 2010 10:42, John Maxim  wrote:
>
> > > > Is Bake continued from scaffolding ? can I jump straight to learn
> > > > Bake ?
>
> > > > Must we use Bake to populate the Acl tables ?
>
> > > > Regards,
> > > > Maxim
>
> > > > On Dec 29, 6:12 pm, Amit Badkas  wrote:
> > > > > Hi,
>
> > > > > My question was 'are the ACL tables (aros, acos and aros_acos)
> > populated
> > > > > correctly?', please refer tohttp://
> > > > book.cakephp.org/view/1543/Simple-Acl-controlled-Applicationto
> > > > > understand how to populate ACL tables.
>
> > > > > Amit Badkas
>
> > > > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > > > On Wed, Dec 29, 2010 at 3:35 PM, John Maxim 
> > wrote:
> > > > > > Thanks Amit,
>
> > > > > > Yes, the first undefined: is solved, I posted a post before yours.
> > I
> > > > > > ran the DB sql scripts with no error. The sql is as follow:
>
> > > > > > 
>
> > > > > > CREATE TABLE acos (
> > > > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > > > >  parent_id INTEGER(10) DEFAULT NULL,
> > > > > >  model VARCHAR(255) DEFAULT '',
> > > > > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > > > > >  alias VARCHAR(255) DEFAULT '',
> > > > > >  lft INTEGER(10) DEFAULT NULL,
> > > > > >  rght INTEGER(10) DEFAULT NULL,
> > > > > >  PRIMARY KEY  (id)
> > > > > > );
>
> > > > > > CREATE TABLE aros_acos (
> >

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Sam Sherlock
you'll find that ACL is a heavy task.

setting up a dummy application (own db files etc) -- deleting and
reinstating things over  and over will make things clearer

trail and error extremely useful when learning ACL.  if you back up the db
in between and compare what differences after doing things

bake creates models, controllers & views (you can scaffold but I don't -- or
have'nt found it useful to me personally)
bake is not ACL - both ACL and bake have commandline access in cake

your on the right track by the souds of what your doing.

being prepared to redo various tutorials will really help you out;
The cookbook tutorial is good - but Marks end to end really hammered it home
for me

see the buildAcl function in the tutorial

there are an awful lot of different terms involved with ACL and variations
on setup to -
auth is easy to set up ACL not so much (at all); also lots of tla's (three
letter acronyms :)
and this can be overwhelming)

stick with it - and keep pens and paper handy = coffee or whatever your
choice beverage in plentiful supply

also if you use IRC you'll find lots of helpful people there

 - S



On 29 December 2010 13:09, John Maxim  wrote:

> Thanks Sam, it's clearer now...but still struggling with Acl; I was
> confused when I hear the word "populate" a general term. In oracle, I
> populated db/tables/sql scripts in a batch file, last time. So it
> brought me a meaning of the same when I hear it again. Now I know it
> could mean using command line and here it's Bake. But I created the
> tables already, is there a measurement to check if the tables are
> correctly "populated" ? I may have to drop the 3 tables I created
> earlier..and re-do starting from tutorial Acl(cookbook tutorial)
> again/ the link you've sent to me. Will check on it, now.
>
> Regards,
>
> Maxim
>
> On Dec 29, 8:53 pm, Sam Sherlock  wrote:
> > Hi John,
> >
> > you want to setup cake so you can use it from commandline
> >
> > bake is one part of cakes commandline
> >
> > also acl too: (output from commandline)
> >
> > $ cake acl
> > Available ACL commands:
> >  - create
> >  - delete
> >  - setParent
> >  - getPath
> >  - check
> >  - grant
> >  - deny
> >  - inherit
> >  - view
> >  - initdb
> >  - help
> >
> > so `cake acl initdb` would setup the db structure which you previously
> > posted
> >
> > you don't have to, setup cake to run from commandline, but it is an
> > advantage if you do
> >
> > also checkout the ACL tutorial by Mark Story (end to end acl parts 1 &
> 2);
> > it covers
> > populating the tables and setting up controllers models etc - its the
> least
> > confusing acl tutorial out there :)
> >
> > additionally acl_extras a shell plugin is truly useful (also by Mark
> Story)
> >
> > hth  - S
> >
> > On 29 December 2010 10:42, John Maxim  wrote:
> >
> > > Is Bake continued from scaffolding ? can I jump straight to learn
> > > Bake ?
> >
> > > Must we use Bake to populate the Acl tables ?
> >
> > > Regards,
> > > Maxim
> >
> > > On Dec 29, 6:12 pm, Amit Badkas  wrote:
> > > > Hi,
> >
> > > > My question was 'are the ACL tables (aros, acos and aros_acos)
> populated
> > > > correctly?', please refer tohttp://
> > > book.cakephp.org/view/1543/Simple-Acl-controlled-Applicationto
> > > > understand how to populate ACL tables.
> >
> > > > Amit Badkas
> >
> > > > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > > > On Wed, Dec 29, 2010 at 3:35 PM, John Maxim 
> wrote:
> > > > > Thanks Amit,
> >
> > > > > Yes, the first undefined: is solved, I posted a post before yours.
> I
> > > > > ran the DB sql scripts with no error. The sql is as follow:
> >
> > > > > 
> >
> > > > > CREATE TABLE acos (
> > > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > > >  parent_id INTEGER(10) DEFAULT NULL,
> > > > >  model VARCHAR(255) DEFAULT '',
> > > > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > > > >  alias VARCHAR(255) DEFAULT '',
> > > > >  lft INTEGER(10) DEFAULT NULL,
> > > > >  rght INTEGER(10) DEFAULT NULL,
> > > > >  PRIMARY KEY  (id)
> > > > > );
> >
> > > > > CREATE TABLE aros_acos (
> > > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > > >  aro_id INTEGER(10) UNSIGNED NOT NULL,
> > > > >  aco_id INTEGER(10) UNSIGNED NOT NULL,
> > > > >  _create CHAR(2) NOT NULL DEFAULT 0,
> > > > >  _read CHAR(2) NOT NULL DEFAULT 0,
> > > > >  _update CHAR(2) NOT NULL DEFAULT 0,
> > > > >  _delete CHAR(2) NOT NULL DEFAULT 0,
> > > > >  PRIMARY KEY(id)
> > > > > );
> >
> > > > > CREATE TABLE aros (
> > > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > > >  parent_id INTEGER(10) DEFAULT NULL,
> > > > >  model VARCHAR(255) DEFAULT '',
> > > > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > > > >  alias VARCHAR(255) DEFAULT '',
> > > > >  lft INTEGER(10) DEFAULT NULL,
> > > > >  rght INTEGER(10) DEFAULT NULL,
> > > > >  PRIMARY KEY  (id)
> > > > > );
> >
> > > > > ~~~
> >
> > > > > On 

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Thanks Sam, it's clearer now...but still struggling with Acl; I was
confused when I hear the word "populate" a general term. In oracle, I
populated db/tables/sql scripts in a batch file, last time. So it
brought me a meaning of the same when I hear it again. Now I know it
could mean using command line and here it's Bake. But I created the
tables already, is there a measurement to check if the tables are
correctly "populated" ? I may have to drop the 3 tables I created
earlier..and re-do starting from tutorial Acl(cookbook tutorial)
again/ the link you've sent to me. Will check on it, now.

Regards,

Maxim

On Dec 29, 8:53 pm, Sam Sherlock  wrote:
> Hi John,
>
> you want to setup cake so you can use it from commandline
>
> bake is one part of cakes commandline
>
> also acl too: (output from commandline)
>
> $ cake acl
> Available ACL commands:
>          - create
>          - delete
>          - setParent
>          - getPath
>          - check
>          - grant
>          - deny
>          - inherit
>          - view
>          - initdb
>          - help
>
> so `cake acl initdb` would setup the db structure which you previously
> posted
>
> you don't have to, setup cake to run from commandline, but it is an
> advantage if you do
>
> also checkout the ACL tutorial by Mark Story (end to end acl parts 1 & 2);
> it covers
> populating the tables and setting up controllers models etc - its the least
> confusing acl tutorial out there :)
>
> additionally acl_extras a shell plugin is truly useful (also by Mark Story)
>
> hth  - S
>
> On 29 December 2010 10:42, John Maxim  wrote:
>
> > Is Bake continued from scaffolding ? can I jump straight to learn
> > Bake ?
>
> > Must we use Bake to populate the Acl tables ?
>
> > Regards,
> > Maxim
>
> > On Dec 29, 6:12 pm, Amit Badkas  wrote:
> > > Hi,
>
> > > My question was 'are the ACL tables (aros, acos and aros_acos) populated
> > > correctly?', please refer tohttp://
> > book.cakephp.org/view/1543/Simple-Acl-controlled-Applicationto
> > > understand how to populate ACL tables.
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Wed, Dec 29, 2010 at 3:35 PM, John Maxim  wrote:
> > > > Thanks Amit,
>
> > > > Yes, the first undefined: is solved, I posted a post before yours. I
> > > > ran the DB sql scripts with no error. The sql is as follow:
>
> > > > 
>
> > > > CREATE TABLE acos (
> > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > >  parent_id INTEGER(10) DEFAULT NULL,
> > > >  model VARCHAR(255) DEFAULT '',
> > > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > > >  alias VARCHAR(255) DEFAULT '',
> > > >  lft INTEGER(10) DEFAULT NULL,
> > > >  rght INTEGER(10) DEFAULT NULL,
> > > >  PRIMARY KEY  (id)
> > > > );
>
> > > > CREATE TABLE aros_acos (
> > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > >  aro_id INTEGER(10) UNSIGNED NOT NULL,
> > > >  aco_id INTEGER(10) UNSIGNED NOT NULL,
> > > >  _create CHAR(2) NOT NULL DEFAULT 0,
> > > >  _read CHAR(2) NOT NULL DEFAULT 0,
> > > >  _update CHAR(2) NOT NULL DEFAULT 0,
> > > >  _delete CHAR(2) NOT NULL DEFAULT 0,
> > > >  PRIMARY KEY(id)
> > > > );
>
> > > > CREATE TABLE aros (
> > > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > > >  parent_id INTEGER(10) DEFAULT NULL,
> > > >  model VARCHAR(255) DEFAULT '',
> > > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > > >  alias VARCHAR(255) DEFAULT '',
> > > >  lft INTEGER(10) DEFAULT NULL,
> > > >  rght INTEGER(10) DEFAULT NULL,
> > > >  PRIMARY KEY  (id)
> > > > );
>
> > > > ~~~
>
> > > > On Dec 29, 5:56 pm, Amit Badkas  wrote:
> > > > > Hi,
>
> > > > > About 'Undefined index: content' error, you should already know how
> > to
> > > > fix
> > > > > it.
>
> > > > > About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions
> > check'
> > > > > error, are the ACL tables (aros, acos and aros_acos) populated
> > correctly?
>
> > > > > Amit Badkas
>
> > > > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > > > On Wed, Dec 29, 2010 at 2:56 PM, John Maxim 
> > wrote:
> > > > > > Hi Amit, Thanks...!
>
> > > > > > I just put it in the controllers components--access.php:
> > > > > > --
> > > > > >  > > > > > class AccessComponent extends Object{
> > > > > >        var $components = array('Acl', 'Auth');
> > > > > >        var $user;
>
> > > > > >        function startup(){
> > > > > >                 $this->user = $this->Auth->user();
> > > > > >        }
>
> > > > > >        function check($aco, $action='*'){
> > > > > >                 if(!empty($this->user) &&
> > > > $this->Acl->check('User::'.$this-
> > > > > > >user['User']['id'], $aco, $action)){
> > > > > >                        return true;
> > > > > >                } else {
> > > > > >                        return false;
> > > > > >                }
> > > > > >        }
>
> > > > > >        function checkHelper($aro, $aco, $action = "*"){
> > > > > >                App::import('Component', 'Acl');
> > > > > >   

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Sam Sherlock
Hi John,

you want to setup cake so you can use it from commandline

bake is one part of cakes commandline

also acl too: (output from commandline)

$ cake acl
Available ACL commands:
 - create
 - delete
 - setParent
 - getPath
 - check
 - grant
 - deny
 - inherit
 - view
 - initdb
 - help

so `cake acl initdb` would setup the db structure which you previously
posted

you don't have to, setup cake to run from commandline, but it is an
advantage if you do

also checkout the ACL tutorial by Mark Story (end to end acl parts 1 & 2);
it covers
populating the tables and setting up controllers models etc - its the least
confusing acl tutorial out there :)

additionally acl_extras a shell plugin is truly useful (also by Mark Story)

hth  - S





On 29 December 2010 10:42, John Maxim  wrote:

> Is Bake continued from scaffolding ? can I jump straight to learn
> Bake ?
>
> Must we use Bake to populate the Acl tables ?
>
>
> Regards,
> Maxim
>
> On Dec 29, 6:12 pm, Amit Badkas  wrote:
> > Hi,
> >
> > My question was 'are the ACL tables (aros, acos and aros_acos) populated
> > correctly?', please refer tohttp://
> book.cakephp.org/view/1543/Simple-Acl-controlled-Applicationto
> > understand how to populate ACL tables.
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > On Wed, Dec 29, 2010 at 3:35 PM, John Maxim  wrote:
> > > Thanks Amit,
> >
> > > Yes, the first undefined: is solved, I posted a post before yours. I
> > > ran the DB sql scripts with no error. The sql is as follow:
> >
> > > 
> >
> > > CREATE TABLE acos (
> > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > >  parent_id INTEGER(10) DEFAULT NULL,
> > >  model VARCHAR(255) DEFAULT '',
> > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > >  alias VARCHAR(255) DEFAULT '',
> > >  lft INTEGER(10) DEFAULT NULL,
> > >  rght INTEGER(10) DEFAULT NULL,
> > >  PRIMARY KEY  (id)
> > > );
> >
> > > CREATE TABLE aros_acos (
> > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > >  aro_id INTEGER(10) UNSIGNED NOT NULL,
> > >  aco_id INTEGER(10) UNSIGNED NOT NULL,
> > >  _create CHAR(2) NOT NULL DEFAULT 0,
> > >  _read CHAR(2) NOT NULL DEFAULT 0,
> > >  _update CHAR(2) NOT NULL DEFAULT 0,
> > >  _delete CHAR(2) NOT NULL DEFAULT 0,
> > >  PRIMARY KEY(id)
> > > );
> >
> > > CREATE TABLE aros (
> > >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> > >  parent_id INTEGER(10) DEFAULT NULL,
> > >  model VARCHAR(255) DEFAULT '',
> > >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> > >  alias VARCHAR(255) DEFAULT '',
> > >  lft INTEGER(10) DEFAULT NULL,
> > >  rght INTEGER(10) DEFAULT NULL,
> > >  PRIMARY KEY  (id)
> > > );
> >
> > > ~~~
> >
> > > On Dec 29, 5:56 pm, Amit Badkas  wrote:
> > > > Hi,
> >
> > > > About 'Undefined index: content' error, you should already know how
> to
> > > fix
> > > > it.
> >
> > > > About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions
> check'
> > > > error, are the ACL tables (aros, acos and aros_acos) populated
> correctly?
> >
> > > > Amit Badkas
> >
> > > > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > > > On Wed, Dec 29, 2010 at 2:56 PM, John Maxim 
> wrote:
> > > > > Hi Amit, Thanks...!
> >
> > > > > I just put it in the controllers components--access.php:
> > > > > --
> > > > >  > > > > class AccessComponent extends Object{
> > > > >var $components = array('Acl', 'Auth');
> > > > >var $user;
> >
> > > > >function startup(){
> > > > > $this->user = $this->Auth->user();
> > > > >}
> >
> > > > >function check($aco, $action='*'){
> > > > > if(!empty($this->user) &&
> > > $this->Acl->check('User::'.$this-
> > > > > >user['User']['id'], $aco, $action)){
> > > > >return true;
> > > > >} else {
> > > > >return false;
> > > > >}
> > > > >}
> >
> > > > >function checkHelper($aro, $aco, $action = "*"){
> > > > >App::import('Component', 'Acl');
> > > > >$acl = new AclComponent();
> > > > >return $acl->check($aro, $aco, $action);
> > > > >}
> > > > > }
> > > > > ?>
> > > > > --
> >
> > > > > Now the errors are:
> > > > > ~~
> >
> > > > > Notice (8): Undefined index: content [APP\views\posts\index.ctp,
> line
> > > > > 7]
> > > > > ~~
> > > > > Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> > > > > permissions check.  Node references:
> > > > > Aro: User::44
> > > > > Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
> > > > > ~~
> >
> > > > > Regards,
> > > > > Maxim
> >
> > > > > On Dec 29, 4:43 pm, Amit Badkas  wrote:
> > > > > > Hi,
> >
> > > > > > Have you had AccessComponent class defined in
> > > > > > app/controllers/components/access.php?
> >
> > > > > > Amit Badkas
> >
> > > > > > PHP Applicati

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Is Bake continued from scaffolding ? can I jump straight to learn
Bake ?

Must we use Bake to populate the Acl tables ?


Regards,
Maxim

On Dec 29, 6:12 pm, Amit Badkas  wrote:
> Hi,
>
> My question was 'are the ACL tables (aros, acos and aros_acos) populated
> correctly?', please refer 
> tohttp://book.cakephp.org/view/1543/Simple-Acl-controlled-Applicationto
> understand how to populate ACL tables.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Wed, Dec 29, 2010 at 3:35 PM, John Maxim  wrote:
> > Thanks Amit,
>
> > Yes, the first undefined: is solved, I posted a post before yours. I
> > ran the DB sql scripts with no error. The sql is as follow:
>
> > 
>
> > CREATE TABLE acos (
> >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> >  parent_id INTEGER(10) DEFAULT NULL,
> >  model VARCHAR(255) DEFAULT '',
> >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> >  alias VARCHAR(255) DEFAULT '',
> >  lft INTEGER(10) DEFAULT NULL,
> >  rght INTEGER(10) DEFAULT NULL,
> >  PRIMARY KEY  (id)
> > );
>
> > CREATE TABLE aros_acos (
> >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> >  aro_id INTEGER(10) UNSIGNED NOT NULL,
> >  aco_id INTEGER(10) UNSIGNED NOT NULL,
> >  _create CHAR(2) NOT NULL DEFAULT 0,
> >  _read CHAR(2) NOT NULL DEFAULT 0,
> >  _update CHAR(2) NOT NULL DEFAULT 0,
> >  _delete CHAR(2) NOT NULL DEFAULT 0,
> >  PRIMARY KEY(id)
> > );
>
> > CREATE TABLE aros (
> >  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
> >  parent_id INTEGER(10) DEFAULT NULL,
> >  model VARCHAR(255) DEFAULT '',
> >  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
> >  alias VARCHAR(255) DEFAULT '',
> >  lft INTEGER(10) DEFAULT NULL,
> >  rght INTEGER(10) DEFAULT NULL,
> >  PRIMARY KEY  (id)
> > );
>
> > ~~~
>
> > On Dec 29, 5:56 pm, Amit Badkas  wrote:
> > > Hi,
>
> > > About 'Undefined index: content' error, you should already know how to
> > fix
> > > it.
>
> > > About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions check'
> > > error, are the ACL tables (aros, acos and aros_acos) populated correctly?
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Wed, Dec 29, 2010 at 2:56 PM, John Maxim  wrote:
> > > > Hi Amit, Thanks...!
>
> > > > I just put it in the controllers components--access.php:
> > > > --
> > > >  > > > class AccessComponent extends Object{
> > > >        var $components = array('Acl', 'Auth');
> > > >        var $user;
>
> > > >        function startup(){
> > > >                 $this->user = $this->Auth->user();
> > > >        }
>
> > > >        function check($aco, $action='*'){
> > > >                 if(!empty($this->user) &&
> > $this->Acl->check('User::'.$this-
> > > > >user['User']['id'], $aco, $action)){
> > > >                        return true;
> > > >                } else {
> > > >                        return false;
> > > >                }
> > > >        }
>
> > > >        function checkHelper($aro, $aco, $action = "*"){
> > > >                App::import('Component', 'Acl');
> > > >                $acl = new AclComponent();
> > > >                return $acl->check($aro, $aco, $action);
> > > >        }
> > > > }
> > > > ?>
> > > > --
>
> > > > Now the errors are:
> > > > ~~
>
> > > > Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
> > > > 7]
> > > > ~~
> > > > Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> > > > permissions check.  Node references:
> > > > Aro: User::44
> > > > Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
> > > > ~~
>
> > > > Regards,
> > > > Maxim
>
> > > > On Dec 29, 4:43 pm, Amit Badkas  wrote:
> > > > > Hi,
>
> > > > > Have you had AccessComponent class defined in
> > > > > app/controllers/components/access.php?
>
> > > > > Amit Badkas
>
> > > > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > > > On Wed, Dec 29, 2010 at 1:30 PM, John Maxim 
> > wrote:
> > > > > >  > > > > > class AccessHelper extends Helper{
> > > > > >        var $helpers = array("Session");
> > > > > >        var $Access;
> > > > > >        var $Auth;
> > > > > >        var $user;
>
> > > > > >        function beforeRender(){
> > > > > >                App::import('Component', 'Access');
> > > > > >                $this->Access = new AccessComponent();
>
> > > > > >                App::import('Component', 'Auth');
> > > > > >                $this->Auth = new AuthComponent();
> > > > > >                $this->Auth->Session = $this->Session;
>
> > > > > >                $this->user = $this->Auth->user();
> > > > > >        }
>
> > > > > >        function check($aco, $action='*'){
> > > > > >                if(empty($this->user)) return false;
> > > > > >                return
> > > > > > $this->Access->checkHelper('User::'.$this->user['User']
> > > > > > ['id'], $aco, $action);
> > > > > >        }
>
> > > > > >        function isLoggedin(){
> > > > > >                return !empty($this->user);
> > > > > >        }

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi,

My question was 'are the ACL tables (aros, acos and aros_acos) populated
correctly?', please refer to
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application to
understand how to populate ACL tables.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Wed, Dec 29, 2010 at 3:35 PM, John Maxim  wrote:

> Thanks Amit,
>
> Yes, the first undefined: is solved, I posted a post before yours. I
> ran the DB sql scripts with no error. The sql is as follow:
>
> 
>
> CREATE TABLE acos (
>  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
>  parent_id INTEGER(10) DEFAULT NULL,
>  model VARCHAR(255) DEFAULT '',
>  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
>  alias VARCHAR(255) DEFAULT '',
>  lft INTEGER(10) DEFAULT NULL,
>  rght INTEGER(10) DEFAULT NULL,
>  PRIMARY KEY  (id)
> );
>
> CREATE TABLE aros_acos (
>  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
>  aro_id INTEGER(10) UNSIGNED NOT NULL,
>  aco_id INTEGER(10) UNSIGNED NOT NULL,
>  _create CHAR(2) NOT NULL DEFAULT 0,
>  _read CHAR(2) NOT NULL DEFAULT 0,
>  _update CHAR(2) NOT NULL DEFAULT 0,
>  _delete CHAR(2) NOT NULL DEFAULT 0,
>  PRIMARY KEY(id)
> );
>
> CREATE TABLE aros (
>  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
>  parent_id INTEGER(10) DEFAULT NULL,
>  model VARCHAR(255) DEFAULT '',
>  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
>  alias VARCHAR(255) DEFAULT '',
>  lft INTEGER(10) DEFAULT NULL,
>  rght INTEGER(10) DEFAULT NULL,
>  PRIMARY KEY  (id)
> );
>
>
> ~~~
>
> On Dec 29, 5:56 pm, Amit Badkas  wrote:
> > Hi,
> >
> > About 'Undefined index: content' error, you should already know how to
> fix
> > it.
> >
> > About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions check'
> > error, are the ACL tables (aros, acos and aros_acos) populated correctly?
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > On Wed, Dec 29, 2010 at 2:56 PM, John Maxim  wrote:
> > > Hi Amit, Thanks...!
> >
> > > I just put it in the controllers components--access.php:
> > > --
> > >  > > class AccessComponent extends Object{
> > >var $components = array('Acl', 'Auth');
> > >var $user;
> >
> > >function startup(){
> > > $this->user = $this->Auth->user();
> > >}
> >
> > >function check($aco, $action='*'){
> > > if(!empty($this->user) &&
> $this->Acl->check('User::'.$this-
> > > >user['User']['id'], $aco, $action)){
> > >return true;
> > >} else {
> > >return false;
> > >}
> > >}
> >
> > >function checkHelper($aro, $aco, $action = "*"){
> > >App::import('Component', 'Acl');
> > >$acl = new AclComponent();
> > >return $acl->check($aro, $aco, $action);
> > >}
> > > }
> > > ?>
> > > --
> >
> > > Now the errors are:
> > > ~~
> >
> > > Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
> > > 7]
> > > ~~
> > > Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> > > permissions check.  Node references:
> > > Aro: User::44
> > > Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
> > > ~~
> >
> > > Regards,
> > > Maxim
> >
> > > On Dec 29, 4:43 pm, Amit Badkas  wrote:
> > > > Hi,
> >
> > > > Have you had AccessComponent class defined in
> > > > app/controllers/components/access.php?
> >
> > > > Amit Badkas
> >
> > > > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > > > On Wed, Dec 29, 2010 at 1:30 PM, John Maxim 
> wrote:
> > > > >  > > > > class AccessHelper extends Helper{
> > > > >var $helpers = array("Session");
> > > > >var $Access;
> > > > >var $Auth;
> > > > >var $user;
> >
> > > > >function beforeRender(){
> > > > >App::import('Component', 'Access');
> > > > >$this->Access = new AccessComponent();
> >
> > > > >App::import('Component', 'Auth');
> > > > >$this->Auth = new AuthComponent();
> > > > >$this->Auth->Session = $this->Session;
> >
> > > > >$this->user = $this->Auth->user();
> > > > >}
> >
> > > > >function check($aco, $action='*'){
> > > > >if(empty($this->user)) return false;
> > > > >return
> > > > > $this->Access->checkHelper('User::'.$this->user['User']
> > > > > ['id'], $aco, $action);
> > > > >}
> >
> > > > >function isLoggedin(){
> > > > >return !empty($this->user);
> > > > >}
> > > > > }
> > > > > ?>
> >
> > > > > 
> >
> > > > > This access.php file is saved in app/views/helpers
> > > > > 
> > > > > In "Posts" Controller, I have added: var $helpers =
> array('Access');
> >
> > > > > So it can be accessed from the view.
> >
> > > > > My Posts index is here:
> > > > > --
> > > > >  Welcome to my C

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Thanks Amit,

Yes, the first undefined: is solved, I posted a post before yours. I
ran the DB sql scripts with no error. The sql is as follow:



CREATE TABLE acos (
  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  parent_id INTEGER(10) DEFAULT NULL,
  model VARCHAR(255) DEFAULT '',
  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
  alias VARCHAR(255) DEFAULT '',
  lft INTEGER(10) DEFAULT NULL,
  rght INTEGER(10) DEFAULT NULL,
  PRIMARY KEY  (id)
);

CREATE TABLE aros_acos (
  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  aro_id INTEGER(10) UNSIGNED NOT NULL,
  aco_id INTEGER(10) UNSIGNED NOT NULL,
  _create CHAR(2) NOT NULL DEFAULT 0,
  _read CHAR(2) NOT NULL DEFAULT 0,
  _update CHAR(2) NOT NULL DEFAULT 0,
  _delete CHAR(2) NOT NULL DEFAULT 0,
  PRIMARY KEY(id)
);

CREATE TABLE aros (
  id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  parent_id INTEGER(10) DEFAULT NULL,
  model VARCHAR(255) DEFAULT '',
  foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
  alias VARCHAR(255) DEFAULT '',
  lft INTEGER(10) DEFAULT NULL,
  rght INTEGER(10) DEFAULT NULL,
  PRIMARY KEY  (id)
);


~~~

On Dec 29, 5:56 pm, Amit Badkas  wrote:
> Hi,
>
> About 'Undefined index: content' error, you should already know how to fix
> it.
>
> About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions check'
> error, are the ACL tables (aros, acos and aros_acos) populated correctly?
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Wed, Dec 29, 2010 at 2:56 PM, John Maxim  wrote:
> > Hi Amit, Thanks...!
>
> > I just put it in the controllers components--access.php:
> > --
> >  > class AccessComponent extends Object{
> >        var $components = array('Acl', 'Auth');
> >        var $user;
>
> >        function startup(){
> >                 $this->user = $this->Auth->user();
> >        }
>
> >        function check($aco, $action='*'){
> >                 if(!empty($this->user) && $this->Acl->check('User::'.$this-
> > >user['User']['id'], $aco, $action)){
> >                        return true;
> >                } else {
> >                        return false;
> >                }
> >        }
>
> >        function checkHelper($aro, $aco, $action = "*"){
> >                App::import('Component', 'Acl');
> >                $acl = new AclComponent();
> >                return $acl->check($aro, $aco, $action);
> >        }
> > }
> > ?>
> > --
>
> > Now the errors are:
> > ~~
>
> > Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
> > 7]
> > ~~
> > Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> > permissions check.  Node references:
> > Aro: User::44
> > Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
> > ~~
>
> > Regards,
> > Maxim
>
> > On Dec 29, 4:43 pm, Amit Badkas  wrote:
> > > Hi,
>
> > > Have you had AccessComponent class defined in
> > > app/controllers/components/access.php?
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Wed, Dec 29, 2010 at 1:30 PM, John Maxim  wrote:
> > > >  > > > class AccessHelper extends Helper{
> > > >        var $helpers = array("Session");
> > > >        var $Access;
> > > >        var $Auth;
> > > >        var $user;
>
> > > >        function beforeRender(){
> > > >                App::import('Component', 'Access');
> > > >                $this->Access = new AccessComponent();
>
> > > >                App::import('Component', 'Auth');
> > > >                $this->Auth = new AuthComponent();
> > > >                $this->Auth->Session = $this->Session;
>
> > > >                $this->user = $this->Auth->user();
> > > >        }
>
> > > >        function check($aco, $action='*'){
> > > >                if(empty($this->user)) return false;
> > > >                return
> > > > $this->Access->checkHelper('User::'.$this->user['User']
> > > > ['id'], $aco, $action);
> > > >        }
>
> > > >        function isLoggedin(){
> > > >                return !empty($this->user);
> > > >        }
> > > > }
> > > > ?>
>
> > > > 
>
> > > > This access.php file is saved in app/views/helpers
> > > > 
> > > > In "Posts" Controller, I have added: var $helpers = array('Access');
>
> > > > So it can be accessed from the view.
>
> > > > My Posts index is here:
> > > > --
> > > >  Welcome to my CakePHP Blog
>
> > > > 
>
> > > >         > > > $post['Post']['title'] ?>
>
> > > > 
>
> > > > isLoggedin() && $access->check('Post')): ?>
>
> > > > edit
> > > > |
> > > > link('delete', '/posts/delete/'.$post['Post']['id'],
> > > > NULL, 'Are you sure?'); ?>
>
> > > > 
> > > > 
> > > > 
> > > > ---
>
> > > > I got this error as I view Posts index:
> > > > ---
> > > > Fatal error: Class 'AccessComponent' not found in C:\wamp\www\cakephp
> > > > \app\views\helpers\access.php on line 10
> > > > ---
>
> > > > Line 10 points to this:
> > > > 

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
> Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
> 7]
~
Solved the error above, just minor mistake..

Now left unsolved is:


> Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> permissions check.  Node references:
> Aro: User::44
> Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
>


Regards,
Maxim

On Dec 29, 5:26 pm, John Maxim  wrote:
> Hi Amit, Thanks...!
>
> I just put it in the controllers components--access.php:
> --
>  class AccessComponent extends Object{
>         var $components = array('Acl', 'Auth');
>         var $user;
>
>         function startup(){
>                 $this->user = $this->Auth->user();
>         }
>
>         function check($aco, $action='*'){
>                 if(!empty($this->user) && 
> $this->Acl->check('User::'.$this->user['User']['id'], $aco, $action)){
>
>                         return true;
>                 } else {
>                         return false;
>                 }
>         }
>
>         function checkHelper($aro, $aco, $action = "*"){
>                 App::import('Component', 'Acl');
>                 $acl = new AclComponent();
>                 return $acl->check($aro, $aco, $action);
>         }}
>
> ?>
> --
>
> Now the errors are:
> ~~
>
> Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
> 7]
> ~~
> Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> permissions check.  Node references:
> Aro: User::44
> Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
> ~~
>
> Regards,
> Maxim
>
> On Dec 29, 4:43 pm, Amit Badkas  wrote:
>
> > Hi,
>
> > Have you had AccessComponent class defined in
> > app/controllers/components/access.php?
>
> > Amit Badkas
>
> > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > On Wed, Dec 29, 2010 at 1:30 PM, John Maxim  wrote:
> > >  > > class AccessHelper extends Helper{
> > >        var $helpers = array("Session");
> > >        var $Access;
> > >        var $Auth;
> > >        var $user;
>
> > >        function beforeRender(){
> > >                App::import('Component', 'Access');
> > >                $this->Access = new AccessComponent();
>
> > >                App::import('Component', 'Auth');
> > >                $this->Auth = new AuthComponent();
> > >                $this->Auth->Session = $this->Session;
>
> > >                $this->user = $this->Auth->user();
> > >        }
>
> > >        function check($aco, $action='*'){
> > >                if(empty($this->user)) return false;
> > >                return
> > > $this->Access->checkHelper('User::'.$this->user['User']
> > > ['id'], $aco, $action);
> > >        }
>
> > >        function isLoggedin(){
> > >                return !empty($this->user);
> > >        }
> > > }
> > > ?>
>
> > > 
>
> > > This access.php file is saved in app/views/helpers
> > > 
> > > In "Posts" Controller, I have added: var $helpers = array('Access');
>
> > > So it can be accessed from the view.
>
> > > My Posts index is here:
> > > --
> > >  Welcome to my CakePHP Blog
>
> > > 
>
> > >         > > $post['Post']['title'] ?>
>
> > > 
>
> > > isLoggedin() && $access->check('Post')): ?>
>
> > > edit
> > > |
> > > link('delete', '/posts/delete/'.$post['Post']['id'],
> > > NULL, 'Are you sure?'); ?>
>
> > > 
> > > 
> > > 
> > > ---
>
> > > I got this error as I view Posts index:
> > > ---
> > > Fatal error: Class 'AccessComponent' not found in C:\wamp\www\cakephp
> > > \app\views\helpers\access.php on line 10
> > > ---
>
> > > Line 10 points to this:
> > > 
> > > $this->Access = new AccessComponent();
> > > -
>
> > > ~~
>
> > > What am I trying to accomplish ?
>
> > > The edit and delete links can only be viewed when User is logged in.
> > > If not logged in, only the Posts index and view page are viewable--
> > > without displaying the edit and delete links to the Guest users.
>
> > > ~~
>
> > > Is the method of doing wrong ? what is the suggested way ?
>
> > > Thanks,
> > > Maxim
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comFor
> > >  more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

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...@google

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi,

About 'Undefined index: content' error, you should already know how to fix
it.

About 'DbAcl::check() - Failed ARO/ACO node lookup in permissions check'
error, are the ACL tables (aros, acos and aros_acos) populated correctly?

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Wed, Dec 29, 2010 at 2:56 PM, John Maxim  wrote:

> Hi Amit, Thanks...!
>
> I just put it in the controllers components--access.php:
> --
>  class AccessComponent extends Object{
>var $components = array('Acl', 'Auth');
>var $user;
>
>function startup(){
> $this->user = $this->Auth->user();
>}
>
>function check($aco, $action='*'){
> if(!empty($this->user) && $this->Acl->check('User::'.$this-
> >user['User']['id'], $aco, $action)){
>return true;
>} else {
>return false;
>}
>}
>
>function checkHelper($aro, $aco, $action = "*"){
>App::import('Component', 'Acl');
>$acl = new AclComponent();
>return $acl->check($aro, $aco, $action);
>}
> }
> ?>
> --
>
> Now the errors are:
> ~~
>
> Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
> 7]
> ~~
> Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
> permissions check.  Node references:
> Aro: User::44
> Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
> ~~
>
> Regards,
> Maxim
>
> On Dec 29, 4:43 pm, Amit Badkas  wrote:
> > Hi,
> >
> > Have you had AccessComponent class defined in
> > app/controllers/components/access.php?
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > On Wed, Dec 29, 2010 at 1:30 PM, John Maxim  wrote:
> > >  > > class AccessHelper extends Helper{
> > >var $helpers = array("Session");
> > >var $Access;
> > >var $Auth;
> > >var $user;
> >
> > >function beforeRender(){
> > >App::import('Component', 'Access');
> > >$this->Access = new AccessComponent();
> >
> > >App::import('Component', 'Auth');
> > >$this->Auth = new AuthComponent();
> > >$this->Auth->Session = $this->Session;
> >
> > >$this->user = $this->Auth->user();
> > >}
> >
> > >function check($aco, $action='*'){
> > >if(empty($this->user)) return false;
> > >return
> > > $this->Access->checkHelper('User::'.$this->user['User']
> > > ['id'], $aco, $action);
> > >}
> >
> > >function isLoggedin(){
> > >return !empty($this->user);
> > >}
> > > }
> > > ?>
> >
> > > 
> >
> > > This access.php file is saved in app/views/helpers
> > > 
> > > In "Posts" Controller, I have added: var $helpers = array('Access');
> >
> > > So it can be accessed from the view.
> >
> > > My Posts index is here:
> > > --
> > >  Welcome to my CakePHP Blog
> >
> > > 
> >
> > > > > $post['Post']['title'] ?>
> >
> > > 
> >
> > > isLoggedin() && $access->check('Post')): ?>
> >
> > > edit
> > > |
> > > link('delete', '/posts/delete/'.$post['Post']['id'],
> > > NULL, 'Are you sure?'); ?>
> >
> > > 
> > > 
> > > 
> > > ---
> >
> > > I got this error as I view Posts index:
> > > ---
> > > Fatal error: Class 'AccessComponent' not found in C:\wamp\www\cakephp
> > > \app\views\helpers\access.php on line 10
> > > ---
> >
> > > Line 10 points to this:
> > > 
> > > $this->Access = new AccessComponent();
> > > -
> >
> > > ~~
> >
> > > What am I trying to accomplish ?
> >
> > > The edit and delete links can only be viewed when User is logged in.
> > > If not logged in, only the Posts index and view page are viewable--
> > > without displaying the edit and delete links to the Guest users.
> >
> > > ~~
> >
> > > Is the method of doing wrong ? what is the suggested way ?
> >
> > > Thanks,
> > > Maxim
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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
>
> 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..

Re: HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Hi Amit, Thanks...!

I just put it in the controllers components--access.php:
--
user = $this->Auth->user();
}

function check($aco, $action='*'){
if(!empty($this->user) && $this->Acl->check('User::'.$this-
>user['User']['id'], $aco, $action)){
return true;
} else {
return false;
}
}

function checkHelper($aro, $aco, $action = "*"){
App::import('Component', 'Acl');
$acl = new AclComponent();
return $acl->check($aro, $aco, $action);
}
}
?>
--

Now the errors are:
~~

Notice (8): Undefined index: content [APP\views\posts\index.ctp, line
7]
~~
Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
permissions check.  Node references:
Aro: User::44
Aco: Post [CORE\cake\libs\controller\components\acl.php, line 273]
~~

Regards,
Maxim

On Dec 29, 4:43 pm, Amit Badkas  wrote:
> Hi,
>
> Have you had AccessComponent class defined in
> app/controllers/components/access.php?
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Wed, Dec 29, 2010 at 1:30 PM, John Maxim  wrote:
> >  > class AccessHelper extends Helper{
> >        var $helpers = array("Session");
> >        var $Access;
> >        var $Auth;
> >        var $user;
>
> >        function beforeRender(){
> >                App::import('Component', 'Access');
> >                $this->Access = new AccessComponent();
>
> >                App::import('Component', 'Auth');
> >                $this->Auth = new AuthComponent();
> >                $this->Auth->Session = $this->Session;
>
> >                $this->user = $this->Auth->user();
> >        }
>
> >        function check($aco, $action='*'){
> >                if(empty($this->user)) return false;
> >                return
> > $this->Access->checkHelper('User::'.$this->user['User']
> > ['id'], $aco, $action);
> >        }
>
> >        function isLoggedin(){
> >                return !empty($this->user);
> >        }
> > }
> > ?>
>
> > 
>
> > This access.php file is saved in app/views/helpers
> > 
> > In "Posts" Controller, I have added: var $helpers = array('Access');
>
> > So it can be accessed from the view.
>
> > My Posts index is here:
> > --
> >  Welcome to my CakePHP Blog
>
> > 
>
> >         > $post['Post']['title'] ?>
>
> > 
>
> > isLoggedin() && $access->check('Post')): ?>
>
> > edit
> > |
> > link('delete', '/posts/delete/'.$post['Post']['id'],
> > NULL, 'Are you sure?'); ?>
>
> > 
> > 
> > 
> > ---
>
> > I got this error as I view Posts index:
> > ---
> > Fatal error: Class 'AccessComponent' not found in C:\wamp\www\cakephp
> > \app\views\helpers\access.php on line 10
> > ---
>
> > Line 10 points to this:
> > 
> > $this->Access = new AccessComponent();
> > -
>
> > ~~
>
> > What am I trying to accomplish ?
>
> > The edit and delete links can only be viewed when User is logged in.
> > If not logged in, only the Posts index and view page are viewable--
> > without displaying the edit and delete links to the Guest users.
>
> > ~~
>
> > Is the method of doing wrong ? what is the suggested way ?
>
> > Thanks,
> > Maxim
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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 NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread Amit Badkas
Hi,

Have you had AccessComponent class defined in
app/controllers/components/access.php?

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Wed, Dec 29, 2010 at 1:30 PM, John Maxim  wrote:

>  class AccessHelper extends Helper{
>var $helpers = array("Session");
>var $Access;
>var $Auth;
>var $user;
>
>function beforeRender(){
>App::import('Component', 'Access');
>$this->Access = new AccessComponent();
>
>App::import('Component', 'Auth');
>$this->Auth = new AuthComponent();
>$this->Auth->Session = $this->Session;
>
>$this->user = $this->Auth->user();
>}
>
>function check($aco, $action='*'){
>if(empty($this->user)) return false;
>return
> $this->Access->checkHelper('User::'.$this->user['User']
> ['id'], $aco, $action);
>}
>
>function isLoggedin(){
>return !empty($this->user);
>}
> }
> ?>
>
> 
>
> This access.php file is saved in app/views/helpers
> 
> In "Posts" Controller, I have added: var $helpers = array('Access');
>
> So it can be accessed from the view.
>
>
> My Posts index is here:
> --
>  Welcome to my CakePHP Blog
>
> 
>
> $post['Post']['title'] ?>
>
> 
>
> isLoggedin() && $access->check('Post')): ?>
>
> edit
> |
> link('delete', '/posts/delete/'.$post['Post']['id'],
> NULL, 'Are you sure?'); ?>
>
> 
> 
> 
> ---
>
> I got this error as I view Posts index:
> ---
> Fatal error: Class 'AccessComponent' not found in C:\wamp\www\cakephp
> \app\views\helpers\access.php on line 10
> ---
>
> Line 10 points to this:
> 
> $this->Access = new AccessComponent();
> -
>
> ~~
>
> What am I trying to accomplish ?
>
> The edit and delete links can only be viewed when User is logged in.
> If not logged in, only the Posts index and view page are viewable--
> without displaying the edit and delete links to the Guest users.
>
> ~~
>
> Is the method of doing wrong ? what is the suggested way ?
>
> Thanks,
> Maxim
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

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


HELP NEEDED with Auth "Component" in Views; Fatal error: (While using Auth component inside a helper)

2010-12-29 Thread John Maxim
Access = new AccessComponent();

App::import('Component', 'Auth');
$this->Auth = new AuthComponent();
$this->Auth->Session = $this->Session;

$this->user = $this->Auth->user();
}

function check($aco, $action='*'){
if(empty($this->user)) return false;
return $this->Access->checkHelper('User::'.$this->user['User']
['id'], $aco, $action);
}

function isLoggedin(){
return !empty($this->user);
}
}
?>



This access.php file is saved in app/views/helpers

In "Posts" Controller, I have added: var $helpers = array('Access');

So it can be accessed from the view.


My Posts index is here:
--
 Welcome to my CakePHP Blog







isLoggedin() && $access->check('Post')): ?>

edit
|
link('delete', '/posts/delete/'.$post['Post']['id'],
NULL, 'Are you sure?'); ?>




---

I got this error as I view Posts index:
---
Fatal error: Class 'AccessComponent' not found in C:\wamp\www\cakephp
\app\views\helpers\access.php on line 10
---

Line 10 points to this:

$this->Access = new AccessComponent();
-

~~

What am I trying to accomplish ?

The edit and delete links can only be viewed when User is logged in.
If not logged in, only the Posts index and view page are viewable--
without displaying the edit and delete links to the Guest users.

~~

Is the method of doing wrong ? what is the suggested way ?

Thanks,
Maxim

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-28 Thread AD7six


On Dec 28, 3:55 am, John Maxim  wrote:
> Hi Jeremy, Thanks for your link will definitely look into that.
>
> ~~Continue my question~~
> I was going to ask about using this:http://book.cakephp.org/view/1027/query
>
> There are 2 options if I'm correct based on cookbook 1.3
> ~~
> Rather than using an auto-increment key as the primary key, you may
> also use char(36). Cake will then use a unique 36 character uuid
> (String::uuid) whenever you save a new record using the Model::save
> method.
>
> according to:http://book.cakephp.org/view/903/Model-and-Database-Conventions
> ~~
> What's the advantage of using char(36) ?

A uuid (a 36 char string) is unique - always. It's main purpose is to
be unique, nothing else. Obfuscation is a side effect, not the goal.

They are most relevant with distributed datastores whereby you need to
synchronize data and inserts across multiple servers. An insert on
server A can safely and without concern be replicated to server B
because a row with the same ID cannot exist originating from another
server.

http://en.wikipedia.org/wiki/Universally_unique_identifier

AD

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-28 Thread Jeremy Burns | Class Outfit
I would also add that it can be difficult to work with if you need to transpose 
or retype/re-enter the ids at any time. Having said all that, I think UUIDs 
have a definite place in an app.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Dec 2010, at 20:59, Ryan Schmidt wrote:

> 
> On Dec 28, 2010, at 04:39, Jeremy Burns | Class Outfit wrote:
> 
>> I *think* the main benefit is obfuscation - if you want to hide the fact 
>> that I am only the third user, for example. It also makes it more difficult 
>> to guess the id belonging to another row in the table (for example, a table 
>> that stores company records).
> 
> That's what I would think as well. Take for example Craig's List. Each ad has 
> an auto-increment id, which appears in the email address that you use to 
> respond to the ad, e.g. "sale-12345678 at craigslist dot org". I imagine they 
> were getting a lot of spam under that system, since if you can see what one 
> ad's id is, you can guess others. So now they insert a hash of some kind in 
> addition to that id, e.g. "sale-m4m92-12345678 at craigslist dot org". Now 
> even if you know the sequence of auto-increment ids they use, you can't guess 
> the hash. If they were redesigning the system today, maybe they would omit 
> the auto-increment id altogether and use only a hash (though it would have to 
> be much longer than 5 characters to avoid collisions).
> 
> Obfuscation shouldn't be your only security measure, but it can be a helpful 
> additional step in some situations.
> 
> 
> 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

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-28 Thread Ryan Schmidt

On Dec 28, 2010, at 04:39, Jeremy Burns | Class Outfit wrote:

> I *think* the main benefit is obfuscation - if you want to hide the fact that 
> I am only the third user, for example. It also makes it more difficult to 
> guess the id belonging to another row in the table (for example, a table that 
> stores company records).

That's what I would think as well. Take for example Craig's List. Each ad has 
an auto-increment id, which appears in the email address that you use to 
respond to the ad, e.g. "sale-12345678 at craigslist dot org". I imagine they 
were getting a lot of spam under that system, since if you can see what one 
ad's id is, you can guess others. So now they insert a hash of some kind in 
addition to that id, e.g. "sale-m4m92-12345678 at craigslist dot org". Now even 
if you know the sequence of auto-increment ids they use, you can't guess the 
hash. If they were redesigning the system today, maybe they would omit the 
auto-increment id altogether and use only a hash (though it would have to be 
much longer than 5 characters to avoid collisions).

Obfuscation shouldn't be your only security measure, but it can be a helpful 
additional step in some situations.


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: Urgent help needed: Test Tables are gone, How to re-install simpletest ?

2010-12-28 Thread John Maxim
Hi thanks Vivi, should have known this after running the tests and
checked earlier..

(SOLVED)

On Dec 28, 5:17 pm, Vivi Vivi  wrote:
> The test tables are created only when you run the tests, after it finished
> the tables are deleted.
> The tables are created from fixtures.
>
>
>
> On Tue, Dec 28, 2010 at 10:02 AM, John Maxim  wrote:
> > Hi,
>
> > I forgot to create the database for $test, so the test suite tables
> > were populated into my $default database. I dropped all the tables in
> > phpMyAdmin and removed simpletest folder from my *app/vendors. I
> > thought by replacing a new one (simpletest) unzipping in *app/vendors
> > after creating my $test database would populate all the new test suite
> > tables into my test database--but there is not a single table. Weird
> > is I can still check the test case in localhost/MyAppName/test.php
>
> > Where are the tables ? What should I do to re-install ?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> --
> Vivihttp://photos.vr-3d.net

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-28 Thread Jeremy Burns | Class Outfit
I *think* the main benefit is obfuscation - if you want to hide the fact that I 
am only the third user, for example. It also makes it more difficult to guess 
the id belonging to another row in the table (for example, a table that stores 
company records). Disadvantages can be data size (a minor factor) and the loss 
of the ability to sort by that column (but created ought to do that for you 
instead).

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Dec 2010, at 02:55, John Maxim wrote:

> Hi Jeremy, Thanks for your link will definitely look into that.
> 
> ~~Continue my question~~
> I was going to ask about using this: http://book.cakephp.org/view/1027/query
> 
> There are 2 options if I'm correct based on cookbook 1.3
> ~~
> Rather than using an auto-increment key as the primary key, you may
> also use char(36). Cake will then use a unique 36 character uuid
> (String::uuid) whenever you save a new record using the Model::save
> method.
> 
> according to: http://book.cakephp.org/view/903/Model-and-Database-Conventions
> ~~
> What's the advantage of using char(36) ?
> ~~
> 
> On Dec 27, 7:18 pm, Jeremy Burns | Class Outfit
>  wrote:
>> I would always have a non-inteligent single field as the primary key (id) 
>> and then have a multiple field unique index on the other two fields. I'd 
>> also index them independently for joins and performance. Your second 
>> solution looks closest and it's also the way Cake works. 
>> Seehttp://articles.classoutfit.com/2010/02/cakephp-basic-database-table-...
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 27 Dec 2010, at 07:33, John Maxim wrote:
>> 
>>> Hi everyone,
>> 
>>> I'm currently creating a table called "Foods_Ingredients", here is the
>>> sql:
>> 
>>> CREATE TABLE IF NOT EXISTS `foods_ingredients` (
>>> `food_id` int(11) NOT NULL AUTO_INCREMENT,
>>> `ingredient_id` int(11) NOT NULL AUTO_INCREMENT,
>>> PRIMARY KEY (`food_id`,`ingredient_id`)
>>> ) ENGINE=InnoDB
>> 
>>> --
>>> The problem now  is I find this table has to have composite primary
>>> key. Cake currently doesn't support composite, I'm not sure what is
>>> the workaround for this.
>> 
>>> 1. Do I change to UNIQUE KEY ? I went briefly with the cookbook,
>>> finding it hard to understand, can anyone suggest a solution for
>>> this ?
>> 
>>> 2. Do I just add a field `id` into it ?--so it becomes the PK? Adding
>>> this seems a bit odd.
>>> 
>>> CREATE TABLE IF NOT EXISTS `foods_ingredients` (
>>> `id` int(11) NOT NULL AUTO_INCREMENT,
>>> `food_id` int(11) NOT NULL,
>>> `ingredient_id` int(11) NOT NULL,
>>> PRIMARY KEY (`id`),
>>> UNIQUE KEY `food_id_ingredient_id` (`food_id`,`ingredient_id`)
>>> ) ENGINE=InnoDB
>>> 
>> 
>>> What is the suggested solution for this ? from veterans/experienced
>>> Cake users.
>> 
>>> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
>>> athttp://groups.google.com/group/cake-php?hl=en
> 
> 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

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: Urgent help needed: Test Tables are gone, How to re-install simpletest ?

2010-12-28 Thread Vivi Vivi
The test tables are created only when you run the tests, after it finished
the tables are deleted.
The tables are created from fixtures.

On Tue, Dec 28, 2010 at 10:02 AM, John Maxim  wrote:

> Hi,
>
> I forgot to create the database for $test, so the test suite tables
> were populated into my $default database. I dropped all the tables in
> phpMyAdmin and removed simpletest folder from my *app/vendors. I
> thought by replacing a new one (simpletest) unzipping in *app/vendors
> after creating my $test database would populate all the new test suite
> tables into my test database--but there is not a single table. Weird
> is I can still check the test case in localhost/MyAppName/test.php
>
> Where are the tables ? What should I do to re-install ?
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Vivi
http://photos.vr-3d.net

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


Urgent help needed: Test Tables are gone, How to re-install simpletest ?

2010-12-28 Thread John Maxim
Hi,

I forgot to create the database for $test, so the test suite tables
were populated into my $default database. I dropped all the tables in
phpMyAdmin and removed simpletest folder from my *app/vendors. I
thought by replacing a new one (simpletest) unzipping in *app/vendors
after creating my $test database would populate all the new test suite
tables into my test database--but there is not a single table. Weird
is I can still check the test case in localhost/MyAppName/test.php

Where are the tables ? What should I do to re-install ?

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-27 Thread John Maxim
Hi Jeremy, Thanks for your link will definitely look into that.

~~Continue my question~~
I was going to ask about using this: http://book.cakephp.org/view/1027/query

There are 2 options if I'm correct based on cookbook 1.3
~~
Rather than using an auto-increment key as the primary key, you may
also use char(36). Cake will then use a unique 36 character uuid
(String::uuid) whenever you save a new record using the Model::save
method.

according to: http://book.cakephp.org/view/903/Model-and-Database-Conventions
~~
What's the advantage of using char(36) ?
~~

On Dec 27, 7:18 pm, Jeremy Burns | Class Outfit
 wrote:
> I would always have a non-inteligent single field as the primary key (id) and 
> then have a multiple field unique index on the other two fields. I'd also 
> index them independently for joins and performance. Your second solution 
> looks closest and it's also the way Cake works. 
> Seehttp://articles.classoutfit.com/2010/02/cakephp-basic-database-table-...
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 27 Dec 2010, at 07:33, John Maxim wrote:
>
> > Hi everyone,
>
> > I'm currently creating a table called "Foods_Ingredients", here is the
> > sql:
>
> > CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> > `food_id` int(11) NOT NULL AUTO_INCREMENT,
> > `ingredient_id` int(11) NOT NULL AUTO_INCREMENT,
> > PRIMARY KEY (`food_id`,`ingredient_id`)
> > ) ENGINE=InnoDB
>
> > --
> > The problem now  is I find this table has to have composite primary
> > key. Cake currently doesn't support composite, I'm not sure what is
> > the workaround for this.
>
> > 1. Do I change to UNIQUE KEY ? I went briefly with the cookbook,
> > finding it hard to understand, can anyone suggest a solution for
> > this ?
>
> > 2. Do I just add a field `id` into it ?--so it becomes the PK? Adding
> > this seems a bit odd.
> > 
> > CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> > `id` int(11) NOT NULL AUTO_INCREMENT,
> > `food_id` int(11) NOT NULL,
> > `ingredient_id` int(11) NOT NULL,
> > PRIMARY KEY (`id`),
> > UNIQUE KEY `food_id_ingredient_id` (`food_id`,`ingredient_id`)
> > ) ENGINE=InnoDB
> > 
>
> > What is the suggested solution for this ? from veterans/experienced
> > Cake users.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
> > athttp://groups.google.com/group/cake-php?hl=en

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: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-27 Thread Jeremy Burns | Class Outfit
I would always have a non-inteligent single field as the primary key (id) and 
then have a multiple field unique index on the other two fields. I'd also index 
them independently for joins and performance. Your second solution looks 
closest and it's also the way Cake works. See 
http://articles.classoutfit.com/2010/02/cakephp-basic-database-table-tuning-tips/

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 27 Dec 2010, at 07:33, John Maxim wrote:

> Hi everyone,
> 
> I'm currently creating a table called "Foods_Ingredients", here is the
> sql:
> 
> CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> `food_id` int(11) NOT NULL AUTO_INCREMENT,
> `ingredient_id` int(11) NOT NULL AUTO_INCREMENT,
> PRIMARY KEY (`food_id`,`ingredient_id`)
> ) ENGINE=InnoDB
> 
> --
> The problem now  is I find this table has to have composite primary
> key. Cake currently doesn't support composite, I'm not sure what is
> the workaround for this.
> 
> 1. Do I change to UNIQUE KEY ? I went briefly with the cookbook,
> finding it hard to understand, can anyone suggest a solution for
> this ?
> 
> 2. Do I just add a field `id` into it ?--so it becomes the PK? Adding
> this seems a bit odd.
> 
> CREATE TABLE IF NOT EXISTS `foods_ingredients` (
> `id` int(11) NOT NULL AUTO_INCREMENT,
> `food_id` int(11) NOT NULL,
> `ingredient_id` int(11) NOT NULL,
> PRIMARY KEY (`id`),
> UNIQUE KEY `food_id_ingredient_id` (`food_id`,`ingredient_id`)
> ) ENGINE=InnoDB
> 
> 
> What is the suggested solution for this ? from veterans/experienced
> Cake users.
> 
> 
> 
> 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

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


Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

2010-12-26 Thread John Maxim
Hi everyone,

I'm currently creating a table called "Foods_Ingredients", here is the
sql:

CREATE TABLE IF NOT EXISTS `foods_ingredients` (
`food_id` int(11) NOT NULL AUTO_INCREMENT,
`ingredient_id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`food_id`,`ingredient_id`)
) ENGINE=InnoDB

--
The problem now  is I find this table has to have composite primary
key. Cake currently doesn't support composite, I'm not sure what is
the workaround for this.

1. Do I change to UNIQUE KEY ? I went briefly with the cookbook,
finding it hard to understand, can anyone suggest a solution for
this ?

2. Do I just add a field `id` into it ?--so it becomes the PK? Adding
this seems a bit odd.

CREATE TABLE IF NOT EXISTS `foods_ingredients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`food_id` int(11) NOT NULL,
`ingredient_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `food_id_ingredient_id` (`food_id`,`ingredient_id`)
) ENGINE=InnoDB


What is the suggested solution for this ? from veterans/experienced
Cake users.



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


Help needed sending tcp with syn to specific ip address

2010-05-21 Thread dilip bakotiya
Hi

i want to send  tcp to specific ip address with syn bit set so how i can set
at php


Thanks

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: Set class help needed

2010-03-31 Thread cricket
On Mar 31, 10:16 am, "Dr. Loboto"  wrote:
> If you pass "fields" option to find("list") as described for grouping
> - this will do all the magic.

Thanks, both, for the tip. I'd forgotten about that option (I don't
think I've used it before). I'm not sure that it'll work in this case,
though, as I'm querying the members table and containing both
countries & regions for the names.

I've already got a complicated method to retrieve a list of countries
and regions that is used elsewhere. In the other place, I'm creating a
list of links of country names, with sublists of regions for those
countries that have them. The former are links to /members/country/[A-
Z]{2} and the latter, /members/region/[A-Z]{2}. Getting the list
involves querying on distinct Member.country_id and distinct
Member.region_id and then merging the two. So, only countries and
regions that have members are represented.

public function locations()
{
$countries = Set::extract(
$this->find(
'all',
array(
'fields' => 
array('DISTINCT(Member.country_id)'),
'contain' => array(
'Country' => array(
'fields' => array('*')
)
)
)
),
'{n}.Country'
);

foreach($countries as $key => $country)
{
if (in_array($country['iso_code'], array('US', 'CA')))
{
$countries[$key]['regions'] = Set::extract(
$this->find(
'all',
array(
'fields' => 
array('DISTINCT(Member.region_id)'),
'conditions' => array(
'NOT' => 
array('Member.region_id' => null),
'Member.country_id' => 
$country['id']
),
'contain' => array(
'Region' => array(
'fields' => 
array('*'),
'order' => 
array('Region.name' => 'ASC')
)
)
)
),
'{n}.Region'
);
}
}
return $countries;
}

This results in the array I posted earlier as the data I was starting
out with. Now, I need to create a select list from that data to show
elsewhere. Of course, I can't have the form point to both country and
region so I decided to only list the regions, grouped by country. In
this case, that's US & Canada. Other countries are not presented. This
suits the client because their membership is limited to those two.
However, there are edge cases where existing members live abroad.

What I ended up doing is abandoning Set and doing it the old-fashioned
way:

$options = array();
foreach($data as $k => $d)
{
if (!in_array($d['iso_code'], array('US', 'CA')))
{
unset($data[$k]);
}
else
{
$options[$d['name']] = array();

foreach($d['regions'] as $region)
{
$options[$d['name']][$region['iso_code']] = 
$region['name'];
}
}
}

It's damned ugly but it works. I'm using requestAction() and caching
the elements, so I'm not too concerned about the overhead.

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

To unsubscribe, reply using "remove me" as the subject.


Re: Set class help needed

2010-03-31 Thread Dr. Loboto
If you pass "fields" option to find("list") as described for grouping
- this will do all the magic.

On Mar 31, 3:13 pm, WebbedIT  wrote:
> Does the form helper automagically create select lists with OPTGROUPS?

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

To unsubscribe, reply using "remove me" as the subject.


Re: Set class help needed

2010-03-31 Thread WebbedIT
Does the form helper automagically create select lists with OPTGROUPS?

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

To unsubscribe, reply using "remove me" as the subject.


Re: Set class help needed

2010-03-30 Thread gmansilla
I would use Model::find('list'), and let cakephp do its magic

On 30 mar, 11:20, cricket  wrote:
> I have an array of country data that I'm trying to adjust so it's
> suitable to pass to FormHelper for select options with optgroup
> labels. Set::combine has gotten me almost there but not quite.
>
> Here's the data:
>
> Array
> (
>     [0] => Array
>         (
>             [id] => 1
>             [iso_code] => US
>             [name] => United States
>             [regions] => Array
>                 (
>                     [0] => Array
>                         (
>                             [id] => 4
>                             [country_id] => 1
>                             [iso_code] => AZ
>                             [name] => Arizona
>                         )
>
>                     [1] => Array
>                         (
>                             [id] => 7
>                             [country_id] => 1
>                             [iso_code] => CA
>                             [name] => California
>                         )
>                         ...
>                     [30] => Array
>                         (
>                             [id] => 63
>                             [country_id] => 1
>                             [iso_code] => WI
>                             [name] => Wisconsin
>                         )
>
>                 )
>
>         )
>
>     [1] => Array
>         (
>             [id] => 2
>             [iso_code] => CA
>             [name] => Canada
>             [regions] => Array
>                 (
>                     [0] => Array
>                         (
>                             [id] => 6
>                             [country_id] => 2
>                             [iso_code] => BC
>                             [name] => British Columbia
>                         )
>                         ...
>
> I tried:
>
> $options = Set::combine(
>         $data,
>     '{n}.name',
>         '{n}.regions.{n}.name'
> );
>
> This creates:
>
> Array
> (
>     [United States] => Array
>         (
>             [0] => Arizona
>             [1] => California
>             [2] => Colorado
>                         ...
>         )
>
>     [Canada] => Array
>         (
>             [0] => British Columbia
>                         ...
>
> What I require:
>
> Array
> (
>     [United States] => Array
>         (
>             [AZ] => Arizona
>             [CA] => California
>             [CO] => Colorado
>                         ...
>         )
>
>     [Canada] => Array
>         (
>             [BC] => British Columbia
>                         ...
>
> Can anyone think of a way to do that with Set?

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

To unsubscribe, reply using "remove me" as the subject.


Set class help needed

2010-03-30 Thread cricket
I have an array of country data that I'm trying to adjust so it's
suitable to pass to FormHelper for select options with optgroup
labels. Set::combine has gotten me almost there but not quite.

Here's the data:

Array
(
[0] => Array
(
[id] => 1
[iso_code] => US
[name] => United States
[regions] => Array
(
[0] => Array
(
[id] => 4
[country_id] => 1
[iso_code] => AZ
[name] => Arizona
)

[1] => Array
(
[id] => 7
[country_id] => 1
[iso_code] => CA
[name] => California
)
...
[30] => Array
(
[id] => 63
[country_id] => 1
[iso_code] => WI
[name] => Wisconsin
)

)

)

[1] => Array
(
[id] => 2
[iso_code] => CA
[name] => Canada
[regions] => Array
(
[0] => Array
(
[id] => 6
[country_id] => 2
[iso_code] => BC
[name] => British Columbia
)
...

I tried:

$options = Set::combine(
$data,
'{n}.name',
'{n}.regions.{n}.name'
);

This creates:

Array
(
[United States] => Array
(
[0] => Arizona
[1] => California
[2] => Colorado
...
)

[Canada] => Array
(
[0] => British Columbia
...

What I require:

Array
(
[United States] => Array
(
[AZ] => Arizona
[CA] => California
[CO] => Colorado
...
)

[Canada] => Array
(
[BC] => British Columbia
...

Can anyone think of a way to do that with Set?

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


help needed to install vamcart CakePHP on GoDaddy

2010-03-21 Thread vkosta
Help Needed!!!

I've read previous post but I still got some problems with installing
CakePHP vamcart (http://vamcart.com) on GoDaddy.

1 -  .htaccess on root directory of CakePHP app

AddDefaultCharset utf-8

 IfModule mod_rewrite.c
   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]
 /IfModule

2 -  .htaccess on app directory of CakePHP app

 IfModule mod_rewrite.c
RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 /IfModule

3 -  .htaccess on webroot directory of CakePHP app

 IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
 /IfModule

 IfModule mod_deflate.c
AddOutputFilterByType DEFLATE text/html text/plain text/css text/
javascript application/x-javascript
 /IfModule>

 IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 10 years"
  ExpiresByType text/js "access plus 10 years"
  ExpiresByType text/javascript "access plus 10 years"
  ExpiresByType application/x-javascript "access plus 10 years"
  ExpiresByType application/javascript "access plus 10 years"
  ExpiresByType image/png "access plus 10 years"
  ExpiresByType image/gif "access plus 10 years"
  ExpiresByType image/jpeg "access plus 10 years"
 /IfModule

FileETag none

Tried to change it to

 IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
/IfModule

but without success

Please, give some advise

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Serious Help Needed

2009-11-24 Thread grigri
Amit's code won't work as-is, because the keys are being duplicated.

For example, try this in an example script:

$test = array(
  'Bacon' => array('Yummy'),
  'Bacon' => array('Delicious')
);

print_r($test);

You'll see that the first declaration has disappeared. You can only
use a key once in an array.

For validation purposes, do it like this:

var $validate = array(
'email' => array(
array(
'rule' => array('email', 'isUnique'),
'required' => true,
'allowEmpty' => false,
'on' => 'create',
'message' => 'Your Error Message'
),
array(
'rule' => array('email', 'isUnique'),
'allowEmpty' => false,
'on' => 'update',
'message' => 'Your Error Message'
)
),
);

This way both rules will be observed as there are no duplicate keys.

hth
grigri

On Nov 23, 4:54 am, Dave  wrote:
> When you put it like that its so easy to understand. I read the
> cookbook but your example is 100 times better and clearly explained
> when you lay it out like that. thank you very much. that looks like
> exactly what I need.
>
> Good looking out!
>
> Thanks,
>
> Dave
>
> On Nov 23, 1:29 am, Amit  wrote:
>
> > Take a look at the CakeBook 
> > -http://book.cakephp.org/view/127/One-Rule-Per-Field
>
> > var $validate = array(
> >     'email' => array(
> >         'rule' => array('email', 'isUnique'),
> >         'required' => true,
> >         'allowEmpty' => false,
> >         'on' => 'create',
> >         'message' => 'Your Error Message'
> >     ),
> >     'email' => array(
> >         'rule' => array('email', 'isUnique'),
> >         'allowEmpty' => false,
> >         'on' => 'update',
> >         'message' => 'Your Error Message'
> >     ),
> >     'url' => array(
> >         'rule' => array('url', 'isUnique'),
> >         'required' => true,
> >         'allowEmpty' => false,
> >         'on' => 'create',
> >         'message' => 'Your Error Message'
> >     ),
> >     'url' => array(
> >         'rule' => array('url', 'isUnique'),
> >         'allowEmpty' => false,
> >         'on' => 'update',
> >         'message' => 'Your Error Message'
> >     ),
>
> > );
>
> > On Nov 22, 8:45 pm, Dave  wrote:
>
> > > I cant figure out how to do this.
> > > I have 2  fields, an email and a url, both are required and need to be
> > > unique when a user wants to update thier info.
>
> > > If the user is only updating 1 field the other required will fail
> > > because its required. If they enter in the email field their current
> > > email because it says required it will come back invalid because its
> > > no longer unique. Vice versa for the url.
>
> > > They may only want to change one of the 2 fields information but how
> > > can you get around this? I dont want them entering in anything thats
> > > not valid for email / url so i need the validation rules. They are
> > > both required but how can they edit just 1 field?
>
> > > Thanks,
>
> > > Dave
>
>

--

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=en.




Re: Serious Help Needed

2009-11-22 Thread Dave
When you put it like that its so easy to understand. I read the
cookbook but your example is 100 times better and clearly explained
when you lay it out like that. thank you very much. that looks like
exactly what I need.

Good looking out!

Thanks,

Dave

On Nov 23, 1:29 am, Amit  wrote:
> Take a look at the CakeBook 
> -http://book.cakephp.org/view/127/One-Rule-Per-Field
>
> var $validate = array(
>     'email' => array(
>         'rule' => array('email', 'isUnique'),
>         'required' => true,
>         'allowEmpty' => false,
>         'on' => 'create',
>         'message' => 'Your Error Message'
>     ),
>     'email' => array(
>         'rule' => array('email', 'isUnique'),
>         'allowEmpty' => false,
>         'on' => 'update',
>         'message' => 'Your Error Message'
>     ),
>     'url' => array(
>         'rule' => array('url', 'isUnique'),
>         'required' => true,
>         'allowEmpty' => false,
>         'on' => 'create',
>         'message' => 'Your Error Message'
>     ),
>     'url' => array(
>         'rule' => array('url', 'isUnique'),
>         'allowEmpty' => false,
>         'on' => 'update',
>         'message' => 'Your Error Message'
>     ),
>
> );
>
> On Nov 22, 8:45 pm, Dave  wrote:
>
> > I cant figure out how to do this.
> > I have 2  fields, an email and a url, both are required and need to be
> > unique when a user wants to update thier info.
>
> > If the user is only updating 1 field the other required will fail
> > because its required. If they enter in the email field their current
> > email because it says required it will come back invalid because its
> > no longer unique. Vice versa for the url.
>
> > They may only want to change one of the 2 fields information but how
> > can you get around this? I dont want them entering in anything thats
> > not valid for email / url so i need the validation rules. They are
> > both required but how can they edit just 1 field?
>
> > Thanks,
>
> > Dave
>
>

--

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: Serious Help Needed

2009-11-22 Thread Amit
Take a look at the CakeBook - 
http://book.cakephp.org/view/127/One-Rule-Per-Field

var $validate = array(
'email' => array(
'rule' => array('email', 'isUnique'),
'required' => true,
'allowEmpty' => false,
'on' => 'create',
'message' => 'Your Error Message'
),
'email' => array(
'rule' => array('email', 'isUnique'),
'allowEmpty' => false,
'on' => 'update',
'message' => 'Your Error Message'
),
'url' => array(
'rule' => array('url', 'isUnique'),
'required' => true,
'allowEmpty' => false,
'on' => 'create',
'message' => 'Your Error Message'
),
'url' => array(
'rule' => array('url', 'isUnique'),
'allowEmpty' => false,
'on' => 'update',
'message' => 'Your Error Message'
),

);

On Nov 22, 8:45 pm, Dave  wrote:
> I cant figure out how to do this.
> I have 2  fields, an email and a url, both are required and need to be
> unique when a user wants to update thier info.
>
> If the user is only updating 1 field the other required will fail
> because its required. If they enter in the email field their current
> email because it says required it will come back invalid because its
> no longer unique. Vice versa for the url.
>
> They may only want to change one of the 2 fields information but how
> can you get around this? I dont want them entering in anything thats
> not valid for email / url so i need the validation rules. They are
> both required but how can they edit just 1 field?
>
> Thanks,
>
> Dave

--

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: Serious Help Needed

2009-11-22 Thread death.au
You could omit the 'required' => true in the validation rules and keep
an 'allowEmpty' => false instead. This way upon sign up both fields
need to be filled in, but on changing, you don't need to submit both.
For the 'unique' problem, you might have to check if the email is the
same as what is already saved, and if so, don't bother saving it.

On Nov 23, 1:45 pm, Dave  wrote:
> I cant figure out how to do this.
> I have 2  fields, an email and a url, both are required and need to be
> unique when a user wants to update thier info.
>
> If the user is only updating 1 field the other required will fail
> because its required. If they enter in the email field their current
> email because it says required it will come back invalid because its
> no longer unique. Vice versa for the url.
>
> They may only want to change one of the 2 fields information but how
> can you get around this? I dont want them entering in anything thats
> not valid for email / url so i need the validation rules. They are
> both required but how can they edit just 1 field?
>
> Thanks,
>
> Dave

--

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=.




Serious Help Needed

2009-11-22 Thread Dave
I cant figure out how to do this.
I have 2  fields, an email and a url, both are required and need to be
unique when a user wants to update thier info.

If the user is only updating 1 field the other required will fail
because its required. If they enter in the email field their current
email because it says required it will come back invalid because its
no longer unique. Vice versa for the url.

They may only want to change one of the 2 fields information but how
can you get around this? I dont want them entering in anything thats
not valid for email / url so i need the validation rules. They are
both required but how can they edit just 1 field?

Thanks,

Dave

--

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=.




How to cakeamfphp help needed

2009-10-25 Thread www.landed.at

http://blog.madarco.net/32/simple-cakeamfphp-how-to/

I think I have installed things correctly but I'm unsure how to
proceed.  The link above gives a controller script, is this instead of
writing a service which is what you have to do in the regular amfphp ?

I think this should be obvious to someone who knows cake but for me im
learning that as well. There is no longer any support for cakeamfphp
so I have to post 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help needed! Submitting date field in MySQL

2009-08-13 Thread brian

The trouble is that there are 2 requests to the add action. The first,
which displays the form, has the date in the URL. But, when the form
is submitted, there is no date param. It points to
www.site.com/events/add. What you should do is create a hidden field
so that the date is already in $data.

function add($event_date = null)
{   
if (!empty($this->data))
{   
if ($this->Event->save($this->data))
{
...
}
else
{
/* set this in case form needs to be re-displayed
 */
$this->set('event_date', 
$this->data['Event']['event_date']);
}
}
else
{
/* set for initial display of form
 */
$this->set('event_date', $event_date);
}
}

view:
$form->hidden('Event.event_date', array('value' => $event_date));

You might consider putting a check on the date before the initial
set() for the view. If null, or if date_parse() returns false, you
could set it to today:

$this->set('event_date', date('Y-m-d'));

There's no need for $this->Event->event_date = $event_date;

Also, although you don't need it as well, the substr() & mktime()
stuff could have been avoided by doing:

$v = date('Y-m-d', strtotime($event_date));

However, even that's superfluous because you might as well just do:

$v = $event_date;

On Thu, Aug 13, 2009 at 4:02 AM, Schwamm wrote:
>
> I need urgent help!  I'm a novice at Cake and I'm having trouble
> getting a date saved in my SQL database.  I am trying to have the date
> save automatically depending on which day a user clicks on on a
> calendar to create a new event.  To do that, I added a parameter to my
> "add" function called $event_date, which was passed in the URL in the
> form -MM-DD, so my URL looks like www.site.com/events/add/2009-08-27
> .  This is my function currently:
>
> function add($event_date = null) {
>            $this->Event->event_date = $event_date;
>            $this->set('event_date',$event_date); //for use again in
> view
>            if (!empty($this->data)) {
>               $year = substr($event_date,0,4); //I broke my parameter
> down to use it in a unix time stamp.
>               $month = substr($event_date,5,2);
>               $day = substr($event_date,8,2);
>               $str = mktime(0,0,0,$month,$day,$year);
>               $v = date("Y-m-d",$str);
>
>                $this->data['Event']['event_date'] = $v; //here is
> where I think I have problems.
>                        if ($this->Event->save($this->data)) {
>                                $this->Session->setFlash('Your event has been 
> saved.');
>                                
> $this->redirect(array('controller'=>'events','action' =>
> 'calendar'));
>                                }
>            }
>        }
>
> I know this code is probably horrible and passing the whole date in
> one parameter is also not the best way to do things, but if anyone
> could enlighten me as to what I'm doing wrong it'd be very much
> appreciated!
>
> >
>

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



Help needed! Submitting date field in MySQL

2009-08-13 Thread Schwamm

I need urgent help!  I'm a novice at Cake and I'm having trouble
getting a date saved in my SQL database.  I am trying to have the date
save automatically depending on which day a user clicks on on a
calendar to create a new event.  To do that, I added a parameter to my
"add" function called $event_date, which was passed in the URL in the
form -MM-DD, so my URL looks like www.site.com/events/add/2009-08-27
.  This is my function currently:

function add($event_date = null) {
$this->Event->event_date = $event_date;
$this->set('event_date',$event_date); //for use again in
view
if (!empty($this->data)) {
   $year = substr($event_date,0,4); //I broke my parameter
down to use it in a unix time stamp.
   $month = substr($event_date,5,2);
   $day = substr($event_date,8,2);
   $str = mktime(0,0,0,$month,$day,$year);
   $v = date("Y-m-d",$str);

$this->data['Event']['event_date'] = $v; //here is
where I think I have problems.
if ($this->Event->save($this->data)) {
$this->Session->setFlash('Your event has been 
saved.');

$this->redirect(array('controller'=>'events','action' =>
'calendar'));
}
}
}

I know this code is probably horrible and passing the whole date in
one parameter is also not the best way to do things, but if anyone
could enlighten me as to what I'm doing wrong it'd be very much
appreciated!

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

2009-08-06 Thread John Andersen

Please confirm that in your SQL file, there is a table named
"focikic_photos"!

If there is, then look in your database and confirm that the table
exists with the name "focikic_photos"!

If it exists, then look in your model and confirm that the models
$useTable points to the name "focikic_photos"!

Enjoy,
   John

On Aug 6, 9:22 am, mridulesh kumar  wrote:
> i have added all the tables from the .sql file
> databse is also set
>
[snip]
--~--~-~--~~~---~--~~
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 needed

2009-08-05 Thread arif hossen
You can follow cakephp Convention below link:

http://book.cakephp.org/view/24/Model-and-Database-Conventions


On Wed, Aug 5, 2009 at 11:22 PM, mridulesh kumar wrote:

>
> i have added all the tables from the .sql file
> databse is also set
>
> On Aug 6, 12:38 am, Hols Kay  wrote:
> > You need to create a database table for Photos - if it's a third-party
> > application then there should be an SQL file somewhere that you need
> > to import into MySQL.
> >
> > On Aug 5, 6:19 pm, mridulesh kumar  wrote:
> >
> > > iam running a php application thts based on cake php frame work...on
> > > running the script iam getting a message as follows:
> >
> > > 1)
> > >" Missing Database Table
> > > No Database table for model Photo (expected focikic_photos), create it
> > > first.
> > > Notice: If you want to customize this error message, create app/views/
> > > errors/missing_table.ctp"
> >
> > > 2)"0 query took ms Nr  Query   Error   AffectedNum. rows
> Took (ms)"
> >
> > > whats the reason for this?..which of the file am supposed to edit in
> > > order to fix this issue.
> >
> > > mridulesh
> >
>


-- 
Dear Mr.Rayhan,



Regards,
Mohammad Arif Hossen
Web Developer
United Group International(UGIBD)
www.ugibd.net
Mobile no:  +88 01714355911
Mobile no:  +88 01922110308

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

2009-08-05 Thread mridulesh kumar

i have added all the tables from the .sql file
databse is also set

On Aug 6, 12:38 am, Hols Kay  wrote:
> You need to create a database table for Photos - if it's a third-party
> application then there should be an SQL file somewhere that you need
> to import into MySQL.
>
> On Aug 5, 6:19 pm, mridulesh kumar  wrote:
>
> > iam running a php application thts based on cake php frame work...on
> > running the script iam getting a message as follows:
>
> > 1)
> >        " Missing Database Table
> > No Database table for model Photo (expected focikic_photos), create it
> > first.
> > Notice: If you want to customize this error message, create app/views/
> > errors/missing_table.ctp"
>
> > 2)"0 query took ms Nr      Query   Error   Affected        Num. rows       
> > Took (ms)"
>
> > whats the reason for this?..which of the file am supposed to edit in
> > order to fix this issue.
>
> > mridulesh
--~--~-~--~~~---~--~~
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 needed

2009-08-05 Thread Hols Kay

You need to create a database table for Photos - if it's a third-party
application then there should be an SQL file somewhere that you need
to import into MySQL.

On Aug 5, 6:19 pm, mridulesh kumar  wrote:
> iam running a php application thts based on cake php frame work...on
> running the script iam getting a message as follows:
>
> 1)
>        " Missing Database Table
> No Database table for model Photo (expected focikic_photos), create it
> first.
> Notice: If you want to customize this error message, create app/views/
> errors/missing_table.ctp"
>
> 2)"0 query took ms Nr      Query   Error   Affected        Num. rows       
> Took (ms)"
>
> whats the reason for this?..which of the file am supposed to edit in
> order to fix this issue.
>
> mridulesh
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



help needed

2009-08-05 Thread mridulesh kumar

iam running a php application thts based on cake php frame work...on
running the script iam getting a message as follows:

1)
   " Missing Database Table
No Database table for model Photo (expected focikic_photos), create it
first.
Notice: If you want to customize this error message, create app/views/
errors/missing_table.ctp"

2)"0 query took ms Nr   Query   Error   AffectedNum. rows   Took 
(ms)"

whats the reason for this?..which of the file am supposed to edit in
order to fix this issue.


mridulesh


--~--~-~--~~~---~--~~
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: Urgent help needed

2009-08-03 Thread JamesF
> var $validate = array(
>   'fldCompanyName' => VALID_NOT_EMPTY,
>   'fldContactPerson' => VALID_EMAIL,
>   'fldAddress' => VALID_NUMBER
>);

the validate array in your model looks suspect.

try using the validation rules on this page:
http://book.cakephp.org/view/134/Core-Validation-Rules


On Aug 2, 1:18 pm, Rahul  wrote:
> Hello Guys,
>
> I am new with cake php and I am building a Invpoice Manager for one of
> my cleint . I am stuck with data valdation an need your help to figure
> out the error , data validation is not working . Plerase find all the
> code below:
>
> Controller
>  class AdminsController extends AppController {
>
>         var $name = 'Admins';
>         var $uses = array('Admin','User_role');
>
>         function index() {
>
>                 $this->set('admins', $this->Admin->find('all'));
>
>         }
>
>         function user_register() {
>
>                 if($this->Session->check('USER') == false)
>                 {
>                         $this->flash('Your session has been expired, please 
> login to
> continue.','/');
>                         return;
>                 }
>
>                 if (!empty($this->data)) {
>                          if ($this->Admin->save($this->data))
>                                 {
>                                         $this->Session->setFlash('Your post 
> has been saved.');
>                                         $this->redirect(array('action' => 
> 'success'));
>                                 }
>
>                         else
>                         {
>                                         $this->set('data', $this->data);
>                                         $this->validateErrors($this->data);
>                                         $this->render();
>
>                         }
>                 }
>         }
>
>         function user_role()
>         {
>
>                 if($this->Session->check('USER') == false)
>                 {
>                         $this->flash('Your session has been expired, please 
> login to
> continue.','/');
>                         return;
>                 }
>
>                 // get the list of all users for which there is no role data 
> in db
>                 $user_id = $_SESSION['USER'];
>                 $allNewCompanies = $this->Admin->__get_users_norole($user_id);
>                 $this->set('user_norole_list' , $allNewCompanies);
>         }
>
>         function assign_role($id)
>         {
>
>                 $this->set("company_id",$id);
>
>                 // form posted now handle data and save to db
>
>                 if( isset($_POST['submit']) || isset($this->data) )
>                 {
>
>                         /*
>                         if($this->User_role->validate())
>                         {
>                                 
> $this->Admin->__assign_user_role($this->data->rdAssignRole,$this->data->company_id);
>
>                         }
>                         else
>                         {
>                                 $errors = $this->User_role->invalidFields();
>                                 $this->Session->setFlash(implode('', 
> $errors));
>
>                         }
>                         */
>                         if(!empty($_POST['role_id']))
>                         {
>                                 
> $this->Admin->__assign_user_role($_POST['company_id'],$_POST
> ['role_id']);
>                                 $this->Session->setFlash('Role has been 
> successfully assigned.');
>                                 $this->redirect(array('action' => 'success'));
>                         }
>                 }
>
>         }
>
>         function success()
>         {
>                 if($this->Session->check('USER') == false)
>                 {
>                         $this->flash('Your session has been expired, please 
> login to
> continue.','/');
>                         return;
>                 }
>         }
>
> }
>
> ?>
>
> model
> 
> class Admin extends AppModel {
>
>     var $name = 'Admin';
>         var $useTable = false;
>
>         var $validate = array(
>       'fldCompanyName' => VALID_NOT_EMPTY,
>       'fldContactPerson' => VALID_EMAIL,
>       'fldAddress' => VALID_NUMBER
>    );
>
>         // This is where the magic happens
>         function schema() {
>                 return array (
>                         'fldCompanyName' => array('type' => 'string', 
> 'length' => 60),
>                         'fldContactPerson' => array('type' => 'string', 
> 'length' => 60),
>                         'fldAddress' => array('type' => 'text', 'length' => 
> 100),
>                         'fldPhone' => array('type' => 'string', 'length' => 
> 8),
>                         'fldMobile' => array('type' => 'string', 'length' => 
> 10),
>                         'fldFax' => array('type' => 'string', 'length' => 8),
>                         'fldCSTNo' => array('type' => 'string', 'length'

Re: installation problem.........help needed

2009-08-02 Thread Hols Kay

Try the suggestions in this thread:
http://groups.google.com/group/cake-php/browse_thread/thread/889295952424caf9/245af39a60260f4c?#245af39a60260f4c

On Aug 2, 10:18 am, mridulesh kumar  wrote:
> i uploaded a cake php script in the webroot of my server.upon
> acceessing the index page iam getting a blank page.
> can anyone plz tell wats the issue.server is supporting all the
> requirements.
> help needed.
--~--~-~--~~~---~--~~
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: installation problem.........help needed

2009-08-02 Thread Vijay Kumbhar
Hello Mridulesh,

This problem is related with .htaccess at your root folder 7 which is in app
folder too.

Please add the document root path of the server before the line where
webroot is written.

It will be like


RewriteEngine on
RewriteRule^$add site_document_path here webroot/[L]
RewriteRule(.*) add site_document_path here  webroot/$1[L]
 

On Sun, Aug 2, 2009 at 9:13 PM, brian  wrote:

>
> core.php:
> Configure::write('debug', 2);
>
> Also, check the server's error log.
>
> On Sun, Aug 2, 2009 at 5:18 AM, mridulesh kumar
> wrote:
> >
> > i uploaded a cake php script in the webroot of my server.upon
> > acceessing the index page iam getting a blank page.
> > can anyone plz tell wats the issue.server is supporting all the
> > requirements.
> > help needed.
> >
> > >
> >
>
> >
>


-- 
Thanks & Regards,
Vijayk.
Co-founder (www.weboniselab.com)

"You Bring the Dreams, We'll Bring the Means"

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



Urgent help needed

2009-08-02 Thread Rahul

Hello Guys,

I am new with cake php and I am building a Invpoice Manager for one of
my cleint . I am stuck with data valdation an need your help to figure
out the error , data validation is not working . Plerase find all the
code below:

Controller
set('admins', $this->Admin->find('all'));

}


function user_register() {

if($this->Session->check('USER') == false)
{
$this->flash('Your session has been expired, please 
login to
continue.','/');
return;
}

if (!empty($this->data)) {
 if ($this->Admin->save($this->data))
{
$this->Session->setFlash('Your post has 
been saved.');
$this->redirect(array('action' => 
'success'));
}

else
{
$this->set('data', $this->data);
$this->validateErrors($this->data);
$this->render();


}
}
}

function user_role()
{

if($this->Session->check('USER') == false)
{
$this->flash('Your session has been expired, please 
login to
continue.','/');
return;
}

// get the list of all users for which there is no role data in 
db
$user_id = $_SESSION['USER'];
$allNewCompanies = $this->Admin->__get_users_norole($user_id);
$this->set('user_norole_list' , $allNewCompanies);
}


function assign_role($id)
{

$this->set("company_id",$id);

// form posted now handle data and save to db

if( isset($_POST['submit']) || isset($this->data) )
{

/*
if($this->User_role->validate())
{

$this->Admin->__assign_user_role($this->data->rdAssignRole,$this-
>data->company_id);
}
else
{
$errors = $this->User_role->invalidFields();
$this->Session->setFlash(implode('', 
$errors));

}
*/
if(!empty($_POST['role_id']))
{

$this->Admin->__assign_user_role($_POST['company_id'],$_POST
['role_id']);
$this->Session->setFlash('Role has been 
successfully assigned.');
$this->redirect(array('action' => 'success'));
}
}

}


function success()
{
if($this->Session->check('USER') == false)
{
$this->flash('Your session has been expired, please 
login to
continue.','/');
return;
}
}



}
?>

model
 VALID_NOT_EMPTY,
  'fldContactPerson' => VALID_EMAIL,
  'fldAddress' => VALID_NUMBER
   );


// This is where the magic happens
function schema() {
return array (
'fldCompanyName' => array('type' => 'string', 'length' 
=> 60),
'fldContactPerson' => array('type' => 'string', 
'length' => 60),
'fldAddress' => array('type' => 'text', 'length' => 
100),
'fldPhone' => array('type' => 'string', 'length' => 8),
'fldMobile' => array('type' => 'string', 'length' => 
10),
'fldFax' => array('type' => 'string', 'length' => 8),
'fldCSTNo' => array('type' => 'string', 'length' => 8),
'fldTINNo' => array('type' => 'string', 'length' => 8),
'fldRemarks' => array('type' => 'string', 'length' => 
8),
'fldEmail' => array('type' => 'string', 'length' => 8),
'fldWebUrl' => array('type' => 'string', 'length' => 12)
);
}


function __get_users_norole($user_id)
{
  $ret = $this->query("SELECT id FROM user_roles
   WHERE user_id = '$user_id'");

  if( $ret[0]['user_roles']['id'] == '' )
{
 $user_list = $this->query("SELECT * 
FROM companies
   WHERE id = '$user_id'");
 return $user_list;

}

  return ;
}

function __assign_user_role($u

Re: installation problem.........help needed

2009-08-02 Thread brian

core.php:
Configure::write('debug', 2);

Also, check the server's error log.

On Sun, Aug 2, 2009 at 5:18 AM, mridulesh kumar wrote:
>
> i uploaded a cake php script in the webroot of my server.upon
> acceessing the index page iam getting a blank page.
> can anyone plz tell wats the issue.server is supporting all the
> requirements.
> help needed.
>
> >
>

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



installation problem.........help needed

2009-08-02 Thread mridulesh kumar

i uploaded a cake php script in the webroot of my server.upon
acceessing the index page iam getting a blank page.
can anyone plz tell wats the issue.server is supporting all the
requirements.
help needed.

--~--~-~--~~~---~--~~
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: Set::merge help needed

2009-07-13 Thread brian
Thanks a heap! Yes, it was UNION I was trying (and failing) to
conceptualize. I always forget about that one.

But, I came up with another solution. First, I needed to adjust the
query to better work across several years. The MySQL manual mentions
using partial dates, eg. '2009-07-00' where a more precise date is
unknown or unnecessary. I need to group by month AND year so I changed
MONTHNAME() to:

DATE(CONCAT_WS('-', YEAR(in_date), MONTH(in_date), '01'))

I created a function:

CREATE FUNCTION YEARMONTH (in_date DATE) RETURNS DATE LANGUAGE SQL
BEGIN
RETURN DATE(CONCAT_WS('-', YEAR(in_date), MONTH(in_date), '01'));
END

Then I used a correlated subquery:

SELECT
COUNT(*) AS num_logins,
YEARMONTH(l.created) AS month,
(SELECT
COUNT(*) FROM downloads AS d
WHERE YEARMONTH(d.created) = month
) AS num_downloads
FROM logins AS l
GROUP BY month
ORDER BY month DESC;

Thanks again for the hint.

On Sun, Jul 12, 2009 at 7:50 PM, Martin Radosta wrote:
> On 07/12/2009 07:16 PM, Martin Radosta wrote:
>
> On 07/11/2009 02:06 PM, brian wrote:
>
> I have a StatsController with which I'd like to make a summary of all
> logins and all downloads for each month.
>
> class Login extends AppModel
> {
> public $belongsTo = array('User');
> public $hasMany = array('Download');
> }
>
> class Download extends AppModel
> {
> public $belongsTo = array(
>     'ItemFile', 'User', 'Login'
> );
> }
>
> I can easily create separate queries but would need to merge them. i
> haven't been able to figure that part out.
>
> public function admin_summary()
> {
> $logins = $this->Login->find(
>     'all',
>     array(
>     'fields' =>  array(
>     'MONTHNAME(created) AS month',
>     'COUNT(*) AS num_logins'
>     ),
>     'recursive' =>  -1,
>     'group' =>  array('month')
>     )
> );
> $downloads = $this->Download->find(
>     'all',
>     array(
>     'fields' =>  array(
>     'MONTHNAME(created) AS month',
>     'COUNT(*) AS num_downloads'
>     ),
>     'recursive' =>  -1,
>     'group' =>  array('month')
>     )
> );
> // ...
> }
>
> This gives me:
>
> Array
> (
> [0] =>  Array
> (
>     [Login] =>  Array
>     (
>     [month] =>  July
>     [num_logins] =>  16
>     )
> )
> [1] =>  Array
> (
>     [Login] =>  Array
>     (
>     [month] =>  June
>     [num_logins] =>  168
>     )
> )
> [2] =>  Array
> (
>     [Login] =>  Array
>     (
>     [month] =>  May
>     [num_logins] =>  64
>     )
> )
> )
>
>
> app/controllers/stats_controller.php (line 171)
>
> Array
> (
> [0] =>  Array
> (
>     [Download] =>  Array
>     (
>     [month] =>  July
>     [num_downloads] =>  11
>     )
> )
> [1] =>  Array
> (
>     [Download] =>  Array
>     (
>     [month] =>  June
>     [num_downloads] =>  367
>     )
> )
> [2] =>  Array
> (
>     [Download] =>  Array
>     (
>     [month] =>  May
>     [num_downloads] =>  15
>     )
> )
> )
>
> What I'm after is something like:
>
> Array
> (
> [0] =>  Array
> (
>     'July' =>  array(
>     'Download' =>  Array
>     (
>     'num_downloads' =>  11
>     ),
>     'Login' =>  Array
>     (
>     'num_logins' =>  16
>     )
>     )
> )
> ...
> )
>
> or even ...
>
> Array
> (
> [0] =>  Array
> (
>     'July' =>  array(
>     'Download' =>  11,
>     'Login' =>  16
>     )
> )
> ...
> )
>
>
> Incidentally, I've been tryng to figure out a way to do this in a
> single query (MySQL) but I get strange results:
>
> mysql>  SELECT MONTHNAME(created) AS month, COUNT(*) AS num_logins FROM
> logins GROUP BY month;
> +---++
> | month | num_logins |
> +---++
> | July  | 15 |
> | June  |    168 |
> | May   | 64 |
> +---++
> 3 rows in set (0.00 sec)
>
> mysql>  SELECT MONTHNAME(created) AS month, COUNT(*) AS num_downloads
> FROM downloads GROUP BY month;
> +---+---+
> | month | num_downloads |
> +---+---+
> | July  |    11 |
> | June  |   367 |
> | May   |    15 |
> +---+---+
> 3 rows in set (0.00 sec)
>
> mysql>  SELECT MONTHNAME(l.created) AS month, COUNT(l.id) AS
> num_logins, COUNT(d.id) AS num_downloads FROM logins AS l LEFT JOIN
> downloads AS d ON d.login_id = l.id GROUP BY month;
> +---++---+
> | month | num_logins | num_downloads |
> +---++---+
> | July  | 20 |    11 |
> | June  |    477 |   367 |
> | May   | 71 |    15 |
> +--

Re: Set::merge help needed

2009-07-12 Thread Martin Radosta
On 07/12/2009 07:16 PM, Martin Radosta wrote:
> On 07/11/2009 02:06 PM, brian wrote:
>> I have a StatsController with which I'd like to make a summary of all
>> logins and all downloads for each month.
>>
>> class Login extends AppModel
>> {
>> public $belongsTo = array('User');
>> public $hasMany = array('Download');
>> }
>>
>> class Download extends AppModel
>> {
>> public $belongsTo = array(
>> 'ItemFile', 'User', 'Login'
>> );
>> }
>>
>> I can easily create separate queries but would need to merge them. i
>> haven't been able to figure that part out.
>>
>> public function admin_summary()
>> {
>> $logins = $this->Login->find(
>> 'all',
>> array(
>> 'fields' =>  array(
>> 'MONTHNAME(created) AS month',
>> 'COUNT(*) AS num_logins'
>> ),
>> 'recursive' =>  -1,
>> 'group' =>  array('month')
>> )
>> );
>> $downloads = $this->Download->find(
>> 'all',
>> array(
>> 'fields' =>  array(
>> 'MONTHNAME(created) AS month',
>> 'COUNT(*) AS num_downloads'
>> ),
>> 'recursive' =>  -1,
>> 'group' =>  array('month')
>> )
>> );
>> // ...
>> }
>>
>> This gives me:
>>
>> Array
>> (
>> [0] =>  Array
>> (
>> [Login] =>  Array
>> (
>> [month] =>  July
>> [num_logins] =>  16
>> )
>> )
>> [1] =>  Array
>> (
>> [Login] =>  Array
>> (
>> [month] =>  June
>> [num_logins] =>  168
>> )
>> )
>> [2] =>  Array
>> (
>> [Login] =>  Array
>> (
>> [month] =>  May
>> [num_logins] =>  64
>> )
>> )
>> )
>>
>>
>> app/controllers/stats_controller.php (line 171)
>>
>> Array
>> (
>> [0] =>  Array
>> (
>> [Download] =>  Array
>> (
>> [month] =>  July
>> [num_downloads] =>  11
>> )
>> )
>> [1] =>  Array
>> (
>> [Download] =>  Array
>> (
>> [month] =>  June
>> [num_downloads] =>  367
>> )
>> )
>> [2] =>  Array
>> (
>> [Download] =>  Array
>> (
>> [month] =>  May
>> [num_downloads] =>  15
>> )
>> )
>> )
>>
>> What I'm after is something like:
>>
>> Array
>> (
>> [0] =>  Array
>> (
>> 'July' =>  array(
>> 'Download' =>  Array
>> (
>> 'num_downloads' =>  11
>> ),
>> 'Login' =>  Array
>> (
>> 'num_logins' =>  16
>> )
>> )
>> )
>> ...
>> )
>>
>> or even ...
>>
>> Array
>> (
>> [0] =>  Array
>> (
>> 'July' =>  array(
>> 'Download' =>  11,
>> 'Login' =>  16
>> )
>> )
>> ...
>> )
>>
>>
>> Incidentally, I've been tryng to figure out a way to do this in a
>> single query (MySQL) but I get strange results:
>>
>> mysql>  SELECT MONTHNAME(created) AS month, COUNT(*) AS num_logins FROM
>> logins GROUP BY month;
>> +---++
>> | month | num_logins |
>> +---++
>> | July  | 15 |
>> | June  |168 |
>> | May   | 64 |
>> +---++
>> 3 rows in set (0.00 sec)
>>
>> mysql>  SELECT MONTHNAME(created) AS month, COUNT(*) AS num_downloads
>> FROM downloads GROUP BY month;
>> +---+---+
>> | month | num_downloads |
>> +---+---+
>> | July  |11 |
>> | June  |   367 |
>> | May   |15 |
>> +---+---+
>> 3 rows in set (0.00 sec)
>>
>> mysql>  SELECT MONTHNAME(l.created) AS month, COUNT(l.id) AS
>> num_logins, COUNT(d.id) AS num_downloads FROM logins AS l LEFT JOIN
>> downloads AS d ON d.login_id = l.id GROUP BY month;
>> +---++---+
>> | month | num_logins | num_downloads |
>> +---++---+
>> | July  | 20 |11 |
>> | June  |477 |   367 |
>> | May   | 71 |15 |
>> +---++---+
>> 3 rows in set (0.23 sec)
>>
>> I figure it's because month is related to logins, not downloads.
>> However, it seems odd that it's the login numbers that are wonky, not
>> downloads. If anyone can think of a way to do this in one query I'd
>> really appreciate it.
>>
>> >>
> Try this and let me know if it works:
>
> SELECT MONTHNAME(l.created) AS month, COUNT(l.id) AS
> num_logins, COUNT(d.id) AS num_downloads FROM logins AS l INNER JOIN
> downloads AS d ON d.login_id = l.id GROUP BY month;
>
>


Sorry, did'nt read your problem in detail, try this query:

|SELECT MONTH , min( num_downloads ) AS num_downloads, min( num_logins ) 
AS num_logins
FROM (
SELECT MONTHNAME( created ) AS
MONTH , COUNT( 1 ) AS num_downloads, NULL AS num_logins
FROM download

Re: Set::merge help needed

2009-07-12 Thread Martin Radosta

On 07/11/2009 02:06 PM, brian wrote:
> I have a StatsController with which I'd like to make a summary of all
> logins and all downloads for each month.
>
> class Login extends AppModel
> {
>   public $belongsTo = array('User');
>   public $hasMany = array('Download');
> }
>
> class Download extends AppModel
> {
>   public $belongsTo = array(
>   'ItemFile', 'User', 'Login'
>   );
> }
>
> I can easily create separate queries but would need to merge them. i
> haven't been able to figure that part out.
>
> public function admin_summary()
> {
>   $logins = $this->Login->find(
>   'all',
>   array(
>   'fields' =>  array(
>   'MONTHNAME(created) AS month',
>   'COUNT(*) AS num_logins'
>   ),
>   'recursive' =>  -1,
>   'group' =>  array('month')
>   )
>   );
>   $downloads = $this->Download->find(
>   'all',
>   array(
>   'fields' =>  array(
>   'MONTHNAME(created) AS month',
>   'COUNT(*) AS num_downloads'
>   ),
>   'recursive' =>  -1,
>   'group' =>  array('month')
>   )
>   );
>   // ...
> }
>
> This gives me:
>
> Array
> (
>   [0] =>  Array
>   (
>   [Login] =>  Array
>   (
>   [month] =>  July
>   [num_logins] =>  16
>   )
>   )
>   [1] =>  Array
>   (
>   [Login] =>  Array
>   (
>   [month] =>  June
>   [num_logins] =>  168
>   )
>   )
>   [2] =>  Array
>   (
>   [Login] =>  Array
>   (
>   [month] =>  May
>   [num_logins] =>  64
>   )
>   )
> )
>
>
> app/controllers/stats_controller.php (line 171)
>
> Array
> (
>   [0] =>  Array
>   (
>   [Download] =>  Array
>   (
>   [month] =>  July
>   [num_downloads] =>  11
>   )
>   )
>   [1] =>  Array
>   (
>   [Download] =>  Array
>   (
>   [month] =>  June
>   [num_downloads] =>  367
>   )
>   )
>   [2] =>  Array
>   (
>   [Download] =>  Array
>   (
>   [month] =>  May
>   [num_downloads] =>  15
>   )
>   )
> )
>
> What I'm after is something like:
>
> Array
> (
>   [0] =>  Array
>   (
>   'July' =>  array(
>   'Download' =>  Array
>   (
>   'num_downloads' =>  11
>   ),
>   'Login' =>  Array
>   (
>   'num_logins' =>  16
>   )
>   )
>   )
>   ...
> )
>
> or even ...
>
> Array
> (
>   [0] =>  Array
>   (
>   'July' =>  array(
>   'Download' =>  11,
>   'Login' =>  16
>   )
>   )
>   ...
> )
>
>
> Incidentally, I've been tryng to figure out a way to do this in a
> single query (MySQL) but I get strange results:
>
> mysql>  SELECT MONTHNAME(created) AS month, COUNT(*) AS num_logins FROM
> logins GROUP BY month;
> +---++
> | month | num_logins |
> +---++
> | July  | 15 |
> | June  |168 |
> | May   | 64 |
> +---++
> 3 rows in set (0.00 sec)
>
> mysql>  SELECT MONTHNAME(created) AS month, COUNT(*) AS num_downloads
> FROM downloads GROUP BY month;
> +---+---+
> | month | num_downloads |
> +---+---+
> | July  |11 |
> | June  |   367 |
> | May   |15 |
> +---+---+
> 3 rows in set (0.00 sec)
>
> mysql>  SELECT MONTHNAME(l.created) AS month, COUNT(l.id) AS
> num_logins, COUNT(d.id) AS num_downloads FROM logins AS l LEFT JOIN
> downloads AS d ON d.login_id = l.id GROUP BY month;
> +---++---+
> | month | num_logins | num_downloads |
> +---++---+
> | July  | 20 |11 |
> | June  |477 |   367 |
> | May   | 71 |15 |
> +---++---+
> 3 rows in set (0.23 sec)
>
> I figure it's because month is related to logins, not downloads.
> However, it seems odd that it's the login numbers that are wonky, not
> downloads. If anyone can think of a way to do this in one query I'd
> really appreciate it.
>
> >
>
Try this and let me know if it works:

SELECT MONTHNAME(l.created) AS month, COUNT(l.id) AS
num_logins

Set::merge help needed

2009-07-11 Thread brian

I have a StatsController with which I'd like to make a summary of all
logins and all downloads for each month.

class Login extends AppModel
{
public $belongsTo = array('User');
public $hasMany = array('Download');
}

class Download extends AppModel
{
public $belongsTo = array(
'ItemFile', 'User', 'Login'
);
}

I can easily create separate queries but would need to merge them. i
haven't been able to figure that part out.

public function admin_summary()
{
$logins = $this->Login->find(
'all',
array(
'fields' => array(
'MONTHNAME(created) AS month',
'COUNT(*) AS num_logins'
),
'recursive' => -1,
'group' => array('month')
)
);
$downloads = $this->Download->find(
'all',
array(
'fields' => array(
'MONTHNAME(created) AS month',
'COUNT(*) AS num_downloads'
),
'recursive' => -1,
'group' => array('month')
)
);
// ...
}

This gives me:

Array
(
[0] => Array
(
[Login] => Array
(
[month] => July
[num_logins] => 16
)
)
[1] => Array
(
[Login] => Array
(
[month] => June
[num_logins] => 168
)
)
[2] => Array
(
[Login] => Array
(
[month] => May
[num_logins] => 64
)
)
)


app/controllers/stats_controller.php (line 171)

Array
(
[0] => Array
(
[Download] => Array
(
[month] => July
[num_downloads] => 11
)
)
[1] => Array
(
[Download] => Array
(
[month] => June
[num_downloads] => 367
)
)
[2] => Array
(
[Download] => Array
(
[month] => May
[num_downloads] => 15
)
)
)

What I'm after is something like:

Array
(
[0] => Array
(
'July' => array(
'Download' => Array
(
'num_downloads' => 11
),
'Login' => Array
(
'num_logins' => 16
)
)
)
...
)

or even ...

Array
(
[0] => Array
(
'July' => array(
'Download' => 11,
'Login' => 16
)
)
...
)


Incidentally, I've been tryng to figure out a way to do this in a
single query (MySQL) but I get strange results:

mysql> SELECT MONTHNAME(created) AS month, COUNT(*) AS num_logins FROM
logins GROUP BY month;
+---++
| month | num_logins |
+---++
| July  | 15 |
| June  |168 |
| May   | 64 |
+---++
3 rows in set (0.00 sec)

mysql> SELECT MONTHNAME(created) AS month, COUNT(*) AS num_downloads
FROM downloads GROUP BY month;
+---+---+
| month | num_downloads |
+---+---+
| July  |11 |
| June  |   367 |
| May   |15 |
+---+---+
3 rows in set (0.00 sec)

mysql> SELECT MONTHNAME(l.created) AS month, COUNT(l.id) AS
num_logins, COUNT(d.id) AS num_downloads FROM logins AS l LEFT JOIN
downloads AS d ON d.login_id = l.id GROUP BY month;
+---++---+
| month | num_logins | num_downloads |
+---++---+
| July  | 20 |11 |
| June  |477 |   367 |
| May   | 71 |15 |
+---++---+
3 rows in set (0.23 sec)

I figure it's because month is related to logins, not downloads.
However, it seems odd that it's the login numbers that are wonky, not
downloads. If anyone can think of a way to do this in one query I'd
really appreciate it.

--~--~-~--~~~---~--~~
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://grou

RE: A little help needed on determining my model relation ships please

2009-06-04 Thread David Coleman

Resending because for some reason my 2nd message appeared and this one is
not in the list yet. :-(

The recursive refers to whether or not you want sub_categories to have other
sub_categories...

Products belong to categories, so I suggested a separate category table to
handle that relationship,
Then sub categories are related to a category of course, but you have a
HABTM relationship with the product.

It could be all done with a recursive category table, but it would
complicate the cake relationships. Especially when you start traversing deep
into sub-sub-categories...

So I suggested that you have 
Product.cat_id -> category.id
Product.id
   <-( product_sub_categories.prod_id
 Product_sub_categories.sub_cat_id
   )-> 
sub_category.id

then you can have
sub_category.cat_id -> category.id
and
sub_category.parent_id -> sub_category.id

and you are very-happy-super-tree-enabled!

:-)

Cheers,
Dave

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of cake...@hbit.ie
Sent: 2009-06-04 11:57
To: CakePHP
Subject: Re: A little help needed on determining my model relation ships
please


Ok I think I follow, just to clarify:

A product will belong to at least one or more subcategories, so i
guess it will be

product_sub_categories
  id
  product_id
  sub_category_id

Im not too sure what you mean by the recursive parent_id.. can you
please elaborate?

Thanks

Kevin

On Jun 4, 3:02 pm, "David Coleman"  wrote:
> This depends on how you want to build your sub categories tree:
>
> Is it a relationship like this:
>
> category
>
>   id
>
>   parent_id
>
> or
>
> category
>
>   id
>
> sub_category
>
>   id
>
>   category_id
>
>   parent_sub_category
>
> your product could be
>
> product
>
>   id
>
>   ...
>
> Then a join table
>
> categories_products
>
>   id
>
>   product_id
>
>   category_id
>
> or you could have
>
> product
>
>   id
>
>   category_id
>
> product_sub_categories
>
>   id
>
>   product_id
>
>   sub_category_id
>
> it really depends on what your data model requirements are.
>
> The join table will be extremely useful in establishing the HABTM
> relationships you require.
>
> Cake bake will not automatically detect recursive parent_id as a category.
> so you will have to define that manually.
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On
Behalf
>
> Of Beedge
> Sent: 2009-06-04 10:46
> To: CakePHP
> Subject: A little help needed on determining my model relation ships
please
>
> Hi all, about to start on my first cake project. A straight forward e-
>
> commerce site.
>
> I am not used to having to visualise my database relationships so I
>
> was hoping for a little help.
>
> A product belongs in a category
>
> A product can be in many categories
>
> A Category has Sub categories
>
> Is this just a HABTM relationship between products and categories?
>
> I will be using tree behavior for my categories.
>
> Any comments on this or helpers?  I would love to find a tutorial that
>
> covered this, but all I can really find is blog tutorials!
>
> Thanks in advance
>
> Kev
>
>
>
>  image001.gif
> < 1KViewDownload


--~--~-~--~~~---~--~~
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: A little help needed on determining my model relation ships please

2009-06-04 Thread David Coleman

FYI: I suggested the relationship of product -> category because it will
simplify queries, and help facilitate the frontend in most cases.

When dealing with a nested tree data model such as this, you want to
consider the load of your joins on the database, and take some precautions
to lower the execution cost of joins.

Having the 2 separate relationships will also make it easier to work with
the data in cake, due to the way that cake will assemble results and access
the data.

Cake is not good for dealing with deep recursion, so you want to try and
avoid basing your application on queries that will have conditions on tables
joined to tables which are joined to the current model.  By default, cake
only will join immediate descendents. 

It can join deeper with careful model construction, but it is more work than
it is worth. Careful database schema planning can ease the task of getting
your data with a minimum of custom coding and a minimum of execution
overhead for php/cake/and sql.

:-)

Cheers - D

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of cake...@hbit.ie
Sent: 2009-06-04 11:57
To: CakePHP
Subject: Re: A little help needed on determining my model relation ships
please


Ok I think I follow, just to clarify:

A product will belong to at least one or more subcategories, so i
guess it will be

product_sub_categories
  id
  product_id
  sub_category_id

Im not too sure what you mean by the recursive parent_id.. can you
please elaborate?

Thanks

Kevin

On Jun 4, 3:02 pm, "David Coleman"  wrote:
> This depends on how you want to build your sub categories tree:
>
> Is it a relationship like this:
>
> category
>
>   id
>
>   parent_id
>
> or
>
> category
>
>   id
>
> sub_category
>
>   id
>
>   category_id
>
>   parent_sub_category
>
> your product could be
>
> product
>
>   id
>
>   ...
>
> Then a join table
>
> categories_products
>
>   id
>
>   product_id
>
>   category_id
>
> or you could have
>
> product
>
>   id
>
>   category_id
>
> product_sub_categories
>
>   id
>
>   product_id
>
>   sub_category_id
>
> it really depends on what your data model requirements are.
>
> The join table will be extremely useful in establishing the HABTM
> relationships you require.
>
> Cake bake will not automatically detect recursive parent_id as a category.
> so you will have to define that manually.
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On
Behalf
>
> Of Beedge
> Sent: 2009-06-04 10:46
> To: CakePHP
> Subject: A little help needed on determining my model relation ships
please
>
> Hi all, about to start on my first cake project. A straight forward e-
>
> commerce site.
>
> I am not used to having to visualise my database relationships so I
>
> was hoping for a little help.
>
> A product belongs in a category
>
> A product can be in many categories
>
> A Category has Sub categories
>
> Is this just a HABTM relationship between products and categories?
>
> I will be using tree behavior for my categories.
>
> Any comments on this or helpers?  I would love to find a tutorial that
>
> covered this, but all I can really find is blog tutorials!
>
> Thanks in advance
>
> Kev
>
>
>
>  image001.gif
> < 1KViewDownload


--~--~-~--~~~---~--~~
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: A little help needed on determining my model relation ships please

2009-06-04 Thread David Coleman

The recursive refers to whether or not you want sub_categories to have other
sub_categories...

Products belong to categories, so I suggested a separate category table to
handle that relationship,
Then sub categories are related to a category of course, but you have a
HABTM relationship with the product.

It could be all done with a recursive category table, but it would
complicate the cake relationships. Especially when you start traversing deep
into sub-sub-categories...

So I suggested that you have 
Product.cat_id -> category.id
Product.id
   <-( product_sub_categories.prod_id
 Product_sub_categories.sub_cat_id
   )-> 
sub_category.id

then you can have
sub_category.cat_id -> category.id
and
sub_category.parent_id -> sub_category.id

and you are very-happy-super-tree-enabled!

:-)

Cheers,
Dave

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of cake...@hbit.ie
Sent: 2009-06-04 11:57
To: CakePHP
Subject: Re: A little help needed on determining my model relation ships
please


Ok I think I follow, just to clarify:

A product will belong to at least one or more subcategories, so i
guess it will be

product_sub_categories
  id
  product_id
  sub_category_id

Im not too sure what you mean by the recursive parent_id.. can you
please elaborate?

Thanks

Kevin

On Jun 4, 3:02 pm, "David Coleman"  wrote:
> This depends on how you want to build your sub categories tree:
>
> Is it a relationship like this:
>
> category
>
>   id
>
>   parent_id
>
> or
>
> category
>
>   id
>
> sub_category
>
>   id
>
>   category_id
>
>   parent_sub_category
>
> your product could be
>
> product
>
>   id
>
>   ...
>
> Then a join table
>
> categories_products
>
>   id
>
>   product_id
>
>   category_id
>
> or you could have
>
> product
>
>   id
>
>   category_id
>
> product_sub_categories
>
>   id
>
>   product_id
>
>   sub_category_id
>
> it really depends on what your data model requirements are.
>
> The join table will be extremely useful in establishing the HABTM
> relationships you require.
>
> Cake bake will not automatically detect recursive parent_id as a category.
> so you will have to define that manually.
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On
Behalf
>
> Of Beedge
> Sent: 2009-06-04 10:46
> To: CakePHP
> Subject: A little help needed on determining my model relation ships
please
>
> Hi all, about to start on my first cake project. A straight forward e-
>
> commerce site.
>
> I am not used to having to visualise my database relationships so I
>
> was hoping for a little help.
>
> A product belongs in a category
>
> A product can be in many categories
>
> A Category has Sub categories
>
> Is this just a HABTM relationship between products and categories?
>
> I will be using tree behavior for my categories.
>
> Any comments on this or helpers?  I would love to find a tutorial that
>
> covered this, but all I can really find is blog tutorials!
>
> Thanks in advance
>
> Kev
>
>
>
>  image001.gif
> < 1KViewDownload


--~--~-~--~~~---~--~~
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: A little help needed on determining my model relation ships please

2009-06-04 Thread cakephp

Ok I think I follow, just to clarify:

A product will belong to at least one or more subcategories, so i
guess it will be

product_sub_categories
  id
  product_id
  sub_category_id

Im not too sure what you mean by the recursive parent_id.. can you
please elaborate?

Thanks

Kevin

On Jun 4, 3:02 pm, "David Coleman"  wrote:
> This depends on how you want to build your sub categories tree:
>
> Is it a relationship like this:
>
> category
>
>   id
>
>   parent_id
>
> or
>
> category
>
>   id
>
> sub_category
>
>   id
>
>   category_id
>
>   parent_sub_category
>
> your product could be
>
> product
>
>   id
>
>   ...
>
> Then a join table
>
> categories_products
>
>   id
>
>   product_id
>
>   category_id
>
> or you could have
>
> product
>
>   id
>
>   category_id
>
> product_sub_categories
>
>   id
>
>   product_id
>
>   sub_category_id
>
> it really depends on what your data model requirements are.
>
> The join table will be extremely useful in establishing the HABTM
> relationships you require.
>
> Cake bake will not automatically detect recursive parent_id as a category.
> so you will have to define that manually.
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
>
> Of Beedge
> Sent: 2009-06-04 10:46
> To: CakePHP
> Subject: A little help needed on determining my model relation ships please
>
> Hi all, about to start on my first cake project. A straight forward e-
>
> commerce site.
>
> I am not used to having to visualise my database relationships so I
>
> was hoping for a little help.
>
> A product belongs in a category
>
> A product can be in many categories
>
> A Category has Sub categories
>
> Is this just a HABTM relationship between products and categories?
>
> I will be using tree behavior for my categories.
>
> Any comments on this or helpers?  I would love to find a tutorial that
>
> covered this, but all I can really find is blog tutorials!
>
> Thanks in advance
>
> Kev
>
>
>
>  image001.gif
> < 1KViewDownload
--~--~-~--~~~---~--~~
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: A little help needed on determining my model relation ships please

2009-06-04 Thread David Coleman
This depends on how you want to build your sub categories tree:

 

Is it a relationship like this:

 

category

  id

  parent_id

 

or

 

category

  id

 

sub_category

  id

  category_id

  parent_sub_category

 

your product could be

 

product

  id

  ...

 

Then a join table

 

categories_products

  id

  product_id

  category_id

 

 

or you could have 

 

product

  id

  category_id

 

product_sub_categories

  id

  product_id

  sub_category_id

 

it really depends on what your data model requirements are.

 

The join table will be extremely useful in establishing the HABTM
relationships you require.

 

Cake bake will not automatically detect recursive parent_id as a category.
so you will have to define that manually.

 

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Beedge
Sent: 2009-06-04 10:46
To: CakePHP
Subject: A little help needed on determining my model relation ships please

 

 

Hi all, about to start on my first cake project. A straight forward e-

commerce site.

I am not used to having to visualise my database relationships so I

was hoping for a little help.

 

A product belongs in a category

A product can be in many categories

A Category has Sub categories

 

Is this just a HABTM relationship between products and categories?

 

I will be using tree behavior for my categories.

 

Any comments on this or helpers?  I would love to find a tutorial that

covered this, but all I can really find is blog tutorials!

 

Thanks in advance

 

Kev



--~--~-~--~~~---~--~~
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: A little help needed on determining my model relation ships please

2009-06-04 Thread cake_baker

ok here is how you should do that

create you category table first

then create your product table
in the product table just include category_id

then you can do product belongs to category or cake bake it it will
ask you what model associations

let me know how you did

On Jun 4, 6:45 am, Beedge  wrote:
> Hi all, about to start on my first cake project. A straight forward e-
> commerce site.
> I am not used to having to visualise my database relationships so I
> was hoping for a little help.
>
> A product belongs in a category
> A product can be in many categories
> A Category has Sub categories
>
> Is this just a HABTM relationship between products and categories?
>
> I will be using tree behavior for my categories.
>
> Any comments on this or helpers?  I would love to find a tutorial that
> covered this, but all I can really find is blog tutorials!
>
> Thanks in advance
>
> Kev
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



A little help needed on determining my model relation ships please

2009-06-04 Thread Beedge

Hi all, about to start on my first cake project. A straight forward e-
commerce site.
I am not used to having to visualise my database relationships so I
was hoping for a little help.

A product belongs in a category
A product can be in many categories
A Category has Sub categories

Is this just a HABTM relationship between products and categories?

I will be using tree behavior for my categories.

Any comments on this or helpers?  I would love to find a tutorial that
covered this, but all I can really find is blog tutorials!

Thanks in advance

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



Help needed with HABTM not saving data.

2009-06-01 Thread memons

Hi All,
Could some one help me on following:
I have three two tables:
properties : id (auto-increment), title
features : id, title

Since there is many to many relationship between tables, I have third
one:

features_properties: id, feature_id, property_id

Now this is my view: add.ctp.
create('Property');?>


input('title');
echo $form->input('pfor_id');
echo $form->input('ptype_id');
echo $form->input('Feature',array('multiple'=>true));
?>

end('Submit');?>

controller:
add method:
function add() {
if (!empty($this->data)) {
debug($this->data);
$this->Property->create();

if ($this->Property->save($this->data)) {


$this->Session->setFlash(__('The Property has 
been saved', true));
//$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Property could 
not be saved.
Please, try again.', true));
}
}
$features = $this->Property->Feature->find('list');

$this->set(compact('features'));
}

Property Model:
var $hasAndBelongsToMany = array(
'Feature' => array(
'className' => 'Feature',
'joinTable' => 'features_properties',
'foreignKey' => 'property_id',
'associationForeignKey' => 'feature_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
);

Data never gets saved in joint table. Can some one help me on this
please.

--~--~-~--~~~---~--~~
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: Set::extract and Set::combine - help needed

2009-04-24 Thread Faza
Mister,

I'll be damn. Works perfectly, and - what is more than expected - I
understand why!

Thanks a bunch.
Damn. Awesome :D


> Some of what you want to do is possible with the set class; other bits
> would be more complicated.
>
> With this approach, the best you could achieve would be a nasty mess
> of array_combine, array_keys and various set calls, all nested and
> difficult to follow.
>
> Although I love the Set class with all my heart, this is one instance
> where I believe a simple loop would be easier to code, easier to
> maintain, and ultimately more efficient for the server and the coder.
>
> foreach($data as $i => $bacon) {
>   $statusHistory = array();
>   foreach($bacon['StatusHistory'] as $eggs) {
> $statusHistory[$eggs['StatusName']['text']] = array(
>   'since' => $eggs['since'],
>   'Changer' => $ggs['Changer']['full_name']
> );
>   }
>   $data[$i]['StatusHistory'] = $statusHistory;
> }
>
> Job done!
>
> hth
> grigri
>
> On Apr 24, 9:16 am, "Faza"  wrote:
>> Hello again,
>>
>> this is the array I'm working on:
>>
>> Array
>> (
>>     [0] => Array
>>         (
>>             [Design] => Array
>>                 (
>>                     [id] => 39
>>                     [design_no] => 1
>>                     [job_title] => gjgfjyjgyjf
>>                     [expected_date] => 2009-04-14
>>                     [customer_id] => 5
>>                     [designer_id] => 15
>>                     [status_id] => 1
>>                     [post_date] => 2009-04-23 13:11:23.247263+02
>>                     [author_id] => 73
>>                 )
>>
>>             [Author] => Array
>>                 (
>>                     [full_name] => SKP Admin
>>                     [id] => 73
>>                 )
>>
>>             [Designer] => Array
>>                 (
>>                     [full_name] => Jan Grzenda
>>                     [id] => 15
>>                 )
>>
>>             [CustomerNr] => Array
>>                 (
>>                     [id] => 5
>>                     [customers_number_name] => Test (2343)
>>                 )
>>
>>             [StatusHistory] => Array
>>                 (
>>                     [0] => Array
>>                         (
>>                             [since] => 2009-04-21 00:00:00+02
>>                             [status_names_id] => 1
>>                             [changer_id] => 74
>>                             [design_id] => 39
>>                             [StatusName] => Array
>>                                 (
>>                                     [text] => Nowe
>>                                 )
>>
>>                             [Changer] => Array
>>                                 (
>>                                     [full_name] => John Doe
>>                                 )
>>
>>                         )
>>
>>                     [1] => Array
>>                         (
>>                             [since] => 2009-04-23 14:17:11.673985+02
>>                             [status_names_id] => 2
>>                             [changer_id] => 74
>>                             [design_id] => 39
>>                             [StatusName] => Array
>>                                 (
>>                                     [text] => Przydzielone grafikowi
>>                                 )
>>
>>                             [Changer] => Array
>>                                 (
>>                                     [full_name] => Ed Smith
>>                                 )
>>
>>                         )
>>
>>                 )
>>
>>         )
>>
>> I want to modify the [StatusHistory] branch.
>> So far, I'm extracting it using:
>>
>> $hist = Set::extract($designs, '{n}.StatusHistory');
>>
>> This results in:
>>
>> Array
>> (
>>     [0] => Array
>>         (
>>             [0] => Array
>>                 (
>>                     [since] => 2009-04-21 00:00:00+02
>>                     [status_names_id] => 1
>>                     [changer_id] => 74
>>                     [design_id] => 39
>>                     [StatusName] => Array
>>                         (
>>                             [text] => Nowe
>>                         )
>>
>>                     [Changer] => Array
>>                         (
>>                             [full_name] => John Doe
>>                         )
>>
>>                 )
>>
>>             [1] => Array
>>                 (
>>                     [since] => 2009-04-23 14:17:11.673985+02
>>                     [status_names_id] => 2
>>                     [changer_id] => 74
>>                     [design_id] => 39
>>                     [StatusName] => Array
>>                         (
>>                             [text] => Przydzielone grafikowi
>>                         )
>>
>>                     [Changer] => Array
>>                         (
>>                             [full_name] => Ed Smith
>>                         )
>>
>>                 )
>>
>>         )
>

Re: Set::extract and Set::combine - help needed

2009-04-24 Thread grigri
Some of what you want to do is possible with the set class; other bits
would be more complicated.

With this approach, the best you could achieve would be a nasty mess
of array_combine, array_keys and various set calls, all nested and
difficult to follow.

Although I love the Set class with all my heart, this is one instance
where I believe a simple loop would be easier to code, easier to
maintain, and ultimately more efficient for the server and the coder.

foreach($data as $i => $bacon) {
  $statusHistory = array();
  foreach($bacon['StatusHistory'] as $eggs) {
$statusHistory[$eggs['StatusName']['text']] = array(
  'since' => $eggs['since'],
  'Changer' => $ggs['Changer']['full_name']
);
  }
  $data[$i]['StatusHistory'] = $statusHistory;
}

Job done!

hth
grigri

On Apr 24, 9:16 am, "Faza"  wrote:
> Hello again,
>
> this is the array I'm working on:
>
> Array
> (
>     [0] => Array
>         (
>             [Design] => Array
>                 (
>                     [id] => 39
>                     [design_no] => 1
>                     [job_title] => gjgfjyjgyjf
>                     [expected_date] => 2009-04-14
>                     [customer_id] => 5
>                     [designer_id] => 15
>                     [status_id] => 1
>                     [post_date] => 2009-04-23 13:11:23.247263+02
>                     [author_id] => 73
>                 )
>
>             [Author] => Array
>                 (
>                     [full_name] => SKP Admin
>                     [id] => 73
>                 )
>
>             [Designer] => Array
>                 (
>                     [full_name] => Jan Grzenda
>                     [id] => 15
>                 )
>
>             [CustomerNr] => Array
>                 (
>                     [id] => 5
>                     [customers_number_name] => Test (2343)
>                 )
>
>             [StatusHistory] => Array
>                 (
>                     [0] => Array
>                         (
>                             [since] => 2009-04-21 00:00:00+02
>                             [status_names_id] => 1
>                             [changer_id] => 74
>                             [design_id] => 39
>                             [StatusName] => Array
>                                 (
>                                     [text] => Nowe
>                                 )
>
>                             [Changer] => Array
>                                 (
>                                     [full_name] => John Doe
>                                 )
>
>                         )
>
>                     [1] => Array
>                         (
>                             [since] => 2009-04-23 14:17:11.673985+02
>                             [status_names_id] => 2
>                             [changer_id] => 74
>                             [design_id] => 39
>                             [StatusName] => Array
>                                 (
>                                     [text] => Przydzielone grafikowi
>                                 )
>
>                             [Changer] => Array
>                                 (
>                                     [full_name] => Ed Smith
>                                 )
>
>                         )
>
>                 )
>
>         )
>
> I want to modify the [StatusHistory] branch.
> So far, I'm extracting it using:
>
> $hist = Set::extract($designs, '{n}.StatusHistory');
>
> This results in:
>
> Array
> (
>     [0] => Array
>         (
>             [0] => Array
>                 (
>                     [since] => 2009-04-21 00:00:00+02
>                     [status_names_id] => 1
>                     [changer_id] => 74
>                     [design_id] => 39
>                     [StatusName] => Array
>                         (
>                             [text] => Nowe
>                         )
>
>                     [Changer] => Array
>                         (
>                             [full_name] => John Doe
>                         )
>
>                 )
>
>             [1] => Array
>                 (
>                     [since] => 2009-04-23 14:17:11.673985+02
>                     [status_names_id] => 2
>                     [changer_id] => 74
>                     [design_id] => 39
>                     [StatusName] => Array
>                         (
>                             [text] => Przydzielone grafikowi
>                         )
>
>                     [Changer] => Array
>                         (
>                             [full_name] => Ed Smith
>                         )
>
>                 )
>
>         )
>
> I've tried endless combine params, but without success.
> I want to achieve this:
>
> Array
> (
>     [0] => Array
>         (
>             [Nowe] = (StatusName.text) => Array
>                 (
>                     [since] => 2009-04-21 00:00:00+02
>                     [Changer] => John Doe = (Chang

Set::extract and Set::combine - help needed

2009-04-24 Thread Faza

Hello again,

this is the array I'm working on:

Array
(
[0] => Array
(
[Design] => Array
(
[id] => 39
[design_no] => 1
[job_title] => gjgfjyjgyjf
[expected_date] => 2009-04-14
[customer_id] => 5
[designer_id] => 15
[status_id] => 1
[post_date] => 2009-04-23 13:11:23.247263+02
[author_id] => 73
)

[Author] => Array
(
[full_name] => SKP Admin
[id] => 73
)

[Designer] => Array
(
[full_name] => Jan Grzenda
[id] => 15
)

[CustomerNr] => Array
(
[id] => 5
[customers_number_name] => Test (2343)
)

[StatusHistory] => Array
(
[0] => Array
(
[since] => 2009-04-21 00:00:00+02
[status_names_id] => 1
[changer_id] => 74
[design_id] => 39
[StatusName] => Array
(
[text] => Nowe
)

[Changer] => Array
(
[full_name] => John Doe
)

)

[1] => Array
(
[since] => 2009-04-23 14:17:11.673985+02
[status_names_id] => 2
[changer_id] => 74
[design_id] => 39
[StatusName] => Array
(
[text] => Przydzielone grafikowi
)

[Changer] => Array
(
[full_name] => Ed Smith
)

)

)

)

I want to modify the [StatusHistory] branch.
So far, I'm extracting it using:

$hist = Set::extract($designs, '{n}.StatusHistory');

This results in:

Array
(
[0] => Array
(
[0] => Array
(
[since] => 2009-04-21 00:00:00+02
[status_names_id] => 1
[changer_id] => 74
[design_id] => 39
[StatusName] => Array
(
[text] => Nowe
)

[Changer] => Array
(
[full_name] => John Doe
)

)

[1] => Array
(
[since] => 2009-04-23 14:17:11.673985+02
[status_names_id] => 2
[changer_id] => 74
[design_id] => 39
[StatusName] => Array
(
[text] => Przydzielone grafikowi
)

[Changer] => Array
(
[full_name] => Ed Smith
)

)

)

I've tried endless combine params, but without success.
I want to achieve this:

Array
(
[0] => Array
(
[Nowe] = (StatusName.text) => Array
(
[since] => 2009-04-21 00:00:00+02
[Changer] => John Doe = (Changer.full_name)
)

[Przydzielone grafikowi] => Array
(
[since] => 2009-04-23 14:17:11.673985+02
[Changer] => Ed Smith
)

)

Last question, I want to replace the original [StatusHistory] with the new
array.

-- 
Jacek


--~--~-~--~~~---~--~~
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 needed for inline WISIWYG editor...

2008-11-15 Thread Aneesh S
Hi,

  I'm using yahoo editor in my project, but i am now kind of stuck in
the middle. Everything but the add link and add image is working.
Both are not coming but not in a separate layer as it is supposed to
be. I'm attaching a screenshot...

 How can i fix this problem...?


Please help me out here

On 11/14/08, Flipflops <[EMAIL PROTECTED]> wrote:
>
> Good choice... and if you want a bit more go for WYMeditor
> http://www.wymeditor.org/ which is also jQuery based.
>
> Personally I really don't enjoy working with TinyMCE (although haven't
> tried the latest release) or FCKeditor
>
> On Nov 14, 7:54 am, Ketan Shah <[EMAIL PROTECTED]> wrote:
>> http://code.google.com/p/jwysiwyg/
>>
>> You would need include jquery. Minimalistic editor.
>>
>> -Ketan
>>
>> Aneesh S wrote:
>> > Thanks donkeybob, but i still cant get the entered data.
>>
>> > This is my code ...
>>
>> > > > $form->textarea('Content.content_text',array('cols'=>"75",'rows'=>"20",'id'=>"text234"));?>
>> >
>>
>> >(function() {
>> >var Dom = YAHOO.util.Dom,
>> >Event = YAHOO.util.Event;
>>
>> >var myconfig = {
>> >height: '200px',
>> >width: '550px',
>> >dompath: false,
>> >handleSubmit: false,
>> >autoHeight: true
>> >};
>>
>> >var conEditor = new YAHOO.widget.Editor('text234',
>> > myconfig);
>> >conEditor._defaultToolbar.buttonType = 'basic';
>> >conEditor.render();
>>
>> >})();
>> >
>>
>> > On 11/14/08, Aneesh S <[EMAIL PROTECTED]> wrote:
>> > > thanks for the help.. let me see if it works
>>
>> > > On 11/13/08, Donkeybob <[EMAIL PROTECTED]> wrote:
>>
>> > >> I use Yahoo Rich Text Editor. I did make sure my script was below the
>> > >> form tags, so the control would render before the yahoo code. Other
>> > >> then that . . .no problems
>>
>> > >> input('content'); ?>
>> > >> 
>>
>> > >>   (function() {
>> > >>   var Dom = YAHOO.util.Dom,
>> > >>   Event = YAHOO.util.Event;
>>
>> > >>   var myconfig = {
>> > >>   height: '200px',
>> > >>   width: '550px',
>> > >>   dompath: false,
>> > >>   handleSubmit: true,
>> > >>   autoHeight: true
>> > >>   };
>>
>> > >>   var conEditor = new YAHOO.widget.Editor('Content',
>> > >> myconfig);
>> > >>   conEditor._defaultToolbar.buttonType = 'basic';
>> > >>   conEditor.render();
>>
>> > >>   })();
>> > >>   
>>
>> > >> On Nov 13, 8:28 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>> > >>> TinyMCE is what you need.
>>
>> > >>> Minimal code to turn any text area into rich editors.
>>
>> > >>> PAsses data normally as post (or whatever method your existing form
>> > >>> uses)
>>
>> > >>> On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
>>
>> > >>> > I had tried Yahoo's rich text editor, but i could not get the data
>> > >>> > via
>> > >>> > post... Any help in that matter would be great...
>>
>> > >>> > Thanks for the hint kyle.davis
>>
>> > >>> > On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>>
>> > >>> > > in some WYSIWYG editors, there is a setting for handling post.
>> > >>> > > If you
>> > >>> > > don';t set that variable, you can submit the form but you won't
>> > >>> > > see
>> > >>> > > the values in _POST
>>
>> > >>> > > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>> > >>> > > wrote:
>> > >>> > >> Hi,
>>
>> > >>> > >>I need to build an inline wysiswig editor for the project
>> > >>> > >> i'm
>> > >>> > >> working on. I have tried some editors, but im not being able to
>> > >>> > >> extract the typed text using post.  Is such a facility built-in
>> > >>> > >> in
>> > >>> > >> cake ? Can any one help me out in this Thanks in
>> > >>> > >> advance
>>
>> > >>> > --
>> > >>> > Aneesh S
>>
>> > > --
>> > > Aneesh S
>>
>> > --
>> > Aneesh S
> >
>


-- 
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-14 Thread Flipflops

Good choice... and if you want a bit more go for WYMeditor
http://www.wymeditor.org/ which is also jQuery based.

Personally I really don't enjoy working with TinyMCE (although haven't
tried the latest release) or FCKeditor

On Nov 14, 7:54 am, Ketan Shah <[EMAIL PROTECTED]> wrote:
> http://code.google.com/p/jwysiwyg/
>
> You would need include jquery. Minimalistic editor.
>
> -Ketan
>
> Aneesh S wrote:
> > Thanks donkeybob, but i still cant get the entered data.
>
> > This is my code ...
>
> >  > $form->textarea('Content.content_text',array('cols'=>"75",'rows'=>"20",'id'=>"text234"));?>
> >                            
>
> >                (function() {
> >                    var Dom = YAHOO.util.Dom,
> >                        Event = YAHOO.util.Event;
>
> >                    var myconfig = {
> >                        height: '200px',
> >                        width: '550px',
> >                        dompath: false,
> >                                handleSubmit: false,
> >                                autoHeight: true
> >                    };
>
> >                    var conEditor = new YAHOO.widget.Editor('text234', 
> > myconfig);
> >                conEditor._defaultToolbar.buttonType = 'basic';
> >                conEditor.render();
>
> >                })();
> >        
>
> > On 11/14/08, Aneesh S <[EMAIL PROTECTED]> wrote:
> > > thanks for the help.. let me see if it works
>
> > > On 11/13/08, Donkeybob <[EMAIL PROTECTED]> wrote:
>
> > >> I use Yahoo Rich Text Editor. I did make sure my script was below the
> > >> form tags, so the control would render before the yahoo code. Other
> > >> then that . . .no problems
>
> > >> input('content'); ?>
> > >> 
>
> > >>           (function() {
> > >>               var Dom = YAHOO.util.Dom,
> > >>                   Event = YAHOO.util.Event;
>
> > >>               var myconfig = {
> > >>                   height: '200px',
> > >>                   width: '550px',
> > >>                   dompath: false,
> > >>                           handleSubmit: true,
> > >>                           autoHeight: true
> > >>               };
>
> > >>               var conEditor = new YAHOO.widget.Editor('Content', 
> > >> myconfig);
> > >>           conEditor._defaultToolbar.buttonType = 'basic';
> > >>           conEditor.render();
>
> > >>           })();
> > >>   
>
> > >> On Nov 13, 8:28 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> > >>> TinyMCE is what you need.
>
> > >>> Minimal code to turn any text area into rich editors.
>
> > >>> PAsses data normally as post (or whatever method your existing form
> > >>> uses)
>
> > >>> On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
>
> > >>> > I had tried Yahoo's rich text editor, but i could not get the data via
> > >>> > post... Any help in that matter would be great...
>
> > >>> > Thanks for the hint kyle.davis
>
> > >>> > On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>
> > >>> > > in some WYSIWYG editors, there is a setting for handling post. If 
> > >>> > > you
> > >>> > > don';t set that variable, you can submit the form but you won't see
> > >>> > > the values in _POST
>
> > >>> > > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > >>> > > wrote:
> > >>> > >> Hi,
>
> > >>> > >>    I need to build an inline wysiswig editor for the project i'm
> > >>> > >> working on. I have tried some editors, but im not being able to
> > >>> > >> extract the typed text using post.  Is such a facility built-in in
> > >>> > >> cake ? Can any one help me out in this Thanks in advance
>
> > >>> > --
> > >>> > Aneesh S
>
> > > --
> > > Aneesh S
>
> > --
> > Aneesh S
--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-14 Thread Aneesh S

thanks for the help I've got the yahoo editor working and ok...
But now i have a problem with the add link and add image button on the
toolbar...

I'm getting a X^  and the functions are inlined in the textarea and
flowing outside.

How can i fix this...

Thanks in advance..

On 11/14/08, Aneesh S <[EMAIL PROTECTED]> wrote:
> ok... let me try that..
> Aneesh S
>


-- 
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-14 Thread Aneesh S
ok... let me try that..
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-14 Thread jason m

I have had a lot of luck with fckeditor in my cake projects. There is
also a tutorial for it in the bakery.

On Nov 14, 5:30 pm, "Aneesh S" <[EMAIL PROTECTED]> wrote:
> thanks, but i need more options yahoo would be my choice...
> Aneesh S
--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-14 Thread Aneesh S
thanks, but i need more options yahoo would be my choice...
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread Ketan Shah

http://code.google.com/p/jwysiwyg/

You would need include jquery. Minimalistic editor.

-Ketan

Aneesh S wrote:
> Thanks donkeybob, but i still cant get the entered data.
>
> This is my code ...
>
>  $form->textarea('Content.content_text',array('cols'=>"75",'rows'=>"20",'id'=>"text234"));?>
>   
>
>(function() {
>var Dom = YAHOO.util.Dom,
>Event = YAHOO.util.Event;
>
>var myconfig = {
>height: '200px',
>width: '550px',
>dompath: false,
>handleSubmit: false,
>autoHeight: true
>};
>
>var conEditor = new YAHOO.widget.Editor('text234', 
> myconfig);
>conEditor._defaultToolbar.buttonType = 'basic';
>conEditor.render();
>
>})();
>
>
> On 11/14/08, Aneesh S <[EMAIL PROTECTED]> wrote:
> > thanks for the help.. let me see if it works
> >
> > On 11/13/08, Donkeybob <[EMAIL PROTECTED]> wrote:
> >>
> >> I use Yahoo Rich Text Editor. I did make sure my script was below the
> >> form tags, so the control would render before the yahoo code. Other
> >> then that . . .no problems
> >>
> >> input('content'); ?>
> >> 
> >>
> >>(function() {
> >>var Dom = YAHOO.util.Dom,
> >>Event = YAHOO.util.Event;
> >>
> >>var myconfig = {
> >>height: '200px',
> >>width: '550px',
> >>dompath: false,
> >>handleSubmit: true,
> >>autoHeight: true
> >>};
> >>
> >>var conEditor = new YAHOO.widget.Editor('Content', 
> >> myconfig);
> >>conEditor._defaultToolbar.buttonType = 'basic';
> >>conEditor.render();
> >>
> >>})();
> >>
> >>
> >> On Nov 13, 8:28 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> >>> TinyMCE is what you need.
> >>>
> >>> Minimal code to turn any text area into rich editors.
> >>>
> >>> PAsses data normally as post (or whatever method your existing form
> >>> uses)
> >>>
> >>> On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
> >>>
> >>> > I had tried Yahoo's rich text editor, but i could not get the data via
> >>> > post... Any help in that matter would be great...
> >>>
> >>> > Thanks for the hint kyle.davis
> >>>
> >>> > On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
> >>>
> >>> > > in some WYSIWYG editors, there is a setting for handling post. If you
> >>> > > don';t set that variable, you can submit the form but you won't see
> >>> > > the values in _POST
> >>>
> >>> > > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> >>> > > wrote:
> >>> > >> Hi,
> >>>
> >>> > >>I need to build an inline wysiswig editor for the project i'm
> >>> > >> working on. I have tried some editors, but im not being able to
> >>> > >> extract the typed text using post.  Is such a facility built-in in
> >>> > >> cake ? Can any one help me out in this Thanks in advance
> >>>
> >>> > --
> >>> > Aneesh S
> >> >>
> >>
> >
> >
> > --
> > Aneesh S
> >
>
>
> --
> Aneesh S
--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread Aneesh S

Thanks donkeybob, but i still cant get the entered data.

This is my code ...

textarea('Content.content_text',array('cols'=>"75",'rows'=>"20",'id'=>"text234"));?>


   (function() {
   var Dom = YAHOO.util.Dom,
   Event = YAHOO.util.Event;

   var myconfig = {
   height: '200px',
   width: '550px',
   dompath: false,
   handleSubmit: false,
   autoHeight: true
   };

   var conEditor = new YAHOO.widget.Editor('text234', myconfig);
   conEditor._defaultToolbar.buttonType = 'basic';
   conEditor.render();

   })();
   

On 11/14/08, Aneesh S <[EMAIL PROTECTED]> wrote:
> thanks for the help.. let me see if it works
>
> On 11/13/08, Donkeybob <[EMAIL PROTECTED]> wrote:
>>
>> I use Yahoo Rich Text Editor. I did make sure my script was below the
>> form tags, so the control would render before the yahoo code. Other
>> then that . . .no problems
>>
>> input('content'); ?>
>> 
>>
>>  (function() {
>>  var Dom = YAHOO.util.Dom,
>>  Event = YAHOO.util.Event;
>>
>>  var myconfig = {
>>  height: '200px',
>>  width: '550px',
>>  dompath: false,
>>  handleSubmit: true,
>>  autoHeight: true
>>  };
>>
>>  var conEditor = new YAHOO.widget.Editor('Content', 
>> myconfig);
>>  conEditor._defaultToolbar.buttonType = 'basic';
>>  conEditor.render();
>>
>>  })();
>>  
>>
>> On Nov 13, 8:28 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>>> TinyMCE is what you need.
>>>
>>> Minimal code to turn any text area into rich editors.
>>>
>>> PAsses data normally as post (or whatever method your existing form
>>> uses)
>>>
>>> On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
>>>
>>> > I had tried Yahoo's rich text editor, but i could not get the data via
>>> > post... Any help in that matter would be great...
>>>
>>> > Thanks for the hint kyle.davis
>>>
>>> > On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>>>
>>> > > in some WYSIWYG editors, there is a setting for handling post. If you
>>> > > don';t set that variable, you can submit the form but you won't see
>>> > > the values in _POST
>>>
>>> > > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>>> > > wrote:
>>> > >> Hi,
>>>
>>> > >>I need to build an inline wysiswig editor for the project i'm
>>> > >> working on. I have tried some editors, but im not being able to
>>> > >> extract the typed text using post.  Is such a facility built-in in
>>> > >> cake ? Can any one help me out in this Thanks in advance
>>>
>>> > --
>>> > Aneesh S
>> >>
>>
>
>
> --
> Aneesh S
>


-- 
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread Aneesh S

thanks for the help.. let me see if it works

On 11/13/08, Donkeybob <[EMAIL PROTECTED]> wrote:
>
> I use Yahoo Rich Text Editor. I did make sure my script was below the
> form tags, so the control would render before the yahoo code. Other
> then that . . .no problems
>
> input('content'); ?>
> 
>
>   (function() {
>   var Dom = YAHOO.util.Dom,
>   Event = YAHOO.util.Event;
>
>   var myconfig = {
>   height: '200px',
>   width: '550px',
>   dompath: false,
>   handleSubmit: true,
>   autoHeight: true
>   };
>
>   var conEditor = new YAHOO.widget.Editor('Content', 
> myconfig);
>   conEditor._defaultToolbar.buttonType = 'basic';
>   conEditor.render();
>
>   })();
>   
>
> On Nov 13, 8:28 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>> TinyMCE is what you need.
>>
>> Minimal code to turn any text area into rich editors.
>>
>> PAsses data normally as post (or whatever method your existing form
>> uses)
>>
>> On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
>>
>> > I had tried Yahoo's rich text editor, but i could not get the data via
>> > post... Any help in that matter would be great...
>>
>> > Thanks for the hint kyle.davis
>>
>> > On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>>
>> > > in some WYSIWYG editors, there is a setting for handling post. If you
>> > > don';t set that variable, you can submit the form but you won't see
>> > > the values in _POST
>>
>> > > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>> > > wrote:
>> > >> Hi,
>>
>> > >>I need to build an inline wysiswig editor for the project i'm
>> > >> working on. I have tried some editors, but im not being able to
>> > >> extract the typed text using post.  Is such a facility built-in in
>> > >> cake ? Can any one help me out in this Thanks in advance
>>
>> > --
>> > Aneesh S
> >
>


-- 
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread Donkeybob

I use Yahoo Rich Text Editor. I did make sure my script was below the
form tags, so the control would render before the yahoo code. Other
then that . . .no problems

input('content'); ?>


(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;

var myconfig = {
height: '200px',
width: '550px',
dompath: false,
handleSubmit: true,
autoHeight: true
};

var conEditor = new YAHOO.widget.Editor('Content', 
myconfig);
conEditor._defaultToolbar.buttonType = 'basic';
conEditor.render();

})();


On Nov 13, 8:28 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> TinyMCE is what you need.
>
> Minimal code to turn any text area into rich editors.
>
> PAsses data normally as post (or whatever method your existing form
> uses)
>
> On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
>
> > I had tried Yahoo's rich text editor, but i could not get the data via
> > post... Any help in that matter would be great...
>
> > Thanks for the hint kyle.davis
>
> > On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>
> > > in some WYSIWYG editors, there is a setting for handling post. If you
> > > don';t set that variable, you can submit the form but you won't see
> > > the values in _POST
>
> > > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
> > >> Hi,
>
> > >>    I need to build an inline wysiswig editor for the project i'm
> > >> working on. I have tried some editors, but im not being able to
> > >> extract the typed text using post.  Is such a facility built-in in
> > >> cake ? Can any one help me out in this Thanks in advance
>
> > --
> > Aneesh S
--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread Smelly_Eddie

TinyMCE is what you need.

Minimal code to turn any text area into rich editors.

PAsses data normally as post (or whatever method your existing form
uses)

On Nov 13, 8:04 am, "Aneesh S" <[EMAIL PROTECTED]> wrote:
> I had tried Yahoo's rich text editor, but i could not get the data via
> post... Any help in that matter would be great...
>
> Thanks for the hint kyle.davis
>
> On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>
>
>
> > in some WYSIWYG editors, there is a setting for handling post. If you
> > don';t set that variable, you can submit the form but you won't see
> > the values in _POST
>
> > On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
> >> Hi,
>
> >>    I need to build an inline wysiswig editor for the project i'm
> >> working on. I have tried some editors, but im not being able to
> >> extract the typed text using post.  Is such a facility built-in in
> >> cake ? Can any one help me out in this Thanks in advance
>
> --
> Aneesh S
--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread Aneesh S

I had tried Yahoo's rich text editor, but i could not get the data via
post... Any help in that matter would be great...


Thanks for the hint kyle.davis

On 11/13/08, validkeys <[EMAIL PROTECTED]> wrote:
>
> in some WYSIWYG editors, there is a setting for handling post. If you
> don';t set that variable, you can submit the form but you won't see
> the values in _POST
>
> On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> Hi,
>>
>>I need to build an inline wysiswig editor for the project i'm
>> working on. I have tried some editors, but im not being able to
>> extract the typed text using post.  Is such a facility built-in in
>> cake ? Can any one help me out in this Thanks in advance
> >
>


-- 
Aneesh S

--~--~-~--~~~---~--~~
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: Help needed for inline WISIWYG editor...

2008-11-13 Thread validkeys

in some WYSIWYG editors, there is a setting for handling post. If you
don';t set that variable, you can submit the form but you won't see
the values in _POST

On Nov 13, 7:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
>    I need to build an inline wysiswig editor for the project i'm
> working on. I have tried some editors, but im not being able to
> extract the typed text using post.  Is such a facility built-in in
> cake ? Can any one help me out in this Thanks in advance
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help needed for inline WISIWYG editor...

2008-11-13 Thread [EMAIL PROTECTED]

Hi,

   I need to build an inline wysiswig editor for the project i'm
working on. I have tried some editors, but im not being able to
extract the typed text using post.  Is such a facility built-in in
cake ? Can any one help me out in this Thanks in advance



--~--~-~--~~~---~--~~
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: Help needed with an error

2008-09-26 Thread Eemerge

Thanks, i will ask the server admin to restart it and hopefully it
will work. I'll post after the restart is done.

On Sep 26, 5:00 pm, RichardAtHome <[EMAIL PROTECTED]> wrote:
> Just come across this when I renamed my web root folder.
>
> I think this is to do with me using APC and isn't a CakePHP issue (now
> that you have deleted the cache).
>
> Restart Apache. This will clear the APC cache.
>
> On Sep 26, 2:17 pm, Eemerge <[EMAIL PROTECTED]> wrote:
>
> > just cleared them, same thing. still not working. I read somewhere i
> > should define the CAKE_INCLUDE_PATH (or something like this)
> > manually... to what should it point? what path?
>
> > On Sep 26, 2:02 pm, grigri <[EMAIL PROTECTED]> wrote:
>
> > > Have you tried emptying the cache files? If the directory names have
> > > changed since cake's cache was built then this is what would happen.
>
> > > On Sep 26, 11:27 am, Eemerge <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > I would like some help with the following error:
>
> > > > Warning: require(cake/bootstrap.php) [function.require]: failed to
> > > > open stream: No such file or directory in /home/mainfram/public_html/
> > > > shoplog/app/webroot/index.php on line 79
>
> > > > Fatal error: require() [function.require]: Failed opening required
> > > > 'cake/bootstrap.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/
> > > > home/mainfram/php') in /home/mainfram/public_html/shoplog/app/webroot/
> > > > index.php on line 79
>
> > > > The strange thing about is that, 2 weeks ago it was working ,
> > > > everything was ok, there were some problems on the hosting server, and
> > > > now it stopped working.
>
> > > > If anyone cane help, i'd really appreciate it.
>
> > > > 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
-~--~~~~--~~--~--~---



  1   2   >