Pagination with recursion while using loadModel

2011-03-18 Thread ashok.b
Hi, In my "Reports" controller, which is just a dummy controller
without any actual database, I'm trying to generate a paginated view
of other models. For example, to generate paginated view of
"Transactions" model I'm doing the following:

$this->loadModel('Transactions');
$this->Transactions-
>bindModel(array('belongsTo'=>array('Item'=>array('className'=>'Item'),'Member'=>array('className'=>'Member';
$results = $this->paginate('Transactions',null,array('recursive'=>1));

But this is not giving me associated data from Items and Members. If I
do a

$this->Transactions->find('all',array('recursive'=>1))

I get the associated data, but not paginated. How will I get paginated
view which includes the associated data too?

-- 
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: CakePHP, jQuery & JSON

2011-03-18 Thread Daniel
@cronet, i always make my Ajax Request as u tried.

I tried like you to use .json ext and it never worked for me, so i
parsed .ajax extension and all work fine.. you should try .ajax
extension.

On 18 mar, 10:12, cronet  wrote:
> That works very well... Thank you guys !
>
> On 18 Mrz., 12:28, LipeDjow  wrote:
>
> > Yes.
>
> > Instead returning the value in action, you can set it to view and load a
> > general element for JSON.
> > Like this (using Taffarel's example):
>
> > function json(){
> >     //bring some data in database
> >      $json = $this->Test->find('all');
> >      $this->set('json', $json);
> >      $this->render('../elements/json.ctp');
>
> > }
>
> > // views/elements/json.ctp
> > 
>
> > then in my view I use the method getJson
>
> > $.getJSON('Html->url(array('controller'=>'tests',
> > 'action'=>'json'))?>', function(data){
> >       $("div").append(data);
>
> > });
>
> > I think this will not break MVC.
>
> > HTH
> > LipeDjow

-- 
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 there any good documentation on $form->inputs()?

2011-03-18 Thread Parris
Nevermind, figured it out!
Thanks!

On Mar 18, 1:27 pm, Parris  wrote:
> Not input singular... inputs, plural.
>
> On Mar 18, 12:52 pm, euromark  wrote:
>
> > i think there is pretty much everything 
> > covered...http://book.cakephp.org/view/1390/Automagic-Form-Elements
>
> > On 18 Mrz., 20:19, Parris  wrote:
>
> > > Everytime I use it (and I really love using it), I need to look up
> > > info about it. It is no problem with datatime, text, textfields, and
> > > checkboxes; however, on off change I need a select or upload field, I
> > > need to do some work. Furthermore, if I want to change the label I
> > > need to experiment a million times, and figure out what it is looking
> > > for... Has this function been documented in more detail anywhere? The
> > > API doc is pretty useless for this function. It isn't even in the book
> > > anymore.
>
> > > Thanks,
> > > Parris

-- 
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 there any good documentation on $form->inputs()?

2011-03-18 Thread Parris
http://api13.cakephp.org/class/form-helper#method-FormHelperinputs

On Mar 18, 12:52 pm, euromark  wrote:
> i think there is pretty much everything 
> covered...http://book.cakephp.org/view/1390/Automagic-Form-Elements
>
> On 18 Mrz., 20:19, Parris  wrote:
>
> > Everytime I use it (and I really love using it), I need to look up
> > info about it. It is no problem with datatime, text, textfields, and
> > checkboxes; however, on off change I need a select or upload field, I
> > need to do some work. Furthermore, if I want to change the label I
> > need to experiment a million times, and figure out what it is looking
> > for... Has this function been documented in more detail anywhere? The
> > API doc is pretty useless for this function. It isn't even in the book
> > anymore.
>
> > Thanks,
> > Parris

-- 
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 there any good documentation on $form->inputs()?

2011-03-18 Thread Parris
Not input singular... inputs, plural.

On Mar 18, 12:52 pm, euromark  wrote:
> i think there is pretty much everything 
> covered...http://book.cakephp.org/view/1390/Automagic-Form-Elements
>
> On 18 Mrz., 20:19, Parris  wrote:
>
> > Everytime I use it (and I really love using it), I need to look up
> > info about it. It is no problem with datatime, text, textfields, and
> > checkboxes; however, on off change I need a select or upload field, I
> > need to do some work. Furthermore, if I want to change the label I
> > need to experiment a million times, and figure out what it is looking
> > for... Has this function been documented in more detail anywhere? The
> > API doc is pretty useless for this function. It isn't even in the book
> > anymore.
>
> > Thanks,
> > Parris

-- 
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 there any good documentation on $form->inputs()?

2011-03-18 Thread euromark
i think there is pretty much everything covered...
http://book.cakephp.org/view/1390/Automagic-Form-Elements


On 18 Mrz., 20:19, Parris  wrote:
> Everytime I use it (and I really love using it), I need to look up
> info about it. It is no problem with datatime, text, textfields, and
> checkboxes; however, on off change I need a select or upload field, I
> need to do some work. Furthermore, if I want to change the label I
> need to experiment a million times, and figure out what it is looking
> for... Has this function been documented in more detail anywhere? The
> API doc is pretty useless for this function. It isn't even in the book
> anymore.
>
> Thanks,
> Parris

-- 
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: AJAX Sortable generates different code on localhost vs server

2011-03-18 Thread Ryan
I was able to fix this by doing just as you suggested...I removed all
unnecessary js references and also abandoned CakePHP's built in
AjaxHelper (since it's deprecated as you pointed out)

I'm not using scriptaculous, and it works like a charm on localhost
AND my web server :)

Thanks for your help!



On Mar 18, 1:33 pm, cricket  wrote:
> On Fri, Mar 18, 2011 at 9:36 AM, Ryan  wrote:
> > It could very well be a conflict in JS references...While working on
> > this, I threw all sorts of different .js files and references to the
> > code. I will look into that and see if I can remove/consolidate.
>
> > What really confuses me is why it works on localhost but not on the
> > server...
>
> You should carefully go over the view & layout files in question and
> remove any references to whichever JS framework you're not using. And
> also consider using rsync to ensure what's on the server is what you
> have locally.

-- 
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 there any good documentation on $form->inputs()?

2011-03-18 Thread Parris
Everytime I use it (and I really love using it), I need to look up
info about it. It is no problem with datatime, text, textfields, and
checkboxes; however, on off change I need a select or upload field, I
need to do some work. Furthermore, if I want to change the label I
need to experiment a million times, and figure out what it is looking
for... Has this function been documented in more detail anywhere? The
API doc is pretty useless for this function. It isn't even in the book
anymore.

Thanks,
Parris

-- 
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 there a maximum depth of reference for $this->Form->input()?

2011-03-18 Thread glk
Duh!  Sometimes it doesn't pay to get up in the mornings!  Thank you!


On Mar 17, 9:09 pm, kdubya  wrote:
> Looks like your forgot the echo in front of the call to 
> $this->Form->input("ShooterEvent.$we.ShooterOption.$wo.entryfee",
>
> $optbab);

-- 
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: Problem Using Ajax in Cakephp

2011-03-18 Thread cricket
On Fri, Mar 18, 2011 at 2:02 AM, Shashank  wrote:
> Finally i am able to use ajax. But now there is one more problem. I use 1)
> Ajax form 2) And made an ajax request through jquery.
> These are two different forms. For one form i used the ajax form.
> And for second one i used the jquery to make the ajax request.
> Bt the issue now i am facing is ajax forms need prototype.js and the other
> one i used need jquery.js. and as everyone know they r conflicting with each
> other. If i remove prototype.js then ajax form stops working and i fi remove
> juery my other form stops working. The issue is can anyone tell me hjow to
> make the ajax form work only based on jquery.

I think you're confusing the terminology. They're both using ajax. By
"ajax form" do you mean CakePHP's AjaxHelper? You can use that with
JQuery, also. If you're using Cake 1.3.x.

I think a better solution would be to skip the AjaxHelper and handle
it entirely with yourown code written with jquery.

-- 
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: AJAX Sortable generates different code on localhost vs server

2011-03-18 Thread cricket
On Fri, Mar 18, 2011 at 9:36 AM, Ryan  wrote:
> It could very well be a conflict in JS references...While working on
> this, I threw all sorts of different .js files and references to the
> code. I will look into that and see if I can remove/consolidate.
>
> What really confuses me is why it works on localhost but not on the
> server...

You should carefully go over the view & layout files in question and
remove any references to whichever JS framework you're not using. And
also consider using rsync to ensure what's on the server is what you
have locally.

-- 
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: Saving Drag/Drop Sortable to DB

2011-03-18 Thread cricket
On Thu, Mar 17, 2011 at 10:42 AM, Warren  wrote:
> I think you have to reset the active record in your for each loop, try this
> :
>
> foreach ($ids as $id) {
>                $this->Item->id = $id;
>                $this->Item->saveField('sort_order', $i++);
>                $this->Item->create();
>            }

You're right. Missed that. Although the line with create() should come
first, then set the id, etc.

-- 
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: CakePHP, jQuery & JSON

2011-03-18 Thread Miles J
I wrote some blog posts about this.

http://milesj.me/blog/read/62/Doing-AJAX-Calls-In-CakePHP%3A-Part-1-_-The-Front_end

On Mar 18, 7:12 am, cronet  wrote:
> That works very well... Thank you guys !
>
> On 18 Mrz., 12:28, LipeDjow  wrote:
>
> > Yes.
>
> > Instead returning the value in action, you can set it to view and load a
> > general element for JSON.
> > Like this (using Taffarel's example):
>
> > function json(){
> >     //bring some data in database
> >      $json = $this->Test->find('all');
> >      $this->set('json', $json);
> >      $this->render('../elements/json.ctp');
>
> > }
>
> > // views/elements/json.ctp
> > 
>
> > then in my view I use the method getJson
>
> > $.getJSON('Html->url(array('controller'=>'tests',
> > 'action'=>'json'))?>', function(data){
> >       $("div").append(data);
>
> > });
>
> > I think this will not break MVC.
>
> > HTH
> > LipeDjow

-- 
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: CakePHP, jQuery & JSON

2011-03-18 Thread cronet
That works very well... Thank you guys !

On 18 Mrz., 12:28, LipeDjow  wrote:
> Yes.
>
> Instead returning the value in action, you can set it to view and load a
> general element for JSON.
> Like this (using Taffarel's example):
>
> function json(){
>     //bring some data in database
>      $json = $this->Test->find('all');
>      $this->set('json', $json);
>      $this->render('../elements/json.ctp');
>
> }
>
> // views/elements/json.ctp
> 
>
> then in my view I use the method getJson
>
> $.getJSON('Html->url(array('controller'=>'tests',
> 'action'=>'json'))?>', function(data){
>       $("div").append(data);
>
> });
>
> I think this will not break MVC.
>
> HTH
> LipeDjow

-- 
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: CakePHP, jQuery & JSON

2011-03-18 Thread LipeDjow
Yes.

Instead returning the value in action, you can set it to view and load a 
general element for JSON.
Like this (using Taffarel's example):

function json(){
//bring some data in database
 $json = $this->Test->find('all');
 $this->set('json', $json);
 $this->render('../elements/json.ctp');
}

// views/elements/json.ctp


then in my view I use the method getJson 

$.getJSON('Html->url(array('controller'=>'tests', 
'action'=>'json'))?>', function(data){
  $("div").append(data);
});

I think this will not break MVC.

HTH
LipeDjow

-- 
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: Understanding Models

2011-03-18 Thread Ryan Schmidt

On Mar 18, 2011, at 04:24, varai wrote:

> I'm new to cakePHP and OOP.
> 
> I'm not understanding
> 1)what find('all') in the following code means

find('all') finds all records in this model's database table and returns them 
to you as an array.

> 2) what is the purpose of  $this->set('ingredients', $ingredients);

This sets the variable 'ingredients' (in the view) to the value of the variable 
$ingredients (here in this controller method), so that you can display it in 
the view.

> I got this from book.cakephp.org.
> 
>  class IngredientsController extends AppController {
>function index() {
>//grab all ingredients and pass it to the view:
>$ingredients = $this->Ingredient->find('all');
>$this->set('ingredients', $ingredients);
>}
> }
> 
> ?>

Spend some more time reading the book and looking at example CakePHP projects. 
Hopefully it will become clear to you how it all works together.




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


Understanding Models

2011-03-18 Thread varai
Hi

I'm new to cakePHP and OOP.

I'm not understanding
1)what find('all') in the following code means
2) what is the purpose of  $this->set('ingredients', $ingredients);
 I got this from book.cakephp.org.

Ingredient->find('all');
$this->set('ingredients', $ingredients);
}
}

?>

any help is much appreciated

-- 
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: Share You tube Vedios in Cakephp

2011-03-18 Thread Warren
True, but it would be easy if you strip that out in your code. I'm not 
sure if the average user would know what you meant if you all you asked 
for was the id. I could be wrong though.


On 18/03/2011 10:49, Ryan Schmidt wrote:

On Mar 18, 2011, at 03:14, Warren wrote:


If you go view a video on youtube you will see there is an option to get the 
embed code. This is the what you should ask your user's to input. You could 
have a simple regex check to make sure it seems like an embed code.

Actually all you want to store in your system is the youtube video id. No need 
to store (or make the user paste) the entire embed code.




--
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: Remove layout from missing controller

2011-03-18 Thread Stephen
Hi

Create /app/views/errors/missing_controller.ctp as a layout.

You can change this to show a generic 404.

Alternatively, if it's error text you want to remove, then you should get
away with it by setting debug to 0 in /app/config/core.php

On 17 March 2011 19:18, Giovanni  wrote:

> Hi,
>
> I would like to know if there is how to remove the layout that I have
> for all other pages on my website in the missing_controller.ctp file?
>
> Thank's,
> []'s
>
> --
> 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
>



-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
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: Share You tube Vedios in Cakephp

2011-03-18 Thread Ryan Schmidt

On Mar 18, 2011, at 03:14, Warren wrote:

> If you go view a video on youtube you will see there is an option to get the 
> embed code. This is the what you should ask your user's to input. You could 
> have a simple regex check to make sure it seems like an embed code.

Actually all you want to store in your system is the youtube video id. No need 
to store (or make the user paste) the entire embed code.


-- 
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: Share You tube Vedios in Cakephp

2011-03-18 Thread Warren

Not exactly.

If you go view a video on youtube you will see there is an option to get 
the embed code. This is the what you should ask your user's to input. 
You could have a simple regex check to make sure it seems like an embed 
code.


You then echo that in the view like normal html.


On 18/03/2011 10:11, Shashank wrote:
You mean i shud give the user and input field where he enters the url 
of youtube, and on submit i produce this iframe whose src will be the 
url that the user entered


On Fri, Mar 18, 2011 at 1:32 PM, Warren > wrote:


Could you not use a simple form field that take the embed code
from youtube eg : http://www.youtube.com/embed/8rluU6BGpKw";
frameborder="0" allowfullscreen> ?

And then echo that in the view?


On 18/03/2011 09:58, Shashank wrote:

Hi Guys,
I need to know a way that enables the user to share youtube
vedios on
the site.

Thanks


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




--
Shashank Singh
B.E.(Computer Science)
Software Developer
+91-9711882054
+91-9560545085
Skype id: shashank.singh87
Email: shashank.si...@sourcefuse.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


--
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: Vedio Upload in Cakephp

2011-03-18 Thread Jeremy Burns | Class Outfit
Why are there two threads from the same person on the same subject?

Jeremy Burns
Class Outfit

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

On 18 Mar 2011, at 08:12, Shashank wrote:

> Hmm. Then let me try it through you tube then .
> 
> On Fri, Mar 18, 2011 at 1:36 PM, mike karthauser  
> wrote:
> 
> On 18 Mar 2011, at 07:30, Shashank wrote:
> 
>> Hi,
>> I am trying to do something new here. I want a feature something like
>> ds:
>> A user been able to upload a vedio from his local pc, and then he can
>> go over the site to play and watch it. I have no idea how to do ds.
>> But i need to get it done asap.
> 
> i suggest using youtube or vimeo to host the video and then just embedding 
> their code in your site.
> 
> uploading video can be a big task as you'll need to keep a socket open for 
> long enough to move the file and also will need to ensure you've got it in a 
> suitable compact enough compression format to play back. why not let youtube 
> cope with this for you?
> 
> mikek
> 
>> 
>> 
>> Any helps will be greatly appreciated!!!
>> 
>> -- 
>> 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
>> 
> 
> -- 
> Mike Karthäuser
> Managing Director - Brightstorm Ltd 
> Email: mi...@brightstorm.co.uk 
> Web: http://www.brightstorm.co.uk 
> Tel: 07939 252144
> Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
> 
> 
> -- 
> 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
> 
> 
> 
> -- 
> Shashank Singh
> B.E.(Computer Science)
> Software Developer
> +91-9711882054
> +91-9560545085
> Skype id: shashank.singh87
> Email: shashank.si...@sourcefuse.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

-- 
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: Vedio Upload in Cakephp

2011-03-18 Thread Shashank
Hmm. Then let me try it through you tube then .

On Fri, Mar 18, 2011 at 1:36 PM, mike karthauser wrote:

>
> On 18 Mar 2011, at 07:30, Shashank wrote:
>
> Hi,
> I am trying to do something new here. I want a feature something like
> ds:
> A user been able to upload a vedio from his local pc, and then he can
> go over the site to play and watch it. I have no idea how to do ds.
> But i need to get it done asap.
>
>
> i suggest using youtube or vimeo to host the video and then just embedding
> their code in your site.
>
> uploading video can be a big task as you'll need to keep a socket open for
> long enough to move the file and also will need to ensure you've got it in a
> suitable compact enough compression format to play back. why not let youtube
> cope with this for you?
>
> mikek
>
>
>
> Any helps will be greatly appreciated!!!
>
> --
> 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
>
>
> --
> Mike Karthäuser
> Managing Director - Brightstorm Ltd
> Email: mi...@brightstorm.co.uk
> Web: http://www.brightstorm.co.uk
> Tel: 07939 252144
> Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
>
>  --
> 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
>



-- 
Shashank Singh
B.E.(Computer Science)
Software Developer
+91-9711882054
+91-9560545085
Skype id: shashank.singh87
Email: shashank.si...@sourcefuse.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: Share You tube Vedios in Cakephp

2011-03-18 Thread Shashank
You mean i shud give the user and input field where he enters the url of
youtube, and on submit i produce this iframe whose src will be the url that
the user entered

On Fri, Mar 18, 2011 at 1:32 PM, Warren  wrote:

> Could you not use a simple form field that take the embed code from youtube
> eg : http://www.youtube.com/embed/8rluU6BGpKw"; frameborder="0"
> allowfullscreen> ?
>
> And then echo that in the view?
>
>
> On 18/03/2011 09:58, Shashank wrote:
>
>> Hi Guys,
>> I need to know a way that enables the user to share youtube vedios on
>> the site.
>>
>> Thanks
>>
>>
> --
> 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
>



-- 
Shashank Singh
B.E.(Computer Science)
Software Developer
+91-9711882054
+91-9560545085
Skype id: shashank.singh87
Email: shashank.si...@sourcefuse.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: Vedio Upload in Cakephp

2011-03-18 Thread mike karthauser

On 18 Mar 2011, at 07:30, Shashank wrote:

> Hi,
> I am trying to do something new here. I want a feature something like
> ds:
> A user been able to upload a vedio from his local pc, and then he can
> go over the site to play and watch it. I have no idea how to do ds.
> But i need to get it done asap.

i suggest using youtube or vimeo to host the video and then just embedding 
their code in your site.

uploading video can be a big task as you'll need to keep a socket open for long 
enough to move the file and also will need to ensure you've got it in a 
suitable compact enough compression format to play back. why not let youtube 
cope with this for you?

mikek

> 
> 
> Any helps will be greatly appreciated!!!
> 
> -- 
> 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
> 

-- 
Mike Karthäuser
Managing Director - Brightstorm Ltd 
Email: mi...@brightstorm.co.uk 
Web: http://www.brightstorm.co.uk 
Tel: 07939 252144
Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

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


Share You tube Vedios in Cakephp

2011-03-18 Thread Shashank
Hi Guys,
I need to know a way that enables the user to share youtube vedios on
the site.

Thanks

-- 
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: Share You tube Vedios in Cakephp

2011-03-18 Thread Warren
Could you not use a simple form field that take the embed code from 
youtube eg : height="390" src="http://www.youtube.com/embed/8rluU6BGpKw"; 
frameborder="0" allowfullscreen> ?


And then echo that in the view?

On 18/03/2011 09:58, Shashank wrote:

Hi Guys,
I need to know a way that enables the user to share youtube vedios on
the site.

Thanks



--
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: [Ask] Query to select multiple table in cakephp

2011-03-18 Thread thom
On Fri, Mar 18, 2011 at 11:14 AM, cricket  wrote:
> When I did this I didn't bother modelizing ArosAcos. This is from my
> SectionsController. Each Group has different rights for each Section.
>

Well, what exactly I want is I wanna make a simple ACL Management
based on aros_acos table. So, I wanna update permission, just like
drupal's. But It's not as simple as I thought. Or maybe it's just my
mind which made it not.

I am not quiet understand yet with Joining table in cake. So, what do
you suggest then? I am at my confusing-point already.

-- 
Regards,,,
mastanto
http://www.mastanto.com
http://thom-sharing.blogspot.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: Please help:Country and its state in index

2011-03-18 Thread andy_the ultimate baker
=>this is my ctp


List of Country 
List of State 
Edit
Delete






image('edit.png',array('width'=>'24' ,'height'=>'24'));?>


Html->link($html->image("delete.png" ,array('alt' => 'Delete',
'title' => 'Delete')), array('action' =>'state_delete', $state['State']
['id'],'page'=>$this->params['paging']['State']['page']),
array('escape' => false),sprintf('Are you sure you want to delete this
entry?', $state['State']['id']),false);?>



=>now with this what should i do to get desired. will u please suggest
logic for this.

On Mar 18, 12:16 pm, Ryan Schmidt  wrote:
> On Mar 18, 2011, at 02:04, andy_the ultimate baker wrote:
>
>
>
> > i m trying to display states with respect to country in index.
> > but country is displaying each time for each state.
>
> > i want to get all the state for under its respective country for each
> > time.
> > eg. if i have india as country having many sates then all states
> > belongs to india will come under one index item. like
> >                                     Country Name  State Name
> >                                     country1                abc
> >                                                                  pqr
> >                                                                  xyz
> >                                     country2                efg
> >                                                                  mno
> >                                                                  dfg
>
> > like this
>
> What have you tried so far? Show us some code.

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


Vedio Upload in Cakephp

2011-03-18 Thread Shashank
Hi,
I am trying to do something new here. I want a feature something like
ds:
A user been able to upload a vedio from his local pc, and then he can
go over the site to play and watch it. I have no idea how to do ds.
But i need to get it done asap.


Any helps will be greatly appreciated!!!

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


Please help:Country and its state in index

2011-03-18 Thread andy_the ultimate baker
hi,
i m trying to display states with respect to country in index.
but country is displaying each time for each state.

i want to get all the state for under its respective country for each
time.
eg. if i have india as country having many sates then all states
belongs to india will come under one index item. like
 Country Name  State Name
 country1abc
  pqr
  xyz
 country2efg
  mno
  dfg

like this

plese anyone help in this

-- 
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: Please help:Country and its state in index

2011-03-18 Thread Ryan Schmidt
On Mar 18, 2011, at 02:04, andy_the ultimate baker wrote:

> i m trying to display states with respect to country in index.
> but country is displaying each time for each state.
> 
> i want to get all the state for under its respective country for each
> time.
> eg. if i have india as country having many sates then all states
> belongs to india will come under one index item. like
> Country Name  State Name
> country1abc
>  pqr
>  xyz
> country2efg
>  mno
>  dfg
> 
> like this

What have you tried so far? Show us some code.


-- 
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: apostrophe in URl and view cache

2011-03-18 Thread qua...@gmail.com
Thanks but I should have made it clear that I do urlencode the URL. I
just didn't show the encoded URL here.

On Mar 17, 4:46 pm, Ryan Schmidt  wrote:
> On Mar 17, 2011, at 13:24, qua...@gmail.com wrote:
>
> > I am having a problem with cache if the URL has apostrophe in it.
>
> > For example:
> >www.example.com/controller/action/What'sMy Name
>
> > On first load when cache isn't there, it loads fine. However, once the
> > cache is created, the subsequent load of the page causes PHP syntax
> > error because in the cache file there is a line:
>
> > $controller->here = $this->here = '/controller/action/What's My
> > Name?';
>
> > Note the apostrophe isn't escaped and hence the PHP syntax error.
>
> > How can I fix this? Is this considered a bug in Cake?
>
> I don't know... does the problem still happen if you properly escape the 
> URLs? Spaces and apostrophes, among others, are not valid characters in URLs, 
> so your URL would properly be written:
>
> http://www.example.com/controller/action/What%27s%20My%20Name
>
> Or, if you're trying to make slugs, then you might want it to look like:
>
> http://www.example.com/controller/action/whats-my-name

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