Re: Looking for an experienced CakePHP developer

2016-03-23 Thread Fabian Olmos
Hi,

I can help  you
El 23/3/2016 16:28, "majna"  escribió:

> Hi,
>
> I'm looking for an experienced CakePHP 2.x developer, freelance, remote,
> long-term.
> Please LMK if you know somebody.
>
> Thanks!
> majna
>
> --
> Sign up for our Newsletter for updates.
> http://cakephp.org/newsletter/signup
>
> We will soon be closing this Google Group. But don't worry, we have
> something better coming. Stay tuned for an updated from the CakePHP Team
> soon.
>
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Follow us on Twitter http://twitter.com/CakePHP
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Find and HABTM

2013-10-15 Thread Fabian Olmos
Hi, now I'm trying to retrieve data using find function like this

$this->Evento->Behaviors->load('Containable');
$this->Evento->recursive = -1;
debug($this->Evento->find('all', array('conditions' => 
array('Evento.id'=>$this->Convert->decode($evento_id)),
'contain' =>array(
'Caracteristica'=>array('fields'=>array(

 'activar_foto',
 'activar_grupo',
 'activar_menor',
 'activar_limite',
 'activar_personal'
)
),
'Disciplina'=>array(
'DisciplinasEvento'=>array(
'Modalidad'
)
) ),
   )
)
 );
this are my linked models


class Evento extends AppModel {

 public $hasOne = array(
'Caracteristica' => array(
'className'  => 'Caracteristica',
'foreignKey' => 'evento_id'
)
);
   public $hasAndBelongsToMany = array(
'Disciplina' =>
array(
'className' => 'Disciplina',
'joinTable' => 'disciplinas_eventos',
'foreignKey'=> 'evento_id',
'associationForeignKey' => 'disciplina_id',
'unique' => 'keepExisting',
'with' => 'DisciplinasEvento'
)
); 
}

class DisciplinasEvento extends AppModel {

public $belongsTo = array(
'Evento' => array(
'className' => 'Evento',
'foreignKey' => 'evento_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Disciplina' => array(
'className' => 'Disciplina',
'foreignKey' => 'disciplina_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Modalidad' => array(
'className' => 'Modalidad',
'foreignKey' => 'modalidad_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
);
}

class Modalidad extends AppModel {

 public $hasMany = array(
'DisciplinasEvento' => array(
'className' => 'DisciplinasEvento',
'foreignKey' => 'modalidad_id'
)
);
}

Question: Why the find function is not retrieving Modalidad data? many 
thanks

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Pagination with hasMany association

2009-10-21 Thread Fabian

I have two table:

Contestant and Votes
Contestant hasMany Votes

I've tried doing a count(Vote.id) as Votes so I can place it on the
recordset and just paginate them but I have no idea where to place it.
I did it on the fields array but it give me the total count of votes
regardless of the contestant they belong to.

The votes are linked together in the Contestant recordset so what I
did was on my view I did a count($contestant[Vote]) but this can't be
paginated and my client wants to be able to sort the contestants by
votes.

Is there a way I can do something like this on my view?:

 sort('Votes', 'count(Vote)'); ?>

Or do I have to create a query which does a count for all the votes
where Contestant.id = Votes.contestant_id ?

Controller Contestant:

function index() {
$page = 'Contestants';
$this->set('page', $page);
$this->paginate =
array(
'order' => 'id ASC',
'contain' => array(
'Vote' => array(
'fields' => 
array("Vote.contestant_id",'Vote.id')
)
)
$conditions ["Contestant.active"] = 1;
$this->set('contestants', $this->paginate('Contestant',
$conditions));
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Posts and Votes total, hasOne + COUNT relation?

2009-10-20 Thread Fabian

Yeah I'm trying to do the same thing. If you find a solution please
post it thanks.

On Oct 7, 1:40 pm, fael  wrote:
> Hello
> I'm coding this reddit-like clone and so far, so good, just I want to
> show how many ups and how many downs are by post in the index.
> Something like this:
> Up (20) | Down (3) This is the first title
> Up (10) | Down (10) Second title here
> Up (5) | Down (6) Third title!
>
> A findAll will get me the Post data and then I'll just have to make a
> hasOne relationshi with aCOUNT, right? It would be something like
> this:
> $this->bindModel(array(
>         "hasMany" => array(
>                 "VoteNeg" => array(
>                         "className" => "Votes",
>                         "fields" => array("COUNT(VoteNeg.id)"),
>                         "conditions" => array("VotoNeg.value" => 0)
>                 ),
>                 "VotePos" => array(
>                         "className" => "Votes",
>                         "fields" => array("COUNT(VotePos.id)"),
>                         "conditions" => array("VotePos.value" => 1)
>                 )
>         )
> ));
>
> The thing is, this COUNTs the totalvotesfor all the three records.
> SELECTCOUNT(`VotoNeg`.`id`), `VotoNeg`.`propuesta_id` FROM `votos` AS
> `VotoNeg` WHERE `VotoNeg`.`valor` = 0 AND `VotoNeg`.`propuesta_id` IN
> (2, 3, 1)
>
> I'm using hasMany as hasOne oddly just returns one record, and
> includes every vote, regardless of which post it belongs to.
>
> I think I have to use DISTINCT, but I've tried and still won't work
> the way it should.
> Am I missing something?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



SUBQUERY Question

2009-04-28 Thread Fabian

Hey,
I'm so happy I've found this group. Maybe someone can help me with my
problems here (I'm a beginner in Cakephp). Sorry for my bad english by
the way.

Ok I've got two Models in HABTM relation: verses and users. in my
controller action i want to get some specific verses (for example: the
first ten verses) and something like a left join to the users table,
so i can see whether the logged in user is assigned to any of them.
BUT i don't want to show any other users and I don't want to have only
the verses the user is assigned to.

This would mean, Someone reads some verses and beside some of them is
a little note "you are assigned to these verses"(maybe there is an
even easier solution for this?)

In MySQL this Query works perfectly:
SELECT * FROM verses LEFT JOIN (SELECT * FROM users_verses WHERE
user_id = 1) AS user ON verses.id = user.verse_id LIMIT 10

the subquery only searches users_verses for user 1 and in left joining
the verses table some of the ten verses will have the user assigned to
it and some are simply nulled.

how can I get the same effect with cakephp?


THANK YOU so much for you help
Fabian

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



Re: CakePHP and Forum software

2009-04-02 Thread Fabian

I haven't tried it myself.

http://bakery.cakephp.org/articles/view/phpbb3-api-bridge

On Mar 27, 3:24 pm, Miles J  wrote:
> Forums are extremely easy to make, its only the following tables:
>
> forums, forum categories, threads and posts
>
> I mean, CakePHP already has security and auth and everything else.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



User logouts after actions

2009-01-09 Thread Fabian

Hi I have been using the Auth component to create a user login. At
first it worked great but recently (as in today) when the user logins
in all is well but when he tries to navigate between the pagination
links or tries to use the search option I created, the page redirects
him to the login page again. Sometimes it would allow the user to
navigate between the pagination links without redirecting him to the
login page so it's not always 100% sure that it would login out. It
seems kinda random since it used to work before today.

Any ideas on what it may be?

thanks in adavance.

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



Re: auth->allow index

2008-05-09 Thread Fabian

CREATE TABLE users (
id integer auto_increment,
username char(50),
password char(50),
PRIMARY KEY (id)
);

this is my users table. basically if there's a user he can do
everything and if he doesn't have a user he'll have  a limited view.

class UsersController extends AppController {

var $name = 'Users';

function login() {
}

function logout() {
$this->redirect($this->Auth->logout());
}
}


what I ended up doing was just placing a beforefilter function on each
controller and that seemed to work =)

function beforeFilter(){
$this->Auth->allow('index');
}

But thanks for all the help



On May 9, 5:44 pm, Fabian <[EMAIL PROTECTED]> wrote:
> ok I think I found out what the problem was. I was calling a component
> on  the controller I was testing so it was overwriting the auth
> component call from the app_controller.
>
> Thanks sam for your help !
>
> On May 9, 5:30 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > Ok i've simplified this to :
>
> > function beforeFilter(){
>
> > $this->Auth->allow('*');
> > $this->Auth->deny('delete','add','edit');
> >     }
>
> > and the urls with controller/delete , controller/add, , controller/
> > edit can be seen now =(
> > It seems the only thing that works is ' * '
>
> > On May 9, 5:14 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > > class AppController extends Controller {
>
> > > var $components = array('Auth');
>
> > > function beforeFilter()
> > > {
> > > $this->Auth->allow('*');
> > > $this->Auth->deny('delete','add','edit');
>
> > >// check if we're using the pages controller
> > > if ($this->name == 'Admins'){
> > >  get args
> > >  $this->Auth->deny('delete','add','edit','index');
> > > }
> > > }
>
> > > basically all I've done is copy what was on the manual.
>
> > > About admins routing I also want to deny access to a different
> > > controller as well. So they can't see admins and properties indexes
> > > for both
>
> > > I thought there was a simple way to do this but I guess not  =(
> > > On May 9, 5:02 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>
> > > > so that is the beoreFilter of the Admins controller
>
> > > > and you have Auth set in your app_controller - post your auth set up too
>
> > > > does putting parent::beforeFilter in the Admins controller help
>
> > > > also you could use admin routing here which IMHO would simplify things a
> > > > little
>
> > > > hth - S
>
> > > > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > > > yes I've read it and thx for the if statement error but still the
> > > > > index page is shown.
>
> > > > > I've even tried doing it without the if statement
>
> > > > > function beforeFilter()
> > > > >  {
>
> > > > >   $this->Auth->allow('*');
> > > > >$this->Auth->deny('delete','add','edit','index');
>
> > > > > }
>
> > > > > and still all the indexes are showing up
>
> > > > > On May 9, 4:44 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > > > > in your if state your assigning the value the one below compares the
> > > > > values
>
> > > > > > if ($this->name == 'Admins'){}
>
> > > > > > have you  read the auth section of book.cakephp.org?
>
> > > > > > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > > > > > Hi all.
>
> > > > > > > I'm having problem using the deny and allow methods for the index
> > > > > > > function.
>
> > > > > > > In my app controller I have
>
> > > > > > > function beforeFilter()
> > > > > > >  {
>
> > > > > > >   $this->Auth->allow('*');
> > > > > > >   $this->Auth->deny('delete','add','edit');
>
> > > > > > >  if ($this->name = 'Admins'){
> > > > > > > $this->Auth->deny('delete','add','edit','index');
> > > > > > >}
>
> > > > > > > }
>
> > > > > > > so if I try to use any url like admins/add if forces me to login 
> > > > > > > , but
> > > > > > > it doesn't seem to work for the admins/index
>
> > > > > > > What is the correct string I have to place in the deny array so it
> > > > > > > actually denies the index. I've tried using display, read and 
> > > > > > > view.
> > > > > > > But none of them work.
>
> > > > > > > Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: auth->allow index

2008-05-09 Thread Fabian

ok I think I found out what the problem was. I was calling a component
on  the controller I was testing so it was overwriting the auth
component call from the app_controller.

Thanks sam for your help !

On May 9, 5:30 pm, Fabian <[EMAIL PROTECTED]> wrote:
> Ok i've simplified this to :
>
> function beforeFilter(){
>
> $this->Auth->allow('*');
> $this->Auth->deny('delete','add','edit');
> }
>
> and the urls with controller/delete , controller/add, , controller/
> edit can be seen now =(
> It seems the only thing that works is ' * '
>
> On May 9, 5:14 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > class AppController extends Controller {
>
> > var $components = array('Auth');
>
> > function beforeFilter()
> > {
> > $this->Auth->allow('*');
> > $this->Auth->deny('delete','add','edit');
>
> >// check if we're using the pages controller
> > if ($this->name == 'Admins'){
> >  get args
> >  $this->Auth->deny('delete','add','edit','index');
> > }
> > }
>
> > basically all I've done is copy what was on the manual.
>
> > About admins routing I also want to deny access to a different
> > controller as well. So they can't see admins and properties indexes
> > for both
>
> > I thought there was a simple way to do this but I guess not  =(
> > On May 9, 5:02 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>
> > > so that is the beoreFilter of the Admins controller
>
> > > and you have Auth set in your app_controller - post your auth set up too
>
> > > does putting parent::beforeFilter in the Admins controller help
>
> > > also you could use admin routing here which IMHO would simplify things a
> > > little
>
> > > hth - S
>
> > > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > > yes I've read it and thx for the if statement error but still the
> > > > index page is shown.
>
> > > > I've even tried doing it without the if statement
>
> > > > function beforeFilter()
> > > >  {
>
> > > >   $this->Auth->allow('*');
> > > >$this->Auth->deny('delete','add','edit','index');
>
> > > > }
>
> > > > and still all the indexes are showing up
>
> > > > On May 9, 4:44 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > > > in your if state your assigning the value the one below compares the
> > > > values
>
> > > > > if ($this->name == 'Admins'){}
>
> > > > > have you  read the auth section of book.cakephp.org?
>
> > > > > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > > > > Hi all.
>
> > > > > > I'm having problem using the deny and allow methods for the index
> > > > > > function.
>
> > > > > > In my app controller I have
>
> > > > > > function beforeFilter()
> > > > > >  {
>
> > > > > >   $this->Auth->allow('*');
> > > > > >   $this->Auth->deny('delete','add','edit');
>
> > > > > >  if ($this->name = 'Admins'){
> > > > > > $this->Auth->deny('delete','add','edit','index');
> > > > > >}
>
> > > > > > }
>
> > > > > > so if I try to use any url like admins/add if forces me to login , 
> > > > > > but
> > > > > > it doesn't seem to work for the admins/index
>
> > > > > > What is the correct string I have to place in the deny array so it
> > > > > > actually denies the index. I've tried using display, read and view.
> > > > > > But none of them work.
>
> > > > > > Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: auth->allow index

2008-05-09 Thread Fabian

Ok i've simplified this to :

function beforeFilter(){

$this->Auth->allow('*');
$this->Auth->deny('delete','add','edit');
}


and the urls with controller/delete , controller/add, , controller/
edit can be seen now =(
It seems the only thing that works is ' * '




On May 9, 5:14 pm, Fabian <[EMAIL PROTECTED]> wrote:
> class AppController extends Controller {
>
> var $components = array('Auth');
>
> function beforeFilter()
> {
> $this->Auth->allow('*');
> $this->Auth->deny('delete','add','edit');
>
>// check if we're using the pages controller
> if ($this->name == 'Admins'){
>  get args
>  $this->Auth->deny('delete','add','edit','index');
> }
> }
>
> basically all I've done is copy what was on the manual.
>
> About admins routing I also want to deny access to a different
> controller as well. So they can't see admins and properties indexes
> for both
>
> I thought there was a simple way to do this but I guess not  =(
> On May 9, 5:02 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>
> > so that is the beoreFilter of the Admins controller
>
> > and you have Auth set in your app_controller - post your auth set up too
>
> > does putting parent::beforeFilter in the Admins controller help
>
> > also you could use admin routing here which IMHO would simplify things a
> > little
>
> > hth - S
>
> > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > yes I've read it and thx for the if statement error but still the
> > > index page is shown.
>
> > > I've even tried doing it without the if statement
>
> > > function beforeFilter()
> > >  {
>
> > >   $this->Auth->allow('*');
> > >$this->Auth->deny('delete','add','edit','index');
>
> > > }
>
> > > and still all the indexes are showing up
>
> > > On May 9, 4:44 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > > in your if state your assigning the value the one below compares the
> > > values
>
> > > > if ($this->name == 'Admins'){}
>
> > > > have you  read the auth section of book.cakephp.org?
>
> > > > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > > > Hi all.
>
> > > > > I'm having problem using the deny and allow methods for the index
> > > > > function.
>
> > > > > In my app controller I have
>
> > > > > function beforeFilter()
> > > > >  {
>
> > > > >   $this->Auth->allow('*');
> > > > >   $this->Auth->deny('delete','add','edit');
>
> > > > >  if ($this->name = 'Admins'){
> > > > > $this->Auth->deny('delete','add','edit','index');
> > > > >}
>
> > > > > }
>
> > > > > so if I try to use any url like admins/add if forces me to login , but
> > > > > it doesn't seem to work for the admins/index
>
> > > > > What is the correct string I have to place in the deny array so it
> > > > > actually denies the index. I've tried using display, read and view.
> > > > > But none of them work.
>
> > > > > Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: auth->allow index

2008-05-09 Thread Fabian

class AppController extends Controller {

var $components = array('Auth');

function beforeFilter()
{
$this->Auth->allow('*');
$this->Auth->deny('delete','add','edit');

   // check if we're using the pages controller
if ($this->name == 'Admins'){
 get args
 $this->Auth->deny('delete','add','edit','index');
}
}


basically all I've done is copy what was on the manual.

About admins routing I also want to deny access to a different
controller as well. So they can't see admins and properties indexes
for both

I thought there was a simple way to do this but I guess not  =(
On May 9, 5:02 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> so that is the beoreFilter of the Admins controller
>
> and you have Auth set in your app_controller - post your auth set up too
>
> does putting parent::beforeFilter in the Admins controller help
>
> also you could use admin routing here which IMHO would simplify things a
> little
>
> hth - S
>
> 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
>
>
> > yes I've read it and thx for the if statement error but still the
> > index page is shown.
>
> > I've even tried doing it without the if statement
>
> > function beforeFilter()
> >  {
>
> >   $this->Auth->allow('*');
> >$this->Auth->deny('delete','add','edit','index');
>
> > }
>
> > and still all the indexes are showing up
>
> > On May 9, 4:44 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > in your if state your assigning the value the one below compares the
> > values
>
> > > if ($this->name == 'Admins'){}
>
> > > have you  read the auth section of book.cakephp.org?
>
> > > 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
> > > > Hi all.
>
> > > > I'm having problem using the deny and allow methods for the index
> > > > function.
>
> > > > In my app controller I have
>
> > > > function beforeFilter()
> > > >  {
>
> > > >   $this->Auth->allow('*');
> > > >   $this->Auth->deny('delete','add','edit');
>
> > > >  if ($this->name = 'Admins'){
> > > > $this->Auth->deny('delete','add','edit','index');
> > > >}
>
> > > > }
>
> > > > so if I try to use any url like admins/add if forces me to login , but
> > > > it doesn't seem to work for the admins/index
>
> > > > What is the correct string I have to place in the deny array so it
> > > > actually denies the index. I've tried using display, read and view.
> > > > But none of them work.
>
> > > > Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: auth->allow index

2008-05-09 Thread Fabian

yes I've read it and thx for the if statement error but still the
index page is shown.

I've even tried doing it without the if statement

function beforeFilter()
  {

   $this->Auth->allow('*');
   $this->Auth->deny('delete','add','edit','index');

}

and still all the indexes are showing up


On May 9, 4:44 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> in your if state your assigning the value the one below compares the values
>
> if ($this->name == 'Admins'){}
>
> have you  read the auth section of book.cakephp.org?
>
> 2008/5/9 Fabian <[EMAIL PROTECTED]>:
>
>
>
> > Hi all.
>
> > I'm having problem using the deny and allow methods for the index
> > function.
>
> > In my app controller I have
>
> > function beforeFilter()
> >  {
>
> >   $this->Auth->allow('*');
> >   $this->Auth->deny('delete','add','edit');
>
> >  if ($this->name = 'Admins'){
> > $this->Auth->deny('delete','add','edit','index');
> >}
>
> > }
>
> > so if I try to use any url like admins/add if forces me to login , but
> > it doesn't seem to work for the admins/index
>
> > What is the correct string I have to place in the deny array so it
> > actually denies the index. I've tried using display, read and view.
> > But none of them work.
>
> > Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



auth->allow index

2008-05-09 Thread Fabian

Hi all.

I'm having problem using the deny and allow methods for the index
function.

In my app controller I have

function beforeFilter()
  {

   $this->Auth->allow('*');
   $this->Auth->deny('delete','add','edit');

  if ($this->name = 'Admins'){
 $this->Auth->deny('delete','add','edit','index');
}

}

so if I try to use any url like admins/add if forces me to login , but
it doesn't seem to work for the admins/index

What is the correct string I have to place in the deny array so it
actually denies the index. I've tried using display, read and view.
But none of them work.

Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: database configuration on domain

2008-04-10 Thread Fabian

thanks that's what I ended up doing using the ip =)

On Apr 10, 9:47 am, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Try putting localhost, or 127.0.0.1. If your database is hosted in
> other host than the one running the webserver, put the ip there.
>
> On Wed, Apr 9, 2008 at 9:49 PM, Fabian <[EMAIL PROTECTED]> wrote:
>
> >  I'm getting this warnings:
>
> >  Warning: mysql_connect(): Can't connect to MySQL server on 'montana-
> >  realty-co.com' (111) in /home/content/b/e/n/benjimecutchen/html/cake/
> >  libs/model/dbo/dbo_mysql.php on line 100
>
> >  Warning: mysql_select_db(): supplied argument is not a valid MySQL-
> >  Link resource in /home/content/b/e/n/benjimecutchen/html/cake/libs/
> >  model/dbo/dbo_mysql.php on line 105
>
> >  My config dabatase is the following:
>
> >  var $default = array('driver' => 'mysql',
> > 'connect' 
> > => 'mysql_connect',
> > 'host' => 
> > 'montana-realty-co.com',
> > 'login' => 
> > 'montanarealty',
> > 'password' 
> > => '',
> > 'database' 
> > => 'montanarealty',
> > 'prefix' => 
> > '');
>
> >  I don't know if the host is ok or what should I place there?
>
> >  the domain is :http://www.montana-realty-co.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



database configuration on domain

2008-04-09 Thread Fabian

I'm getting this warnings:

Warning: mysql_connect(): Can't connect to MySQL server on 'montana-
realty-co.com' (111) in /home/content/b/e/n/benjimecutchen/html/cake/
libs/model/dbo/dbo_mysql.php on line 100

Warning: mysql_select_db(): supplied argument is not a valid MySQL-
Link resource in /home/content/b/e/n/benjimecutchen/html/cake/libs/
model/dbo/dbo_mysql.php on line 105


My config dabatase is the following:

var $default = array('driver' => 'mysql',
'connect' => 
'mysql_connect',
'host' => 
'montana-realty-co.com',
'login' => 
'montanarealty',
'password' => 
'',
'database' => 
'montanarealty',
'prefix' => '');


I don't know if the host is ok or what should I place there?

the domain is : http://www.montana-realty-co.com/





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Query Insert Into

2008-01-16 Thread Fabian

and if anyones wants to know my other problem was that I assigned this
data like this:

$this->data['note']['user_id'] = $user_id;

and should be:

$this->data['Note']['user_id'] = $user_id;

On Jan 16, 11:51 pm, Fabian <[EMAIL PROTECTED]> wrote:
> Hi I ended up doing this:
>
> Remove the autoincrement from the table
>
> $ret = $this->Note->query("ALTER TABLE notes MODIFY COLUMN notes_id
> BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
>
> Then insert the data
> $ret = $this->Note->query("INSERT INTO Notes
> (notes_id,user_id,date_added,date_modified,details) VALUES ( $notes_id,
> $user_id,'$date_added','$date_modified','$details')");
>
> Change the table back to how it originally was.
> $ret = $this->Note->query("ALTER TABLE `hawk_database`.`notes`
> MODIFY COLUMN `notes_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
> AUTO_INCREMENT = 66");
>
> And I ended up doing this on the controller instead of using the
> model, since in the model it didn't work.
>
> On Jan 16, 11:20 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > my query is :
>
> > $ret = $this->query("INSERT INTO Notes
> > (user_id,date_added,date_modified,details) VALUES (1,'2008-01-01
> > 17:22','2008-01-01','Test')");
> > Had a typo before.
>
> > On Jan 16, 11:06 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > > Hi all,
>
> > > I'm trying to create a custom query but I keep getting errors. I tried
> > > this query on mysql command prompt and it works perfectly however in
> > > here it doesn't seem to work.
>
> > > Create table 'notes' (
> > > notes_id int(20) NOT NULL auto_increment,
> > > 'user_id' int(11) NOT NULL,
> > > 'date_added' TIMESTAMP NOT NULL,
> > > 'date_modified' DATE NOT NULL,
> > > 'details'  TEXT NOT NULL,
> > > PRIMARY KEY ('notes_id')
> > > )
>
> > > class Note extends AppModel{
> > > var $name = 'Note';
> > > var $primaryKey = 'notes_id';
>
> > > }
>
> > > function saveNote() {
>
> > > $ret = $this->query("INSERT INTO Notes
> > > (user_id,date_added,date_modified,details)  VALUES (1,'2008-01-01
> > > 17:22','2008-01-01','Test');");
>
> > > }
>
> > > I'm using a custom query since when I try to use the 
> > > this->Note->Save($this->data); I get and error this is what I tried to do 
> > > in the
>
> > > controller:
>
> > > function save ($user_id = null, $date_added = null, $date_modified=
> > > null, $details = null) {
> > > $this->data['note']['user_id'] = $user_id;
> > > $this->data['note']['date_added'] = date("Y-m-d H:i",
> > > strtotime($date_added));
> > > $this->data['note']['date_modified'] = date("Y-m-d H:i",
> > > strtotime($date_modified));
> > > $this->data['note']['details'] = $details;
>
> > >  if($this->Note->save($this->data)) {
> > >   echo 'save successful';
> > >  }
> > >  else {
> > >   echo 'no good';
>
> > > }
>
> > > }
>
> > > This is the error I get :
>
> > > SELECT COUNT(notes_id) AS count FROM `notes` WHERE `notes_id` = 1
>
> > > I don't know why it tries to do a select where notes_id = 1 since in
> > > the parameters I don't even ask for the notes_id since it's a
> > > autoincrement. This is why I tried the custom query but had no luck
> > > with that either.
>
> > > Can anyone shed some light on any of the 2 solutions I'm trying to
> > > develop thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Query Insert Into

2008-01-16 Thread Fabian

Hi I ended up doing this:

Remove the autoincrement from the table

$ret = $this->Note->query("ALTER TABLE notes MODIFY COLUMN notes_id
BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");

Then insert the data
$ret = $this->Note->query("INSERT INTO Notes
(notes_id,user_id,date_added,date_modified,details) VALUES ( $notes_id,
$user_id,'$date_added','$date_modified','$details')");

Change the table back to how it originally was.
$ret = $this->Note->query("ALTER TABLE `hawk_database`.`notes`
MODIFY COLUMN `notes_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 66");

And I ended up doing this on the controller instead of using the
model, since in the model it didn't work.

On Jan 16, 11:20 pm, Fabian <[EMAIL PROTECTED]> wrote:
> my query is :
>
> $ret = $this->query("INSERT INTO Notes
> (user_id,date_added,date_modified,details) VALUES (1,'2008-01-01
> 17:22','2008-01-01','Test')");
> Had a typo before.
>
> On Jan 16, 11:06 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I'm trying to create a custom query but I keep getting errors. I tried
> > this query on mysql command prompt and it works perfectly however in
> > here it doesn't seem to work.
>
> > Create table 'notes' (
> > notes_id int(20) NOT NULL auto_increment,
> > 'user_id' int(11) NOT NULL,
> > 'date_added' TIMESTAMP NOT NULL,
> > 'date_modified' DATE NOT NULL,
> > 'details'  TEXT NOT NULL,
> > PRIMARY KEY ('notes_id')
> > )
>
> > class Note extends AppModel{
> > var $name = 'Note';
> > var $primaryKey = 'notes_id';
>
> > }
>
> > function saveNote() {
>
> > $ret = $this->query("INSERT INTO Notes
> > (user_id,date_added,date_modified,details)  VALUES (1,'2008-01-01
> > 17:22','2008-01-01','Test');");
>
> > }
>
> > I'm using a custom query since when I try to use the 
> > this->Note->Save($this->data); I get and error this is what I tried to do 
> > in the
>
> > controller:
>
> > function save ($user_id = null, $date_added = null, $date_modified=
> > null, $details = null) {
> > $this->data['note']['user_id'] = $user_id;
> > $this->data['note']['date_added'] = date("Y-m-d H:i",
> > strtotime($date_added));
> > $this->data['note']['date_modified'] = date("Y-m-d H:i",
> > strtotime($date_modified));
> > $this->data['note']['details'] = $details;
>
> >  if($this->Note->save($this->data)) {
> >   echo 'save successful';
> >  }
> >  else {
> >   echo 'no good';
>
> > }
>
> > }
>
> > This is the error I get :
>
> > SELECT COUNT(notes_id) AS count FROM `notes` WHERE `notes_id` = 1
>
> > I don't know why it tries to do a select where notes_id = 1 since in
> > the parameters I don't even ask for the notes_id since it's a
> > autoincrement. This is why I tried the custom query but had no luck
> > with that either.
>
> > Can anyone shed some light on any of the 2 solutions I'm trying to
> > develop thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Query Insert Into

2008-01-16 Thread Fabian

my query is :

$ret = $this->query("INSERT INTO Notes
(user_id,date_added,date_modified,details) VALUES (1,'2008-01-01
17:22','2008-01-01','Test')");
Had a typo before.

On Jan 16, 11:06 pm, Fabian <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm trying to create a custom query but I keep getting errors. I tried
> this query on mysql command prompt and it works perfectly however in
> here it doesn't seem to work.
>
> Create table 'notes' (
> notes_id int(20) NOT NULL auto_increment,
> 'user_id' int(11) NOT NULL,
> 'date_added' TIMESTAMP NOT NULL,
> 'date_modified' DATE NOT NULL,
> 'details'  TEXT NOT NULL,
> PRIMARY KEY ('notes_id')
> )
>
> class Note extends AppModel{
> var $name = 'Note';
> var $primaryKey = 'notes_id';
>
> }
>
> function saveNote() {
>
> $ret = $this->query("INSERT INTO Notes
> (user_id,date_added,date_modified,details)  VALUES (1,'2008-01-01
> 17:22','2008-01-01','Test');");
>
> }
>
> I'm using a custom query since when I try to use the 
> this->Note->Save($this->data); I get and error this is what I tried to do in 
> the
>
> controller:
>
> function save ($user_id = null, $date_added = null, $date_modified=
> null, $details = null) {
> $this->data['note']['user_id'] = $user_id;
> $this->data['note']['date_added'] = date("Y-m-d H:i",
> strtotime($date_added));
> $this->data['note']['date_modified'] = date("Y-m-d H:i",
> strtotime($date_modified));
> $this->data['note']['details'] = $details;
>
>  if($this->Note->save($this->data)) {
>   echo 'save successful';
>  }
>  else {
>   echo 'no good';
>
> }
>
> }
>
> This is the error I get :
>
> SELECT COUNT(notes_id) AS count FROM `notes` WHERE `notes_id` = 1
>
> I don't know why it tries to do a select where notes_id = 1 since in
> the parameters I don't even ask for the notes_id since it's a
> autoincrement. This is why I tried the custom query but had no luck
> with that either.
>
> Can anyone shed some light on any of the 2 solutions I'm trying to
> develop thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Custom Query Insert Into

2008-01-16 Thread Fabian

Hi all,

I'm trying to create a custom query but I keep getting errors. I tried
this query on mysql command prompt and it works perfectly however in
here it doesn't seem to work.


Create table 'notes' (
notes_id int(20) NOT NULL auto_increment,
'user_id' int(11) NOT NULL,
'date_added' TIMESTAMP NOT NULL,
'date_modified' DATE NOT NULL,
'details'  TEXT NOT NULL,
PRIMARY KEY ('notes_id')
)

class Note extends AppModel{
var $name = 'Note';
var $primaryKey = 'notes_id';
}

function saveNote() {

$ret = $this->query("INSERT INTO Notes
(user_id,date_added,date_modified,details)  VALUES (1,'2008-01-01
17:22','2008-01-01','Test');");

}

I'm using a custom query since when I try to use the this->Note-
>Save($this->data); I get and error this is what I tried to do in the
controller:

function save ($user_id = null, $date_added = null, $date_modified=
null, $details = null) {
$this->data['note']['user_id'] = $user_id;
$this->data['note']['date_added'] = date("Y-m-d H:i",
strtotime($date_added));
$this->data['note']['date_modified'] = date("Y-m-d H:i",
strtotime($date_modified));
$this->data['note']['details'] = $details;

 if($this->Note->save($this->data)) {
  echo 'save successful';
 }
 else {
  echo 'no good';

}

}

This is the error I get :

SELECT COUNT(notes_id) AS count FROM `notes` WHERE `notes_id` = 1

I don't know why it tries to do a select where notes_id = 1 since in
the parameters I don't even ask for the notes_id since it's a
autoincrement. This is why I tried the custom query but had no luck
with that either.

Can anyone shed some light on any of the 2 solutions I'm trying to
develop thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model Cake Conventions Table Id

2007-12-20 Thread Fabian

Thanks Grant , never thought it would be that easy, yeah the table
names are plural but that's also good to know and might help someone
else =)

On Dec 19, 11:07 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> In your Event model, have
> var $primaryKey = 'event_id';
>
> Now you weren't clear about the table name, is it singular or plural?
> If it is singular (e.g. not matching the convention), then also add
> var $useTable = 'event';
>
> On Dec 20, 12:01 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > Hi I'm trying to insert data to a table that doesn't exactly follows
> > cakes conventions. The table name is Events
> > and instead of having and id , it has the name event_id. Is there a
> > way to change this on cake so it looks for the singular table name and
> > then append id to it?
>
> > The weird thing is that I get and error but at the end it inserts the
> > records correctly.
>
> > This is the error:
>
> > Query: SELECT COUNT(id) AS count FROM `events` WHERE `id` =
> > '2007-12-3'
> > Warning: SQL Error: 1054: Unknown column 'id' in 'field list' in C:
> > \Program Files\xampp\htdocs\hawk\cake\libs\model\datasources
> > \dbo_source.php on line 440
>
> > So i was wondering if I could change a variable or something so it
> > looks for a different id name.
>
> > Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Date Ranges & Conditions

2007-12-20 Thread Fabian

thanks baz that worked great =)

On Dec 19, 7:52 pm, Fabian <[EMAIL PROTECTED]> wrote:
> $conditions = array("`date_added` > " . "'" . $startDate . "'",
> "`date_added` < " . "'" . $endDate . "'");
>
> On Dec 17, 3:30 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > Make sure debug is on and check the Query that is being written.
>
> > I, personally, have never used the "BETWEEN" for MySQL. I usually have
> > something like:
>
> > $from = 
> > $to = 
>
> > $condition = array('date' => "date > $from and date < $to");
>
> > But that's just me.
>
> > On Dec 17, 2007 3:18 PM, Fabian <[EMAIL PROTECTED]> wrote:
>
> > > Hi is it posible to define the $conditions inside a function instead
> > > on the beginning of the controller. I have the following
>
> > >  > > class EventsController extends AppController {
> > > var $conditions = array();
>
> > > function encrypt() {
> > >$conditions = array("date_added" => "BETWEEN 2007-11-01 AND
> > > 2007-11-02");
> > >$this->set('events',
> > > $this->Event->findAll($this->conditions));
>
> > >if (isset($this->namedArgs['date']))
> > >{
> > >   echo $myParam1 = $this->namedArgs['date'];
> > >}
>
> > > ?>
>
> > > I want to use the $this->namedArgs['date'] in the conditions variable,
> > > but right now I just wrote the static code since I'm trying to make it
> > > work, but when I run it the condition is ignored and it brings me all
> > > the records regardless of date.
>
> > > Is there a simpler way like in a find() where I can get records added
> > > a certain date?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model Cake Conventions Table Id

2007-12-19 Thread Fabian

Hi I'm trying to insert data to a table that doesn't exactly follows
cakes conventions. The table name is Events
and instead of having and id , it has the name event_id. Is there a
way to change this on cake so it looks for the singular table name and
then append id to it?

The weird thing is that I get and error but at the end it inserts the
records correctly.

This is the error:

Query: SELECT COUNT(id) AS count FROM `events` WHERE `id` =
'2007-12-3'
Warning: SQL Error: 1054: Unknown column 'id' in 'field list' in C:
\Program Files\xampp\htdocs\hawk\cake\libs\model\datasources
\dbo_source.php on line 440

So i was wondering if I could change a variable or something so it
looks for a different id name.

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Date Ranges & Conditions

2007-12-19 Thread Fabian

$conditions = array("`date_added` > " . "'" . $startDate . "'",
"`date_added` < " . "'" . $endDate . "'");


On Dec 17, 3:30 pm, Baz <[EMAIL PROTECTED]> wrote:
> Make sure debug is on and check the Query that is being written.
>
> I, personally, have never used the "BETWEEN" for MySQL. I usually have
> something like:
>
> $from = 
> $to = 
>
> $condition = array('date' => "date > $from and date < $to");
>
> But that's just me.
>
> On Dec 17, 2007 3:18 PM, Fabian <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi is it posible to define the $conditions inside a function instead
> > on the beginning of the controller. I have the following
>
> >  > class EventsController extends AppController {
> > var $conditions = array();
>
> > function encrypt() {
> >$conditions = array("date_added" => "BETWEEN 2007-11-01 AND
> > 2007-11-02");
> >$this->set('events',
> > $this->Event->findAll($this->conditions));
>
> >if (isset($this->namedArgs['date']))
> >{
> >   echo $myParam1 = $this->namedArgs['date'];
> >}
>
> > ?>
>
> > I want to use the $this->namedArgs['date'] in the conditions variable,
> > but right now I just wrote the static code since I'm trying to make it
> > work, but when I run it the condition is ignored and it brings me all
> > the records regardless of date.
>
> > Is there a simpler way like in a find() where I can get records added
> > a certain date?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Date Ranges & Conditions

2007-12-17 Thread Fabian

Hi is it posible to define the $conditions inside a function instead
on the beginning of the controller. I have the following

 "BETWEEN 2007-11-01 AND
2007-11-02");
$this->set('events', $this->Event->findAll($this->conditions));

if (isset($this->namedArgs['date']))
{
   echo $myParam1 = $this->namedArgs['date'];
}


?>

I want to use the $this->namedArgs['date'] in the conditions variable,
but right now I just wrote the static code since I'm trying to make it
work, but when I run it the condition is ignored and it brings me all
the records regardless of date.

Is there a simpler way like in a find() where I can get records added
a certain date?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: RequestAction parameters

2007-12-17 Thread Fabian

cool thanks for the tip, yeah I've actually tested in the element and
printed it on the element like this


Number of months:


Archive Interval:




On Dec 15, 2:48 am, MrTufty <[EMAIL PROTECTED]> wrote:
> One tip to avoid error messages like this would be to change the
> definition of your function to:
>
> function index($username = null) {
>
> That way if a username is not passed, it doesn't break.
>
> BUT, that doesn't solve your problem, which appears to be that the
> username isn't being set at all - have you tried outputting $username
> in the view, to see if it actually contains anything?
>
> Tufty
>
> On Dec 14, 9:24 pm, Fabian <[EMAIL PROTECTED]> wrote:
>
> > I did the following
>
> > requestAction('archives/index/'.$username); ?
>
> > and then in the controller
>
> >  > class ArchivesController extends AppController {
> > var $name = 'archives';
>
> > //echo $username;
> > function index($username) {
> > $archives = $this->Archive->findByUser($username);
> > if(isset($this->params['requested'])) {
> >  return $archives;
> > }
> > $this->set('archives', $archives);
> > }}
>
> > ?>
>
> > And I get this error:
>
> > Warning: Missing argument 1 for ArchivesController::index() in C:
> > \Program Files\xampp\htdocs\cake\app\controllers
> > \archives_controller.php on line 5
>
> > Notice: Undefined variable: username in C:\Program Files\xampp\htdocs
> > \cake\app\controllers\archives_controller.php on line 6
>
> > On Dec 14, 2:17 pm, jarmstrong <[EMAIL PROTECTED]> wrote:
>
> > > You can get away with just adding the arguments after the function name 
> > > using
> > > slashes to split each argument.
>
> > > You can do something like this:
>
> > > requestAction('archives/index/'.$i_love_Cake); ?>
>
> > > --
> > > View this message in 
> > > context:http://www.nabble.com/RequestAction-parameters-tp14339603p14339776.html
> > > Sent from the CakePHP mailing list archive at Nabble.com.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: RequestAction parameters

2007-12-14 Thread Fabian

I did the following

requestAction('archives/index/'.$username); ?
>

and then in the controller

Archive->findByUser($username);
if(isset($this->params['requested'])) {
 return $archives;
}
$this->set('archives', $archives);
}
}
?>

And I get this error:


Warning: Missing argument 1 for ArchivesController::index() in C:
\Program Files\xampp\htdocs\cake\app\controllers
\archives_controller.php on line 5

Notice: Undefined variable: username in C:\Program Files\xampp\htdocs
\cake\app\controllers\archives_controller.php on line 6


On Dec 14, 2:17 pm, jarmstrong <[EMAIL PROTECTED]> wrote:
> You can get away with just adding the arguments after the function name using
> slashes to split each argument.
>
> You can do something like this:
>
> requestAction('archives/index/'.$i_love_Cake); ?>
>
> --
> View this message in 
> context:http://www.nabble.com/RequestAction-parameters-tp14339603p14339776.html
> Sent from the CakePHP mailing list archive at Nabble.com.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RequestAction parameters

2007-12-14 Thread Fabian

Hi all,

How can I pass parameters throught requestAction.

Right now I have this on my layout: renderElement('archives', array("username" => "test1"));?>

This calls a element which has the following:

requestAction('archives/index/'); ?>

I want to pass username to archives/index. Can be this done with $this-
>params[] ? or something like it?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 2 Models 1 Layout

2007-12-13 Thread Fabian

oh yeah I just left my post controller as it was doh!

Thanks a lot!!

On Dec 13, 3:23 am, MrTufty <[EMAIL PROTECTED]> wrote:
> At a guess, I'd say that your /posts/index action isn't returning 
> thedatacorrectly.
>
> This is roughly what it should look like: excuse the dodgy formatting.
>
> class PostsController extends AppController {
>... snipped ...
>function index() {
>   $posts = $this->Post->findAll();
>   if(isset($this->params['requested']) {
>  return $posts;
>   }
>   $this->set('posts', $posts);
>}
>
> }
>
> This means the posts index will work both if you go to it directly and
> if you use it in a requestAction.
>
> Hope that helps!
>
> Tufty
>
> On Dec 13, 5:58 am, Fabian <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I'm trying to gatherdatafrom2differentmodels(2different tables)
> > and I want to place them on my layout.
> > Ireadsomething about using a  requestAction so I did the following:
>
> >  function index()
> > {
> >$this->set('archives', $this->Archive->findAll());
> >$this->set('posts', $this->requestAction('/posts/index'));
>
> > }
>
> > so on my layout I have
>
> > 
> > 
> > 
>
> > 
> > 
> > 
>
> > the first one gets the archive user and that one works, but the second
> > one , which I used the table posts created on the 15 min tutorial
> > doesn't get thedata. Can anyone tell me what I'm doing wrong?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



2 Models 1 Layout

2007-12-12 Thread Fabian

Hi All,

I'm trying to gather data from 2 different models (2 different tables)
and I want to place them on my layout.
I read something about using a  requestAction so I did the following:

 function index()
{
   $this->set('archives', $this->Archive->findAll());
   $this->set('posts', $this->requestAction('/posts/index'));

}

so on my layout I have









the first one gets the archive user and that one works, but the second
one , which I used the table posts created on the 15 min tutorial
doesn't get the data. Can anyone tell me what I'm doing wrong?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ver esta página: "Cake Apps/Sites In The Wild"

2007-12-06 Thread Fabian Ramirez

I added 4 sites created in CakePHP :)

Haz clic en 
http://groups.google.com/group/cake-php/web/cake-apps-sites-in-the-wild.
Si haciendo clic no se activa, copia el vínculo y pégalo en la barra
de direcciones de tu navegador.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Looking for a good timepicker

2006-10-11 Thread Fabian Schächter
Hi, ive found the error. You have include the css in your layout. *ARGH*Greetings,  Fabian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Looking for a good timepicker

2006-10-11 Thread Fabian Schächter
Hi HalfBaked, do you have an example how to integrate this picker in a view? Im playing a lot, but it always show at the bottom on the view...Greetings  Fabian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Looking for a good timepicker

2006-10-10 Thread Fabian Schächter
Hi, this one is awesome!Thanks!2006/10/10, HalfBaked <[EMAIL PROTECTED]>:
I use a script from dhtmlgoodies.com that is a calendar and time pickerin one.  Check it out at:http://dhtmlgoodies.com/index.html?page=calendarScripts
I had it up and running in a couple minutes.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Looking for a good timepicker

2006-10-10 Thread Fabian Schächter
Hi all, im using for some projects datepickers, coded in _javascript_, so the users can easily choose a date. But now im looking for goodlooking and easy to use timepicker. Does anybody some good scripts, or using something similar in views?
Thanks,  Fabian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: selectTag ?empty optiont?

2006-09-07 Thread Fabian Schächter
Hi,look here:http://api.cakephp.org/class_html_helper.html#0a0a7c56c21b7d7352fd99158350dfc5Its default, but with
 selectTag('File/category_id', $cats,null, null, null, false); ?> youl have a nice selec box...bye  DerKlops

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


cake-php-de

2006-04-05 Thread Fabian Schächter
Hi all,is anyone interesting in an [EMAIL PROTECTED] for german bakers?Greetz  Fabian

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---