Changing /webroot and /views directories

2013-03-08 Thread Mthabisi Mlunjwa
I need to have 5 different views directories which use the same controllers.
I want all front end views to be different but i want them to use the same
controllers. I see there is a way to define the constants but i would like
to use the bootstrap to define the different View paths

/**
 * The settings below can be used to set additional paths to models, views
and controllers.
 * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
 *
 * App::build(array(
 * 'plugins' = array('/full/path/to/plugins/',
'/next/full/path/to/plugins/'),
 * 'models' =  array('/full/path/to/models/',
'/next/full/path/to/models/'),
 * 'views' = array('/full/path/to/views/',
'/next/full/path/to/views/'),
 * 'controllers' = array('/full/path/to/controllers/',
'/next/full/path/to/controllers/'),
 * 'datasources' = array('/full/path/to/datasources/',
'/next/full/path/to/datasources/'),
 * 'behaviors' = array('/full/path/to/behaviors/',
'/next/full/path/to/behaviors/'),
 * 'components' = array('/full/path/to/components/',
'/next/full/path/to/components/'),
 * 'helpers' = array('/full/path/to/helpers/',
'/next/full/path/to/helpers/'),
 * 'vendors' = array('/full/path/to/vendors/',
'/next/full/path/to/vendors/'),
 * 'shells' = array('/full/path/to/shells/',
'/next/full/path/to/shells/'),
 * 'locales' = array('/full/path/to/locale/',
'/next/full/path/to/locale/')
 * ));
 *
 */


considering these are 2 different view paths: 
 'views' = array('/full/path/to/views/', '/next/full/path/to/views/'),

How do i specify the full paths? Should it be like this:
'views' = array(APP.'views'.DS , APP.'mobile'.DS)

and where do i specify which path to use?



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Changing-webroot-and-views-directories-tp5714038.html
Sent from the CakePHP mailing list archive at Nabble.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 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to turn off php safe mode in .htaccess

2011-12-15 Thread mthabisi mlunjwa
I get this error message when uploading images:

Warning (2): copy() [function.copy]: SAFE MODE Restriction in effect.
The script whose uid is 10214 is not allowed to access /usr/local/psa/
home/vhosts/testsite.com/httpdocs/app/webroot/img/Practitioner/338
owned by uid 80 [APP/models/behaviors/image.php, line 307]

This is because safe mode is on. how can I set it off using
a .htaccess file?

Folder permissions are set to 0777
PLEASE HELP, THANKS IN ADVANCE!

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cakephp Paginator-sort()

2011-09-02 Thread mthabisi mlunjwa
Thanks SCS, it works!

On Sep 1, 2:59 pm, scs scs2...@gmail.com wrote:
 Change:
      th?php echo $this-Paginator-sort('country_id',
 'Country.name');?/th
 To:
      th?php echo $this-Paginator-sort('Country', 'Country.name');?

 /th

 http://book.cakephp.org/view/1233/Pagination-in-Views

 On Sep 1, 5:06 am, mthabisi mlunjwa mmlun...@gmail.com wrote: In my view I 
 have the following:

  th?php echo $this-Paginator-sort('country_id', 'Country.name');?

  /th

  The above code will display country_id as the heading of a list of
  counties. I'm looking for a way to rename country_id such that it
  displays as Country.

  Please note country_id is a foreign key for table Country

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cakephp Paginator-sort()

2011-09-01 Thread mthabisi mlunjwa
In my view I have the following:

th?php echo $this-Paginator-sort('country_id', 'Country.name');?
/th

The above code will display country_id as the heading of a list of
counties. I'm looking for a way to rename country_id such that it
displays as Country.

Please note country_id is a foreign key for table Country

-- 
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: How to display hasMany association in the view

2011-07-22 Thread mthabisi mlunjwa
@gremlin I'm sending $Practicioner to the view and I'm looping over
$Practicioner like this:

foreach ($Practitioner as $Practitioners){
..
.
}

so that should explain why one is singular and the other is plural.
But its now working thanks to Jeremy.


On Jul 22, 6:27 am, gremlin abba.bry...@gmail.com wrote:
 It also looks like in at least your sample code you were sending
 $Practicioner to the view and trying to loop over $Practicioners
 (notice one is plural - one is singular)

 On Jul 21, 10:46 am, mthabisi mlunjwa mmlun...@gmail.com wrote:







  Thanks Jeremy!

  I used $practitioner['Practice'][0]['town'] and its now working.
  Thanks a lot man!

  On Jul 21, 4:17 pm, Jeremy Burns | Class Outfit

  jeremybu...@classoutfit.com wrote:
   I apologise;

   $practitioner['Practice'][0]['town']

   Not sure how you are generating that array...

   Jeremy Burns
   Class Outfit

  http://www.classoutfit.com

   On 21 Jul 2011, at 15:14, Jeremy Burns | Class Outfit wrote:

So (assuming this array is called $practitioner) you can display the 
town by $practitioner['Practice']['town'].

Jeremy Burns
Class Outfit

   http://www.classoutfit.com

On 21 Jul 2011, at 15:02, mthabisi mlunjwa wrote:

Sorry its a typo. All field names are in lower case.

I'm failing to display the town. But when I use debug($Practitioner)
the practitioner fields and practice towns are all displayed as shown
below:
array
(
   [0] = Array
       (
           [Practitioner] = Array
               (
                   [id] = 233
                   [region_id] = 2
                   [country_id] = 5
                   [status_id] = 1
                   [role_id] = 2
                   [bsrno] = 241
                   [surname] = Bossley
                   [name] = Bronwyn
                   [cell] = 0215656765
                   [password] =
dd4e8d1e0dfeb4ace2dda0fdfc8db83948109151
                   [created] = -00-00 00:00:00
                   [modified] = 2011-05-05 11:11:45
               )

           [Practice] = Array
               (
                   [0] = Array
                       (
                           [id] = 233
                           [practitioner_id] = 233
                           [region_id] = 2
                           [country_id] = 5
                           [name] = Main
                           [Telephone] = +61 411673912
                           [Address] = 15 Edna Street, Carrimundi,
Queensland, 4551, Australia
                           [town] = Carrimundi
                       )

               )

       )

From my own understanding I thought the containable behaviour helps to
filter out unwanted results so as to improve the overall response
time. At the moment I'm interested in displaying the practise town.

On Jul 21, 3:13 pm, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
Not sure if it's a typo, but your field names should be lower case.

Look at the Containable behaviour 
(http://book.cakephp.org/view/1323/Containable).

Jeremy Burns
Class Outfit

   http://www.classoutfit.com

On 21 Jul 2011, at 14:10, mthabisi mlunjwa wrote:

I have two models: Practitioner and Practice

Practitioner hasMany Practice and
Practise Belongs to Practitioner

The practise model has the following fields id,Practitioner_id, Name,
Town etc.
The Practitioner model has the following fields id,Surname, Name, 
Cell
etc.

In my controller I used a find function:
   $Practitioner = $this-Practitioner-find('all');
       $this-set(compact('Practitioner'));

In my view I want to display the practitioner name, Surname, cell,
practice name and practice town.

I can display practitioner name, Surname and cell using code like 
this
$Practitioners['Practitioner']['cell']
But I'm failing to display  the corresponding practitioner's practice
name and practice town. I've tried using: $Practitioners['Practice']
['town'];  to display town but it looks like nothing gets displayed.

How can I display town? Please help thanks in advance

--
Our newest site for the community: CakePHP Video 
Tutorialshttp://tv.cakephp.org
Check out the new CakePHP Questions 
sitehttp://ask.cakephp.organdhelpotherswith their CakePHP related 
questions.

To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group athttp://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video 
Tutorialshttp://tv.cakephp.org
Check out the new CakePHP Questions 
sitehttp://ask.cakephp.organdhelpothers with their CakePHP related 
questions.

To unsubscribe from this group, send email

How to display hasMany association in the view

2011-07-21 Thread mthabisi mlunjwa
I have two modes: Practitioner and Practice

Practitioner hasMany Practice and
Practise Belongs to Practitioner

The practise model has the following fields id,Practitioner_id, Name,
Town etc.
The Practitioner model has the following fields id,Surname, Name, Cell
etc.

In my controller I used a find function:
$Practitioner = $this-Practitioner-find('all');
$this-set(compact('Practitioner'));

In my view I want to display the practitioner name, Surname, cell,
practice name and practice town.

I can display practitioner name, Surname and cell using code like this
$Practitioners['Practitioner']['cell']
But I'm failing to display  the corresponding practitioner's practice
name and practice town. I've tried using: $Practitioners['Practice']
['town'];  to display town but it looks like nothing gets displayed.

How can I display town? Please help thanks in advance

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to display hasMany association in the view

2011-07-21 Thread mthabisi mlunjwa
Sorry its a typo. All field names are in lower case.

I'm failing to display the town. But when I use debug($Practitioner)
the practitioner fields and practice towns are all displayed as shown
below:
array
(
[0] = Array
(
[Practitioner] = Array
(
[id] = 233
[region_id] = 2
[country_id] = 5
[status_id] = 1
[role_id] = 2
[bsrno] = 241
[surname] = Bossley
[name] = Bronwyn
[cell] = 0215656765
[password] =
dd4e8d1e0dfeb4ace2dda0fdfc8db83948109151
[created] = -00-00 00:00:00
[modified] = 2011-05-05 11:11:45
)


[Practice] = Array
(
[0] = Array
(
[id] = 233
[practitioner_id] = 233
[region_id] = 2
[country_id] = 5
[name] = Main
[Telephone] = +61 411673912
[Address] = 15 Edna Street, Carrimundi,
Queensland, 4551, Australia
[town] = Carrimundi
)

)

)

From my own understanding I thought the containable behaviour helps to
filter out unwanted results so as to improve the overall response
time. At the moment I'm interested in displaying the practise town.

On Jul 21, 3:13 pm, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 Not sure if it's a typo, but your field names should be lower case.

 Look at the Containable behaviour 
 (http://book.cakephp.org/view/1323/Containable).

 Jeremy Burns
 Class Outfit

 http://www.classoutfit.com

 On 21 Jul 2011, at 14:10, mthabisi mlunjwa wrote:







  I have two models: Practitioner and Practice

  Practitioner hasMany Practice and
  Practise Belongs to Practitioner

  The practise model has the following fields id,Practitioner_id, Name,
  Town etc.
  The Practitioner model has the following fields id,Surname, Name, Cell
  etc.

  In my controller I used a find function:
     $Practitioner = $this-Practitioner-find('all');
         $this-set(compact('Practitioner'));

  In my view I want to display the practitioner name, Surname, cell,
  practice name and practice town.

  I can display practitioner name, Surname and cell using code like this
  $Practitioners['Practitioner']['cell']
  But I'm failing to display  the corresponding practitioner's practice
  name and practice town. I've tried using: $Practitioners['Practice']
  ['town'];  to display town but it looks like nothing gets displayed.

  How can I display town? Please help thanks in advance

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
  athttp://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: How to display hasMany association in the view

2011-07-21 Thread mthabisi mlunjwa
Thanks Jeremy!

I used $practitioner['Practice'][0]['town'] and its now working.
Thanks a lot man!



On Jul 21, 4:17 pm, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 I apologise;

 $practitioner['Practice'][0]['town']

 Not sure how you are generating that array...

 Jeremy Burns
 Class Outfit

 http://www.classoutfit.com

 On 21 Jul 2011, at 15:14, Jeremy Burns | Class Outfit wrote:







  So (assuming this array is called $practitioner) you can display the town 
  by $practitioner['Practice']['town'].

  Jeremy Burns
  Class Outfit

 http://www.classoutfit.com

  On 21 Jul 2011, at 15:02, mthabisi mlunjwa wrote:

  Sorry its a typo. All field names are in lower case.

  I'm failing to display the town. But when I use debug($Practitioner)
  the practitioner fields and practice towns are all displayed as shown
  below:
  array
  (
     [0] = Array
         (
             [Practitioner] = Array
                 (
                     [id] = 233
                     [region_id] = 2
                     [country_id] = 5
                     [status_id] = 1
                     [role_id] = 2
                     [bsrno] = 241
                     [surname] = Bossley
                     [name] = Bronwyn
                     [cell] = 0215656765
                     [password] =
  dd4e8d1e0dfeb4ace2dda0fdfc8db83948109151
                     [created] = -00-00 00:00:00
                     [modified] = 2011-05-05 11:11:45
                 )

             [Practice] = Array
                 (
                     [0] = Array
                         (
                             [id] = 233
                             [practitioner_id] = 233
                             [region_id] = 2
                             [country_id] = 5
                             [name] = Main
                             [Telephone] = +61 411673912
                             [Address] = 15 Edna Street, Carrimundi,
  Queensland, 4551, Australia
                             [town] = Carrimundi
                         )

                 )

         )

  From my own understanding I thought the containable behaviour helps to
  filter out unwanted results so as to improve the overall response
  time. At the moment I'm interested in displaying the practise town.

  On Jul 21, 3:13 pm, Jeremy Burns | Class Outfit
  jeremybu...@classoutfit.com wrote:
  Not sure if it's a typo, but your field names should be lower case.

  Look at the Containable behaviour 
  (http://book.cakephp.org/view/1323/Containable).

  Jeremy Burns
  Class Outfit

 http://www.classoutfit.com

  On 21 Jul 2011, at 14:10, mthabisi mlunjwa wrote:

  I have two models: Practitioner and Practice

  Practitioner hasMany Practice and
  Practise Belongs to Practitioner

  The practise model has the following fields id,Practitioner_id, Name,
  Town etc.
  The Practitioner model has the following fields id,Surname, Name, Cell
  etc.

  In my controller I used a find function:
     $Practitioner = $this-Practitioner-find('all');
         $this-set(compact('Practitioner'));

  In my view I want to display the practitioner name, Surname, cell,
  practice name and practice town.

  I can display practitioner name, Surname and cell using code like this
  $Practitioners['Practitioner']['cell']
  But I'm failing to display  the corresponding practitioner's practice
  name and practice town. I've tried using: $Practitioners['Practice']
  ['town'];  to display town but it looks like nothing gets displayed.

  How can I display town? Please help thanks in advance

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
  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 
  athttp://groups.google.com/group/cake-php

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
  athttp://groups.google.com/group/cake-php

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
  athttp://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

using sql LIKE in find()

2011-06-17 Thread mthabisi mlunjwa
I'm not sure if I'm missing something here. I'm trying to come up with
this sql statement the Cakephp way:

select * from practitioners where name like 'Vermeulen' or surname
like 'Vermeulen';

This is what I've come up with:

find( 'all', $conditions = array(OR=array('Practitioner.surname
LIKE' = %Vermeulen%,'Practitioner.name LIKE' =
%Vermeulen%)));

This works but it only outputs the whole database. I just want it to
output practitioners with surnames or names like Vermeulen.

Please help, thanks in advance.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: using sql LIKE in find()

2011-06-17 Thread mthabisi mlunjwa
Thanks its now working. :-)

On Jun 17, 6:55 pm, scs scs2...@gmail.com wrote:
 sorry forgot to add the vars
 $conditions = 'Practitioner.name LIKE %'.$name.'%';
 $conditions .= ' OR Practitioner.surname LIKE %'.$surname.'%';
 $record = $this-Practitioner-find('all', array('conditions'=
 $conditions ));

 On Jun 17, 12:54 pm, scs scs2...@gmail.com wrote:







  Try this

  $conditions = 'Practitioner.name LIKE %'..'%';
  $conditions .= ' OR Practitioner.surname LIKE %'..'%';
  $record = $this-Practitioner-find('all', array('conditions'=
  $conditions ));

  On Jun 17, 10:35 am, mthabisi mlunjwa mmlun...@gmail.com wrote:

   I'm not sure if I'm missing something here. I'm trying to come up with
   this sql statement the Cakephp way:

   select * from practitioners where name like 'Vermeulen' or surname
   like 'Vermeulen';

   This is what I've come up with:

   find( 'all', $conditions = array(OR=array('Practitioner.surname
   LIKE' = %Vermeulen%,'Practitioner.name LIKE' =
   %Vermeulen%)));

   This works but it only outputs the whole database. I just want it to
   output practitioners with surnames or names like Vermeulen.

   Please help, thanks in advance.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How can I customise sorting order for dropdown field (menu) for foreign-key values

2011-05-13 Thread mthabisi mlunjwa
My add view looks like this:

?php
echo $form-create('Practice');
  echo $form-input('region_id');
  echo $form-input('name');
echo $form-end('save Practise');
?

region table has the following columns:
-id(primary key)
-region

practice table has the following columns:
-id
-region_id
-name

the region_id dropdown menu displays a menu list of all the regions in
the database. They are automatically sorted using the region
id(primary key) field.

How can I change it so that it sorts by region instead of id?

Please help. Thanks in advance.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How can I customise sorting order for dropdown field (menu) for foreign-key values

2011-05-13 Thread mthabisi mlunjwa
Thanks Jeremy, you've saved my time! I didn't know it was that simple.

On May 13, 4:05 pm, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 In you Region model:

 var $order = 'name';

 Jeremy Burns
 Class Outfit

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

 On 13 May 2011, at 15:03, mthabisi mlunjwa wrote:







  My add view looks like this:

  ?php
  echo $form-create('Practice');
   echo $form-input('region_id');
   echo $form-input('name');
  echo $form-end('save Practise');
  ?

  region table has the following columns:
  -id(primary key)
  -region

  practice table has the following columns:
  -id
  -region_id
  -name

  the region_id dropdown menu displays a menu list of all the regions in
  the database. They are automatically sorted using the region
  id(primary key) field.

  How can I change it so that it sorts by region instead of id?

  Please help. Thanks in advance.

  --
  Our newest site for the community: CakePHP Video 
  Tutorialshttp://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
  athttp://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: isUnique validation on edit action of User model

2011-05-09 Thread mthabisi mlunjwa
I once had the same problem with the Isunique validation rule when
editing  my email field. I tried to create my own method which did
seem to work. But along the way I quickly realized I was not doing
things properly.
My problem was in the database, I was using an old database and some
records where using the same email address. They were added using the
previous system which did not check to see if the email was unique.
And obviously these records where not added from my app, otherwise the
isunique error could have popped up. In my app I was able to view the
user details but I couldn't edit. When I removed one of  the duplicate
record, everything worked perfectly.

Please run an sql query on your database to check if there are no
other records using the same email. I hope this helps.

rifat wrote:
 Its already in CakePHP core, you didn't need nothing at all. If you just use
 echo $form-input('id'); in your view. Sorry, that I didn't notice your
 problem in time.

 --
 View this message in context: 
 http://cakephp.19694.n2.nabble.com/isUnique-validation-on-edit-action-of-User-model-tp5519353p6340487.html
 Sent from the CakePHP mailing list archive at Nabble.com.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how can I set my home page

2011-05-05 Thread mthabisi mlunjwa
Yes I'm using the Auth component, and yes I've added the Auth
component in my AppController.
 I'm new to CakePhp so this might sound like a stupid question

I added the home action on $this-Auth-
allow('index','view','recover','verify','home');
I thought this would solve the problem but its still asking me to log
in. Please advice.

this is my Appcontroller:

class AppController extends Controller {
var $components = array('Auth','Session','Email');
//var $helpers = array('Time');


function beforeFilter(){
$this-Auth-allow('index','view','recover','verify','home');
$this-Auth-userModel = 'Practitioner';
$this-Auth-fields = array('username' = 'email', 'password' =
'password');
$this-Auth-authError = 'To login please enter your email and
password!';
$this-Auth-loginError = 'Incorect Email or password 
combination.';
$this-Session-write('Auth.redirect', null);
$this-Auth-loginRedirect = array('controller' = 
'Practitioners',
'action' = 'index');
$this-Auth-logoutRedirect = 
array(Configure::read('Routing.admin')
= false, 'controller' = 'Practitioners', 'action' = 'logout');
$this-Model-authUserId = $this-Auth-user('id');
}
}

Thanks in advance

On May 4, 10:56 am, Ryan Schmidt google-2...@ryandesign.com wrote:
 On May 3, 2011, at 17:07, mthabisi mlunjwa wrote:

  I'm trying to set home.ctp as my home page/landing page. But no matter
  how I try I'm redirected to a different page(http://domain.com/
  practitioners/login).

 Sounds like you've added the Auth component (possibly to your AppController). 
 Is that possible? If so, that's what's asking you to log in here.

 http://book.cakephp.org/view/1250/Authentication

 If you don't want users to have to log in to see your home page, then you 
 need to tell the Auth component that, for example by allowing the display 
 action. (This will allow all URLs handled by the Pages controller (not just 
 the home page) to be displayed.)

 http://book.cakephp.org/view/1656/allowedActions

-- 
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: how can I set my home page

2011-05-05 Thread mthabisi mlunjwa
I've allowed the display action and it now works.

Thanks for the help guys.

On May 5, 3:46 pm, mi...@brightstorm.co.uk wrote:
  Yes I'm using the Auth component, and yes I've added the Auth
  component in my AppController.
   I'm new to CakePhp so this might sound like a stupid question

  I added the home action on $this-Auth-
 allow('index','view','recover','verify','home');
  I thought this would solve the problem but its still asking me to log
  in. Please advice.

 if you are using the pages controller to display your home.ctp then you'll
 need to allow the 'display' action rather than the page you are trying to
 display.







  this is my Appcontroller:

  class AppController extends Controller {
     var $components = array('Auth','Session','Email');
     //var $helpers = array('Time');

     function beforeFilter(){
             $this-Auth-allow('index','view','recover','verify','home');
             $this-Auth-userModel = 'Practitioner';
             $this-Auth-fields = array('username' = 'email', 'password' =
  'password');
             $this-Auth-authError = 'To login please enter your email and
  password!';
             $this-Auth-loginError = 'Incorect Email or password 
  combination.';
             $this-Session-write('Auth.redirect', null);
             $this-Auth-loginRedirect = array('controller' = 
  'Practitioners',
  'action' = 'index');
             $this-Auth-logoutRedirect = 
  array(Configure::read('Routing.admin')
  = false, 'controller' = 'Practitioners', 'action' = 'logout');
             $this-Model-authUserId = $this-Auth-user('id');
     }
  }

  Thanks in advance

  On May 4, 10:56 am, Ryan Schmidt google-2...@ryandesign.com wrote:
  On May 3, 2011, at 17:07, mthabisi mlunjwa wrote:

   I'm trying to set home.ctp as my home page/landing page. But no matter
   how I try I'm redirected to a different page(http://domain.com/
   practitioners/login).

  Sounds like you've added the Auth component (possibly to your
  AppController). Is that possible? If so, that's what's asking you to log
  in here.

 http://book.cakephp.org/view/1250/Authentication

  If you don't want users to have to log in to see your home page, then
  you need to tell the Auth component that, for example by allowing the
  display action. (This will allow all URLs handled by the Pages
  controller (not just the home page) to be displayed.)

 http://book.cakephp.org/view/1656/allowedActions

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
  athttp://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


how can I set my home page

2011-05-04 Thread mthabisi mlunjwa
I'm trying to set home.ctp as my home page/landing page. But no matter
how I try I'm redirected to a different page(http://domain.com/
practitioners/login). I'm not sure if  I'm following the correct
procedure. see below the pagesController and routes.php
class PagesController extends AppController {

var $name = 'Pages';

var $helpers = array('Html');

var $uses = array();


function display() {
$path = func_get_args();

$count = count($path);
if (!$count) {
$this-redirect('/');
}
$page = $subpage = $title_for_layout = null;

if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
$title_for_layout = Inflector::humanize($path[$count - 
1]);
}
$this-set(compact('page', 'subpage', 'title_for_layout'));
$this-render(implode('/', $path));
}

public function home(){
$this-set('title_for_layout', 'Practitioner's');
$this-layout = 'home2';
}
}
?

Routes.php:

Router::connect('/', array('controller' = 'pages', 'action' =
'display', 'home'));
Router::connect('/pages/*', array('controller' = 'pages', 'action'
= 'display'));

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