Re: HTML ENTITIES

2011-08-28 Thread Prabha vathi
I am never going to use html. Then why should i increase database size?

On Sun, Aug 28, 2011 at 10:09 AM, Miles J mileswjohn...@gmail.com wrote:

 So whats your reasoning for not wanting HTML in the database?

 Not like it can really break anything.

 On Aug 27, 2:31 pm, Ryan Schmidt google-2...@ryandesign.com wrote:
  On Aug 27, 2011, at 03:46, Prabha vathi wrote:
 
   echo $html-link(
   Sanitize::html($post_array['content'], array('remove'
 = true)),
   array(
   'controller' = 'posts',
   'action' = 'view',
   'id' = $post_array['id'],
   'quotes' =
 $this-Link-makeSeoUrl(Sanitize::html($post_array['content'],
 array('remove' = true)))
   ),
   array('title' =
 substr(Sanitize::html($post_array['content'], array('remove' =
 true)),0,20). ... Quotes of the day, 'class' = 'agrizlink')
   );
 
   Now db has text like this - you're - but it is displayed like this -
 you#039;re in view.
   But if there is no link, then it is working correctly. What is the
 problem?
 
  Sanitize::html is escaping it once. Then $html-link is escaping it a
 second time.
 
  Tell $html-link not to escape it that second time by passing false in
 the $escapeTitle parameter.
 
  http://book.cakephp.org/view/1363/link
 
  Note, by the way, that $html is old CakePHP 1.2 syntax. For CakePHP
 1.3, you want to use $this-Html instead.

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




-- 
-- 
Prabhavathi
http://www.indiapublicforum.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


Re: Pre CakeFest meetup in Manchester?

2011-08-28 Thread WebbedIT
@WebbedIT Are you doing the full 4 days or just the conference?

On Aug 27, 11:55 pm, designv...@gmail.com designv...@gmail.com
wrote:
 Prolly easiest way to do this is to add eachother to twitter - my
 username is: designvoid

 Really happy to meet up with folks and show you around a bit!

 On Aug 26, 8:16 pm, mark_story mark.st...@gmail.com wrote:







  I'll be around a day prior as well and would be more than happy to
  grab a pint :)

  -Mark

  On Aug 25, 6:04 pm, designv...@gmail.com designv...@gmail.com
  wrote:

   Hi all,

   I actually live in Manchester and am obviously going to CakeFest, so I
   thought I would see if anyone travelling from abroad and gets in a day
   or 2 early would like a pre-fest meetup?

   I am around in Manchester and free every evening until the start of
   CakeFest, so if anyone fancies it, please feel free to hit me up at
   dv...@designvoid.com

   Cheers!

   d//t

-- 
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: Pre CakeFest meetup in Manchester?

2011-08-28 Thread designv...@gmail.com
I doing the 4 days, so will be around for all of it.

d//t.

On Aug 28, 8:18 am, WebbedIT p...@webbedit.co.uk wrote:
 @WebbedIT Are you doing the full 4 days or just the conference?

 On Aug 27, 11:55 pm, designv...@gmail.com designv...@gmail.com
 wrote:







  Prolly easiest way to do this is to add eachother to twitter - my
  username is: designvoid

  Really happy to meet up with folks and show you around a bit!

  On Aug 26, 8:16 pm, mark_story mark.st...@gmail.com wrote:

   I'll be around a day prior as well and would be more than happy to
   grab a pint :)

   -Mark

   On Aug 25, 6:04 pm, designv...@gmail.com designv...@gmail.com
   wrote:

Hi all,

I actually live in Manchester and am obviously going to CakeFest, so I
thought I would see if anyone travelling from abroad and gets in a day
or 2 early would like a pre-fest meetup?

I am around in Manchester and free every evening until the start of
CakeFest, so if anyone fancies it, please feel free to hit me up at
dv...@designvoid.com

Cheers!

d//t

-- 
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: Scalable CakePHP Architecture

2011-08-28 Thread Dr. Tarique Sani
I would still like to stick with my original stance of splitting the
code into applications rather than plugins irrespective of whatever
caching solution you use. Varnish is a good choice.

Cheers
Tarique

On Sun, Aug 28, 2011 at 2:48 AM, Ben McClure ben.mccl...@gmail.com wrote:
 I would agree that splitting the code into plugins would make the most sense
 as far as extensibility goes--each developer you outsource to gets the code
 for the plugin(s) they are working on, and they shouldn't need anything
 else.


-- 
=
PHP for E-Biz: http://sanisoft.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


Re: Scalable CakePHP Architecture

2011-08-28 Thread Ben McClure
Certainly a valid approach, but why do you need the overhead of multiple 
applications when you could simply have one application with several 
plugins?

The plugin concept also allows you to run it in as many different apps as 
you'd like, but doesn't require that they remain as separate applications if 
you no longer want the overhead of managing several apps at once.

I can't figure out a single downside, if truth be told, to splitting it out 
into plugins, even if you do plan to run every plugin in a separate 
application, heh.

Ben

-- 
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: Pre CakeFest meetup in Manchester?

2011-08-28 Thread mail
I would be interested in attending Fest, is it Manchester-Uk? I have a 
moderately large website developed in Cakephp and i am currently looking for a 
parttime developer so it would be exciting to meet you guys. Please keep me 
posted with the location of the fest.

tijan

--- On Sun, 28/8/11, designv...@gmail.com designv...@gmail.com wrote:

From: designv...@gmail.com designv...@gmail.com
Subject: Re: Pre CakeFest meetup in Manchester?
To: CakePHP cake-php@googlegroups.com
Date: Sunday, 28 August, 2011, 2:53

I doing the 4 days, so will be around for all of it.

d//t.

On Aug 28, 8:18 am, WebbedIT p...@webbedit.co.uk wrote:
 @WebbedIT Are you doing the full 4 days or just the conference?

 On Aug 27, 11:55 pm, designv...@gmail.com designv...@gmail.com
 wrote:







  Prolly easiest way to do this is to add eachother to twitter - my
  username is: designvoid

  Really happy to meet up with folks and show you around a bit!

  On Aug 26, 8:16 pm, mark_story mark.st...@gmail.com wrote:

   I'll be around a day prior as well and would be more than happy to
   grab a pint :)

   -Mark

   On Aug 25, 6:04 pm, designv...@gmail.com designv...@gmail.com
   wrote:

Hi all,

I actually live in Manchester and am obviously going to CakeFest, so I
thought I would see if anyone travelling from abroad and gets in a day
or 2 early would like a pre-fest meetup?

I am around in Manchester and free every evening until the start of
CakeFest, so if anyone fancies it, please feel free to hit me up at
dv...@designvoid.com

Cheers!

d//t

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

-- 
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: Scalable CakePHP Architecture

2011-08-28 Thread Dr. Tarique Sani
#1 Share nothing architecture

:-)

Tarique

On Sun, Aug 28, 2011 at 7:17 PM, Ben McClure ben.mccl...@gmail.com wrote:
 Certainly a valid approach, but why do you need the overhead of multiple
 applications when you could simply have one application with several
 plugins?

-- 
=
PHP for E-Biz: http://sanisoft.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


Re: Pre CakeFest meetup in Manchester?

2011-08-28 Thread mail
Thanks. How much was the tkt for? This is very close to my office. Would 
perhaps hang around to chat to pple

Tijan

--- On Sun, 28/8/11, Larry E. Masters php...@gmail.com wrote:

From: Larry E. Masters php...@gmail.com
Subject: Re: Pre CakeFest meetup in Manchester?
To: cake-php@googlegroups.com
Date: Sunday, 28 August, 2011, 7:57

tijan,
You can no longer attend the event this year, we closed reservations last week. 
http://cakefest.org is where you can find information about our annual CakeFest 
event.

--
Larry E. Masters

On Sun, Aug 28, 2011 at 9:05 AM, mail info_fine...@yahoo.com wrote:

I would be interested in attending Fest, is it Manchester-Uk? I have a 
moderately large website developed in Cakephp and i am currently looking for a 
parttime developer so it would be exciting to meet you guys. Please keep me 
posted with the location of the fest.


tijan

--- On Sun, 28/8/11, designv...@gmail.com designv...@gmail.com wrote:


From: designv...@gmail.com designv...@gmail.com

Subject: Re: Pre CakeFest meetup in Manchester?
To: CakePHP cake-php@googlegroups.com
Date: Sunday, 28 August, 2011, 2:53


I doing the 4 days, so will be around for all of it.

d//t.

On Aug 28, 8:18 am, WebbedIT p...@webbedit.co.uk wrote:
 @WebbedIT Are you doing the full 4 days or just the conference?


 On Aug 27, 11:55 pm, designv...@gmail.com designv...@gmail.com

 wrote:







  Prolly easiest way to do this is to add eachother to twitter - my
  username is: designvoid

  Really happy to meet up with folks and show you around a bit!


  On Aug 26, 8:16 pm, mark_story mark.st...@gmail.com wrote:

   I'll be around a day prior as well and would be more than happy
 to
   grab a pint :)

   -Mark

   On Aug 25, 6:04 pm, designv...@gmail.com designv...@gmail.com

   wrote:

Hi all,

I actually live in Manchester and am obviously going to CakeFest, so I
thought I would see if anyone travelling from abroad and gets in a day

or 2 early would like a pre-fest meetup?

I am around in Manchester and free every evening until the start of
CakeFest, so if anyone fancies it, please feel free to hit me up at

dv...@designvoid.com

Cheers!

d//t

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





-- 

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







-- 

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

-- 
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: Pre CakeFest meetup in Manchester?

2011-08-28 Thread Graham Weldon
Hi Tijan,

Ticket details are still on the site if you are interested, though as Larry 
mentioned, sales are now closed: http://cakefest.org/ticket-info

Where abouts do you work?
Perhaps Larry (president of the cake software foundation) and Myself (lowly 
servant) could drop in and visit on monday.

Cheers,
Graham Weldon
(AKA: predominant)

-- 
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: Pre CakeFest meetup in Manchester?

2011-08-28 Thread mail
Just sent an email to you and Larry at: predomin...@com  php...@com

--- On Sun, 28/8/11, Graham Weldon predomin...@gmail.com wrote:

From: Graham Weldon predomin...@gmail.com
Subject: Re: Pre CakeFest meetup in Manchester?
To: cake-php@googlegroups.com
Date: Sunday, 28 August, 2011, 8:36

Hi Tijan,
Ticket details are still on the site if you are interested, though as Larry 
mentioned, sales are now closed: http://cakefest.org/ticket-info
Where abouts do you work?Perhaps Larry (president of the cake software 
foundation) and Myself (lowly servant) could drop in and visit on monday.
Cheers,Graham Weldon(AKA: predominant)




-- 

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

-- 
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: Scalable CakePHP Architecture

2011-08-28 Thread Ben McClure
I don't know, whether spread out over several installations or in one (or 
several) installations utilizing plugins, the various components are going 
to need to talk to each other and share data anyway... 

Developing in separate applications is the ultimate in separation of code, I 
suppose, but I still don't see any benefit--you're going to need to do extra 
work to get those applications communicating with each other without really 
any benefit from developing them separately as plugins and combining them to 
work together later.

Wanting separation of the code for development purposes was mostly what I 
gathered from the original post, and developing with separate plugins 
doesn't do any worse a job at that than developing it with separate 
applications.

The obvious benefit with plugins, of course, is that down the road you can 
change up which applications your plugins are in. Maybe you initially put 
all of the plugins in your main installation, and eventually you find that 
there's just too much going in there--no problem! It would be as simple as 
moving a plugin directory to a new app and you've got that same 
functionality elsewhere.

You can't quite get that level of flexibility without utilizing Cake's 
wonderful Plugin architecture, which are themselves much like a 
self-contained applications, but with a lot of flexibility and reusability.

Ben

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


Pretty HABTM List Entry

2011-08-28 Thread Mondo
I have a Recipe, Item, and Units table/model. I have a HABTM
relationship with Recipe and Item, and I get the default multiple-
select box when adding/editing Recipe. (am using Bake for everything
for the most part). The problem is I need to associate quantities and
units with each Item.



Sample of UI I'm hoping for: http://i.stack.imgur.com/Y4T6T.png



A big component of it is the ability to add/delete/edit the individual
items. I imagine looking at the submitted form data, and using some
jquery and clone would work. But I was wondering if someone already
created a Behavior perhaps for this already?

Current Models (shortened to the relevant stuff, ie removed users/
notes/etc):

class Item extends AppModel {
var $name = 'Item';

// id : int
// name : varchar
// unit_id : int

var $belongsTo = array(
'Unit' = array(
'className' = 'Unit',
'foreignKey' = 'unit_id'
),
);

var $hasAndBelongsToMany = array(
'Recipe' = array(
'className' = 'Recipe',
'joinTable' = 'recipes_items',
'foreignKey' = 'item_id',
'associationForeignKey' = 'recipe_id',
)
);
}
.

class Recipe extends AppModel {
var $name = 'recipe';
var $displayField = name;

// id : int
// name : varchar


var $hasAndBelongsToMany = array(
'Item' = array(
'className' = 'Item',
'joinTable' = 'recipes_items',
'foreignKey' = 'recipe_id',
'associationForeignKey' = 'item_id',
)
);
}
.

class RecipesItem extends AppModel {
var $name = 'RecipesItem';

// id : int
// quantity : int
// unit_id : int
// recipe_id : int
// item_id : int



var $belongsTo = array(
'Unit' = array(
'className' = 'Unit',
'foreignKey' = 'unit_id'
),
'Recipe' = array(
'className' = 'Recipe',
'foreignKey' = 'recipe_id'
),
'Item' = array(
'className' = 'Item',
'foreignKey' = 'item_id'
)
);
}

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


Is cakephp 2 beta ready for small web development?

2011-08-28 Thread Salines
My Dear,

I need to build a small CMS that will have more external data sources 
(Facebook, 
Twitter, Youtube,..). I now have doubt whether to use, 1.3.11 or 2.0 beta.

I know that the new version is a beta, but the development and upgrading of 
CMS will be a long-term deal for more customers.

Thanks for your opinion.

-- 
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: Is cakephp 2 beta ready for small web development?

2011-08-28 Thread Tilen Majerle
use 1.3.11
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/8/28 Salines nikola.parad...@gmail.com

 My Dear,

 I need to build a small CMS that will have more external data sources 
 (Facebook,
 Twitter, Youtube,..). I now have doubt whether to use, 1.3.11 or 2.0 beta.

 I know that the new version is a beta, but the development and upgrading
 of CMS will be a long-term deal for more customers.

 Thanks for your opinion.

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


-- 
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: accessing field of paginate array in my view

2011-08-28 Thread Tomfox Wiranata

thx thats kimd of a good idea :)


On 26 Aug., 12:15, WebbedIT p...@webbedit.co.uk wrote:
 OK, I would create a model for the BookUser table rather than using
 the standard HABTM relationship.  This way, BookUser would belongTo
 Book and User and you can run a paginate on BookUser being able to
 simply include conditions from all 3 tables.

 I assume we're working in an action of /users/profile.  If so, I would
 then have the following (I specify the paginate parameters just before
 I call paginate so I can have all variables available for conditions).

 function profile($nickname = null) {
   if($username) {
     $user = $this-User-find('first',
 array('conditions'=array('User.nickname'=$nickname)));
   } else {
     $user = $this-User-find('first',
 array('conditions'=array('User.nickname'=$nickname)));
   }

   $this-paginate['BookUser'] = array(
     'conditions' = array('BookUser.user_id'=$user['User']['id']),
     'contain' = array('Book'),
     'order' = array('BookUser.created' = 'DESC'),
     'limit' = 25
   );
   if($user['User']['id'] != $this-Session-read('Auth.User.id')) {
     $this-paginate['BookUser']['conditions']['Book.is_visible'] = 1;
   }
   $books = $this-paginate('BookUser');

   $this-set(array(
     'user'=$user,
     'books'=$books
   ));

 }

 Untested but, other than some possible typos, it should work fine.

 HTH, Paul.

 On Aug 24, 9:31 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote:



  and to differ between one attribute visible=true and visible=false
  i wanted to make two paginates with the same model in the same view.
  but that wont work in cake...

  On Aug 24, 10:03 am, Tomfox Wiranata tomfox.wiran...@gmail.com
  wrote:

   i wouldnt be surprised if i did :).
   but i am using the same action profile because the index of the
   books is shown on that profile... or to be more specific, in the view
   profile.ctp i included an
   $this-element that shows all books, that each user is following.

   that is, why i am using one paginator. it happens all in one
   controller, in my view/action profile

   On Aug 24, 9:04 am, WebbedIT p...@webbedit.co.uk wrote:

Tomfox,

I think you're approaching this from the wrong angle.

When a user is viewing their profile you're running a different action
to when viewing the index of books. In each of these actions you would
run different paginates/finds on the book model to find what you're
after.

/users/profile/$username: Book.user_id=$user_id

/books/index: Book.is_visible=1

HTH, Paul

On Aug 23, 10:01 pm, Tomfox Wiranata tomfox.wiran...@gmail.com
wrote:

 hi everyone,

 i have the object book with its attribute visible as boolean. i wanna
 use pagination and it works except for one thing.

 first i did two this-paginate in my controller. one with visible
 condition true and the other with false. but cake doesnt like two
 paginations in one controller.

 so i just returned any book, that a user follows, no matter if it is
 set to visible true or false.

 controller:
         public $paginate = array('Book' = array('limit' = 1, 
 'joins' =
 array(
         array(
             'table' = 'books_users',
             'alias' = 'BookUser',
             'conditions'= array('BookUser.fk_book_id = Book.id AND
 Book.locked = false')
         )
     )));

 NOW in my view, i want to make the distinction. when the user is
 visiting his own profile, non visible books are listed, since these
 are his own. if someone visits a another profile, the non visible
 books shall not appear.

 view:

 if ($user['User']['username'] == 
 $this-Session-read('User.username'))
 {

      if ($private_books['BookUser']['BooksUser']['visible'] = 'true')
      ...show

      else
      ...dont show

 Problem: i cant access the visible field from the pagination array,
 that looks like that

 [BookUser] = Array
         (
             [0] = Array
                 (
             [firstname] = test
             [lastname] = user
             [username] = testuser

             [BooksUser] = Array
                 (

                          [visible] = 1
 
                 )

         )

 )

 }

 so how can i access the visible here? I tried

   if ($private_books['BookUser']['BooksUser']['visible'] = 1)

 but it didnt work

 thanks :)- Hide quoted text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -

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


Pagination and JQuery: Passing parameters with JQuery to controller

2011-08-28 Thread Tomfox Wiranata
Hi,

this is hard to explain quick but i'll try :)

I have one view profile in my controller. in that profile.ctp i have
two elements. following and created. in each element i want
paging.

i got it work for the element following but i need also for
created. The Catch:

i need to use one paginate in my profile function for two elements. so
my approach is, depending on what paginator you click, following or
created, a specific variable is passed to the controllers

$this-RequestHandler-isAjax()

function, which is rendering the specific element (following or
created). And thats what i got so far:


controller:
===

public $paginate = array(
'Link' =
  some code
)),

'Created' =
   some code
)
);


function profile()
{


$following = $this-paginate('Link', $conditions);
 $created = $this-paginate('Created');

$this-set('following', $following);
$this-set('created', $created);


if ($this-RequestHandler-isAjax()) {
$this-render('/elements/users/following');
return;
}

}


view profile


$('#pagination_follow a').live('click', function() {
var url = $(this).attr(href);
$('#following_popup').load(url);
return false;
});

$('#pagination_created a').live('click', function() {
var url = $(this).attr(href);
$('#following_popup').load(url);
return false;
});



so basically i would code two divs pagination_created in element
created and
pagination_follow in the element following. depending on what div
a user clicks i want to pass a value to the isAjax() function in
controller, like this


if ($this-RequestHandler-isAjax())
{

when user clicks on div pagination_follow
$this-render('/elements/users/following');
return;

when user clicks on div pagination_created
$this-render('/elements/users/created');
return;
}

so pagination knows what element to renderis that possible and how
can i pass a variable to the controller?

thanks a lot :)

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