Re: Translate on BelongsToMany

2012-12-17 Thread lowpass
It's not very clear what you're doing. Can you post the model
associations and the column names for each table?

But are you certain that you want to use HABTM? Can different
Categories share a SubCategory? If a SubCategory can only belong to
ONE Category then you should use:

Category hasMany SubCategory
SubCategory belongsTo Category

Better:

Category model:

public $actsAs = array(
'Tree' => array(
'parent' => 'parent_id',
'left' => 'lft',
'right' => 'rght'
)
);

... And forget about having a separate model for SubCategory.



On Mon, Dec 17, 2012 at 11:33 AM, Carlos Eduardo Sotelo Pinto
 wrote:
> Dear coders
>
> I have an issue on a project That I am working, I have to models linked
> on a belongsToMany relationship, and both of them are using the
> translate behavior
>
> i18n -> SubCategory [ belongsToMany ] Category <- i18n
>
> Then I need to do a list like
>
> CategryName - SubCategoryName
>
> As you could see I need to concatenate Name field on both models, and
> name field on both models are translated, I mean, both of them name
> fields are on the i18n table, then when I do a
>
> $this->Subcategory->find ('all');
>
> for process and user the fields needed,  I could see that Categroy,
> doesnt have the Name field, just Subcategory has the name field
>
> Any suggest
>
> Best Regards
>
>
> --
> Carlos Eduardo Sotelo Pinto
> GNU Linux Admin | PHP Senior Web Developer
> MObil: RPC (Claro)+51, 958194614
> http://www.carlossotelo.com
> Skype: csotelop
> Yahoo: csotelop
> MSN: carlos.sotelo.pi...@gmail.com
> GTalk: carlos.sotelo.pi...@gmail.com
> GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B
> GNULinux RU #379182 || GNULinux RM #277661
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to 
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

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

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




Re: users session delete, destroy ??

2012-12-17 Thread Jorge Gonzalez Ortiz
I suppose you'd have in session the user id.

Why not check if the user exists in the database or is enabled?

Maybe you don't want to do it in any request doing it one time each four
for example, or if you don't have a lot of traffic do it always before
doing any action.

BeforeFilter can help you with this.

http://book.cakephp.org/2.0/en/controllers.html

Regards,


-- 
Jorge González

Web Developer
twitter: @jorgonor
website: http://jorgonor.blogspot.com.es
github: https://github.com/jorgonor


2012/12/17 Chris 

>
> hi guys,...
> I'm building administration feature to manage users,... delete,
> deactivate,... etc,...
> Me, as admin, would like to delete some user and have him/here kicked out
> from logged in page,...
> so next thing he clicks anywhere on a site he will be logged off.
>
> I can't delete user session,... the function is deleting user, but it
> delete my session and not user.
> Destroying session$this->Session->destroy(); is not an option,...
> since it will destroy ALL users session while some uploading photos or
> creating blogs, groups, videos,... etc,...
> How can I do this,... ? Can someone help please,...
>
> here is my function:
>
>   function admin_delete($id = null)
>   {
> if(!$this->authorize_admin())
>   return;
>
> if(!($user = $this->User->findById($id)))
> {
>   $this->flash('error', ucfirst(i18n::translate('user not found')));
>   $this->redirect('/admin/users/manage/');
> }
> else
> {
>   if($this->User->delete($user['User']['id']))
>   {
>// $this->Session->delete('user'); // This deleting my session,... not
> the user session
>// $this->Cookie->delete('User.username');
>// $this->Cookie->delete('User.hashed_password');
>
>// $this->Session->destroy(); // This is destroying ALL users session,
> which I don't want to
>
>$this->Session->delete($user['User']['id']); // Here is the part where
> I want to delete user sission
>$this->Cookie->delete($user['User']['username']);
>$this->Cookie->delete($user['User']['hashed_password']);
>
> $this->flash('valid', ucfirst(i18n::translate('account deleted')));
> $this->redirect('/admin/users/manage/');
>   }
>
>  }
>
>   }
>
>
> Thanks in advance
> chris
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

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

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




Re: Need some HABTM help retrieving related posts

2012-12-17 Thread lowpass
Post model:

public $hasMany = array(
'RelatedPost' => array(
'className' => 'Post',
'foreignKey' => false,
'limit' => 5,
'order' => array('RelatedPost.created' => 'DESC'),
'finderQuery' => 'SELECT RelatedPost.id, RelatedPost.title
FROM posts AS RelatedPost
INNER JOIN posts_tags AS PostTag
ON PostTag.post_id = 
RelatedPost.id
WHERE PostTag.tag_id IN
(SELECT tag_id FROM posts_tags 
WHERE post_id = {$__cakeID__$})
AND RelatedPost.id != 
{$__cakeID__$}'   
)
);

public function fetch($id)
{
return $this->find(
'first',
array(
'conditions' => array(
$this->alias.'.id' => $id
)
)
);
}

Add RelatedPost.slug to the query if, like me, you prefer to pass
slugs. And change the fetch method, of course.

I included the order just to show that it can be.

On Sun, Dec 16, 2012 at 3:20 PM, MetZ  wrote:
> Okei, so I have a HABTM setup:
> - posts
> - tags
> - posts_tags
>
> When creating posts => select multiple tags: example: Tag1, Tag2, Tag3
>
> Each selected tag is saved to posts_tags: id:1, post_id: 44, tag_id: 3  (and
> so on).
>
> Now, displaying my posts, and listing the selected tags, is no problem.
> Everything is working flawlessly.
>
> However, I would like to have widget "You might also like these posts" =>
> list 5 posts with similar content (using the same tags as the post beeing
> read).
>
> So here I came across some difficulty finding similar posts according to
> selected tags.
>
> Example: Is Post.id = 44  (beeing read) have Tag.id = 1, 3 ,4 assigned
>
> How can I retrieve 5 other posts that have the same Tag.id assigned, and
> exclude the Post.id beeing read from the find??
>
> I guess I will need to use some kind of join/grouping, but I am a total noob
> regarding those things, so any help on this will be GREATLY appreciated!!
>
> Thanks for your time!
>
> -Tom
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

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

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




Re: select box link and jump to selected category

2012-12-17 Thread Chris
thanks cricket,... I'll go dig into it,... I'll update you with results,... 
thank you so much for your help,... you are responding to almost any post 
that I make,... 


On Saturday, December 15, 2012 12:37:38 PM UTC-8, cricket wrote:
>
> D'oh! Screwed up twice. That's not the Sluggable I meant. Use this one:
>
>
> https://github.com/dereuromark/tools/blob/2.0/Model/Behavior/SluggedBehavior.php
>
> That other one is a really lame "update" of the original.
>
>
> On Sat, Dec 15, 2012 at 3:18 PM, lowpass 
> > wrote:
>
>> On Fri, Dec 14, 2012 at 7:55 PM, Chris > >wrote:
>>
>>> hi cricket,... 
>>> this is what I got so far: 
>>> it's kind of works,... but then again not completely, I'm loosing 
>>> categories value: 
>>>
>>
>> No, you're not losing the values; you want something other than the 
>> defaults, but haven't taken the right steps to achieve that.
>>  
>>
>>>  Form->create('', array('id'=>'FormId')); ?>
>>>  Form->input("categories" , array('label' => false, 
>>> 'type' => 'select', 'value'=>$categories, 'options'=>$categories)) ?>
>>>
>>
>> echo $this->Form->select('categories', $categories, array('options' => 
>> false));
>>  
>>
>>> this is output: 
>>>  where it should be 
>>> value=arts 
>>> value=autos 
>>> etc... 
>>>
>>
>>  You need to tell Cake that you want something other than the default id 
>> & name when you do a find('list').
>>
>> http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#find-list
>>
>> Presumably, you have a slug column. Don't use the Category.name as the 
>> option values because they may contain URL-unfriendly characters. 
>> Use SluggableBehavior. There seem to be several floating around the 
>> internet. Here's a recent one:
>>
>> https://github.com/pronique/CakePHP-Sluggable-Behavior
>>
>>  
>>
>
>

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

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




users session delete, destroy ??

2012-12-17 Thread Chris

hi guys,... 
I'm building administration feature to manage users,... delete, 
deactivate,... etc,... 
Me, as admin, would like to delete some user and have him/here kicked out 
from logged in page,... 
so next thing he clicks anywhere on a site he will be logged off. 

I can't delete user session,... the function is deleting user, but it 
delete my session and not user. 
Destroying session$this->Session->destroy(); is not an option,... 
since it will destroy ALL users session while some uploading photos or 
creating blogs, groups, videos,... etc,...
How can I do this,... ? Can someone help please,...  

here is my function: 

  function admin_delete($id = null)
  {
if(!$this->authorize_admin())
  return;

if(!($user = $this->User->findById($id)))
{
  $this->flash('error', ucfirst(i18n::translate('user not found')));
  $this->redirect('/admin/users/manage/');
}
else
{
  if($this->User->delete($user['User']['id']))
  {
   // $this->Session->delete('user'); // This deleting my session,... not 
the user session 
   // $this->Cookie->delete('User.username'); 
   // $this->Cookie->delete('User.hashed_password'); 

   // $this->Session->destroy(); // This is destroying ALL users session, 
which I don't want to 

   $this->Session->delete($user['User']['id']); // Here is the part where I 
want to delete user sission
   $this->Cookie->delete($user['User']['username']);
   $this->Cookie->delete($user['User']['hashed_password']);

$this->flash('valid', ucfirst(i18n::translate('account deleted')));
$this->redirect('/admin/users/manage/');
  }

 }

  }
  

Thanks in advance 
chris

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

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




Re: Choosing the Right Abstraction

2012-12-17 Thread lowpass
It's turtles all the way down.

On Sat, Dec 15, 2012 at 11:13 AM, Patrick Leahy  wrote:
> If abstractions are the greatest tool to reduce complexity in a system, then
> the primary task of the competent programmer is to choose the right
> abstraction.
>
> In the same way that one may define an arbitrarily complex fractal with a
> simple set of rules, so too we may generate arbitrarily complex data
> structures with simple abstractions. The mechanism for exploiting
> self-similarity in object-oriented programming is called inheritance.
>
> The fundamental interaction of the web framework is this: a Request provokes
> a Response. In the context of an MVC framework, there is a division of labor
> between the code that handles requests, and the code that handles responses.
> In the context of CakePHP, we have both a Request Object, and a Response
> Object.
>
> In another context, we have an HttpSocket class, which has a
> HttpSocketResponse class, and is conspicuously lacking an HttpSocketRequest
> class.
>
> And in a far more crucial context, we have the fundamental interaction of
> the CakePHP framework with the various database objects. The CakePHP
> community is now realizing its need for a Database Response object. The
> pattern of interacting with a server has not changed! In order to break away
> from a monolithic Model class, we must implement MVC in a microcosm, and to
> exploit the self-similarity in all of these various methods.
>
> We must separate out request handling methods from response handling
> methods, and to separate business logic from presentation logic. Whether or
> not to represent a response as an object or an array must be a function of
> our DataView layer. Our DataModel class seems to already be divided into
> various DataSources. These themselves could as easily be subdivided into the
> same MVC pattern, down to the function level.
>
> Finally, and in humility, while I make a great many absolute and imperative
> statements, I recognize that they are backed by nothing more substantial
> than my own insight and opinion. Feel free to take issue with anything you
> see as a misconception.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

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

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




jquery problema

2012-12-17 Thread Mauricio Dougles Pereira Torrez
al usar jquery encontre un error ..

en lavista  con helper js  query

$this->Js->get('#BookID')->event('change', $this->Js->request( 
array('controller' => 'critiques', 'action' => 'auto_select_author'), 
array( 
'update' => '#AuthorID', 
'async' => true, 
'dataExpression' => true, 
'method' => 'post', 
'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)) 
) ) ); 

esto deberia escribirse 
asi


//

 

per ose traduce asi en mi aplicacion 



//


la lineas rojas me roducen unerror qeu me costo encontrarlo pr qeu se 
traduce asi?
alguien pdria explicar como reparar esta parte  he tenido que usar codigo 
java en ves de usatr el helper para solucionar es parte..
saludos
 

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

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




Vaga programador PHP Pleno cakePHP

2012-12-17 Thread Andre Cardoso
Redsuns Design e Tecnologia Web oferta uma vaga de emprego para programador 
com experiência comprovada em PHP, cakePHP e Wordpress para trabalhar em 
Curitiba - PR

Detalhes da vaga:
https://github.com/redsuns/vaga-php-developer
http://vagas.infojobs.com.br/vagas-de-programador-php-em-parana__3029786.aspx

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

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




Javascript issues in "Events" - CakePHP vers 1.2.9

2012-12-17 Thread mrfugimoto
Hello, I've posted this question on the ask cake site last week with
no reply. Hopefully somebody can help.

Trying to implement a code into a new event on a customer site

What happened - the code broke and the widget code does not embed.

What I expected to happen - the widget to embed and the event
details to show

Here is the widget:

< script src="http://guestflo.com/venue-widget.php?
VenueID=31&limit=30&a_..." type="text/javascript">
< /div>
< style type="text/css">
.widget-wrapper{ width:650px;
color:#fff;
} < /style>

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

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




Translate on BelongsToMany

2012-12-17 Thread Carlos Eduardo Sotelo Pinto
Dear coders

I have an issue on a project That I am working, I have to models linked
on a belongsToMany relationship, and both of them are using the
translate behavior

i18n -> SubCategory [ belongsToMany ] Category <- i18n

Then I need to do a list like

CategryName - SubCategoryName

As you could see I need to concatenate Name field on both models, and
name field on both models are translated, I mean, both of them name
fields are on the i18n table, then when I do a

$this->Subcategory->find ('all');

for process and user the fields needed,  I could see that Categroy,
doesnt have the Name field, just Subcategory has the name field

Any suggest

Best Regards


-- 
Carlos Eduardo Sotelo Pinto
GNU Linux Admin | PHP Senior Web Developer
MObil: RPC (Claro)+51, 958194614
http://www.carlossotelo.com
Skype: csotelop
Yahoo: csotelop
MSN: carlos.sotelo.pi...@gmail.com
GTalk: carlos.sotelo.pi...@gmail.com
GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B
GNULinux RU #379182 || GNULinux RM #277661

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

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




Re: elements, requestAction and caching [solved]

2012-12-17 Thread rkaiser
A somewhat cleaner way to do this is described 
here
.

On Friday, April 2, 2010 2:14:05 PM UTC-7, phpMagpie wrote:
>
> DOH! A little more digging and it seems all I needed was to add the
> following to my controller actions:
>
> @unlink(CACHE.'views'.DS.'element_'.$cacheKey.'_'.$elementName);
>
> Case closed :)
>
>

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

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




Re: cakephp and ajax

2012-12-17 Thread Jonathan Sundquist
Hey David,

You would connect to your model the same way you do within any other
controller.  Your controller code would look something like the following

public function index(){
 // Disable both the view and layout as they both will not be needed.
$this->autoRender = false;
// Make sure someone actually did pass in a discount code
 if($this->request->params['discount_code']){
 // Look up the discount code passed in and then json encode the response
to be used by the ajax handler within the ui.
 echo
json_encode($this->Setting->find(array('conditions'=>array('discount_code'=>$this->request->params['discount_code']);
 }
}

The above code should do about what you want it to.  You will need to write
the remaining code for the UI as I don't know what your fields are named.


On Mon, Dec 17, 2012 at 12:42 AM, David Camerotto wrote:

> Hi, I am relatively new to Cake, I took over a web site that uses it and
> am still learning the ropes, but slowly getting there.
>
> One issue has do have is with the image shown below.
>
> I want to be able to retrieve data from the DB when clicking on the Apply
> link.
>
> I have create a model and controller and have added this code to the click
> event for the link.
>
> $('#go').click(function(){
> $.ajax({
> url:'/discount/index',
> type:'POST',
> data:data
> });
>
> What I'm unsure about is how to retrieve the the data from the DB and how
> to put it into the input box - table is called settings and field is
> discount_code.
>
> Any help would be greatly appreciated
>
>
> 
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

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

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




Re: I am new in Cakephp

2012-12-17 Thread Dr. Tarique Sani
http://book.cakephp.org/2.0/en/index.html <- start here

T


On Mon, Dec 17, 2012 at 1:22 PM, Rakesh Dongarwar <
rakeshdongarw...@gmail.com> wrote:

> Hey Hi Guys
>
> I am very new in cakephp. From last 3 years i have worked on core php. so
> anyone can teach me cakephp??
>
>
>
> Kind Regards,
> Rakesh
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
=
The Conference Schedule Creator : http://shdlr.com

PHP for E-Biz : http://sanisoft.com
=

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

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




cakephp and ajax

2012-12-17 Thread David Camerotto


Hi, I am relatively new to Cake, I took over a web site that uses it and am 
still learning the ropes, but slowly getting there.

One issue has do have is with the image shown below.

I want to be able to retrieve data from the DB when clicking on the Apply 
link.

I have create a model and controller and have added this code to the click 
event for the link.

$('#go').click(function(){
$.ajax({
url:'/discount/index',
type:'POST',
data:data
});

What I'm unsure about is how to retrieve the the data from the DB and how 
to put it into the input box - table is called settings and field is 
discount_code.

Any help would be greatly appreciated




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

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




Re: CakePHP 2.3.0-RC1 and 2.2.4 released

2012-12-17 Thread Rakesh Dongarwar
Hey Hi guys I am also Very new in cakephp. I am working in corephp from 
last 3 years and now i want to move ahead can you please help me regarding 
the video tutorials or any type of tutorials for learn easily

Kind Regards,
Rakesh

On Monday, 3 December 2012 03:56:06 UTC+5:30, José Lorenzo wrote:
>
> The CakePHP core team is proud to announce the immediate availability of 
> CakePHP 2.3.0-RC1 and 2.2.4[1]. 2.3.0-RC1 marks the freezing of 2.3.0 API 
> and it is jsut a matter of a few weeks to mark it as stable if no bugs are 
> found in current codebase.
> Changes since 2.3.0-beta
>
>- Added ConfigReaderInterface::dump() and made all readers' dump() 
>method support 'Plugin.keyname' format for keys
>- Made View trigger notice by default if elements are missing and 
>added elementExists() method
>- Added Helper::$settings to match other objects like components and 
>behaviors
>- You no longer have to specify 'maxLimit' when setting 'limit' 
>greater than default 'maxLimit' when configuring pagination settings.
>- Added type hinting to Model::validator()
>- prev() and next() methods of PaginatorHelper now possible to place 
>the 'tag' option to 'false' to disable the wrapping element.
>- Calling Form->input() with 'errorMessage'=>false should trigger 
>field error, but not render error message (HTML element).
>- New options in HtmlHelper::getCrumbList() to make it compatible with 
>Twitter Bootstrap, Zurb foundation or other CSS frameworks.
>- Added CakeTestCase::getMockForModel convenience method.
>- Implemented SSL peer verification in HttpSocket.
>- Added context() to CakeSocket.
>- Renamed HttpResponse to HttpSocketResponse. HttpResponse will 
>continue to exist for backwards compatibility.
>- Using bytecode sequence for unicode ellipsis in String::trim().
>- When using XmlView, you can configure the top level element name by 
>setting the _rootNode view variable.
>- Added warning to home.ctp when DebugKit is not installed and added a 
>list of official plugins to home.ctp
>- Added View::startIfEmpty()
>- Added foreignKey to whitelist in saveAssociated()
>- RedisEngine: authenticate connection if 'password' is set 2.2.4 is a 
>bugfix/maintenance release for the 2.2.x release branch. These are some of 
>the changes included:
>- Update TLD validation to accept gTLD variations
>- Fixed sorting empty data with Hash & Set.
>- Fixed multi-model validators with deep & atomic validation error 
>nesting
>- Fixed exceptions being thrown in beforeFilter breaking error pages.
>- Using HttpSocket to get proper exceptions when trying to load XML 
>from remote servers to fix warnings from file_get_contents() in 
> Xml::build()
>- Send charset=UTF-8 if Content-Type is JSON.
>- Added query logging to DboSource::insertMulti().
>- Fixed contain rule parsig in authentication adapters
>- Fixed required validation rule
>- Removed Inflector::slug() replacement from Ä to A
>- Fixed issue with Model::saveAssociated() and TranslateBehavior
>- Only setting $request->data with PUT/DELETE when it can be decoded.
>- Improved "required" field detection.
>- Made Model::find('first') always return an array.
>- Fixed issue where the incorrect meridian would be selected in 
>FormHelper::dateTime()
>- Fixed issue where createSchema() would omit primary keys sometimes.
>- Fixed saveAssociated() with validate=first, atomic=false
>- Showing the last 200 queries instead of the first 200 in SQL log.
>- Fixed 0'th index file not being copied to $_FILES.
>- Fixed autoLinkUrls so it re-capture query strings.
>- Allow saving new records with pre specified primary key value with 
>treebehavior.
>- Fix find('count') with 'group' when result has only one group.
>
> A huge thanks to all involved in terms of both contributions through 
> commits, tickets, documentation edits, and those whom have otherwise 
> contributed to the framework. Without you there would be no CakePHP. 
> Download a packaged release [3]
> Links
>
>- [1] http://cakephp.org/changelogs/2.3.0-RC1
>- [1] http://cakephp.org/changelogs/2.2.4
>- [2] http://github.com/cakephp/cakephp/tags
>
>

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

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




I am new in Cakephp

2012-12-17 Thread Rakesh Dongarwar
Hey Hi Guys

I am very new in cakephp. From last 3 years i have worked on core php. so 
anyone can teach me cakephp??



Kind Regards,
Rakesh

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

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