Re: Need advice for custom ACL

2011-01-27 Thread Ernesto
Hi ShadowCross.

thx for your suggestions.

i'll surely try them


On 27 Gen, 20:31, ShadowCross  wrote:
> Ernesto:
>
> Some things to try:
>
> For your first example: ignore some validation rules if the user has
> "authorization X".
> - validate the data from the controller, using the $options parameter
> to specify which subset of the validation rules to apply.  There is a
> (albeit simplistic) example in the Cookbook (http://book.cakephp.org/
> view/1182/Validating-Data-from-the-Controller), where only a couple of
> the fields are validated.  If you have multiple rules for a field, and
> you want only some, not all, those rules checked on that field, you
> can adjust rules array for that field in the Model's beforeValidate()
> function (or an attached Behavior's beforeValidate()) -- the
> $optionsparameter of Model::validates() is passed to the
> Model::beforeValidate(), and only the 'fieldList' key is reserved.
> Unfortunately, if you have to resort to the beforeValidate(), your
> permissions logic will not be confined to your controller.
> - if no errors, call the Model::save() or Model::saveAll(), but set
> the validate parameter to false to avoid using the model's full
> validation
>
> =
> For your second example: hide or modify some form fields if user
> hasn't "authorization Y".
> - in your controller, you can create an array of what authorizations
> the user has and save that to a view variable.
> - in your view, use that array to determine whether a form field
> should be hidden or adjusted.
>
> example:
> foo_controller.php:
>
>         function edit($id = null) {
>                 ...
>                 $aro = 'user/' . $this->Auth->user('id');
>
>                 // Create list of authorizations that user has
>                 $authorizations = array();
>                 foreach(array('Bar/Y_1', 'Bar/Y_2', 'Bar/Y_3') as $aco) {
>                         if ($this->Acl->check($aro, $aco) {
>                                 $authorizations[] = $aco;
>                         }
>                 }
>                 $this->set(compact('authorizations'));
>         }
>
> foo/edit.ctp:
>
>         ...
>
>         if (in_array('Bar/Y_2', $authorizations)) {
>                 echo $this->Form->input('fieldX1');
>         } else {
>                 echo $this->Form->hidden('fieldX1');
>         }
>         if (in_array('Bar/Y_3', $authorizations)) {
>                 echo $this->Form->input('fieldX2', array(
>                         'options' => array('1', '2', '3')
>                 ));
>         } else {
>                 echo $this->Form->input('fieldX2', array(
>                         'options' => array('4', '5', '6')
>                 ));
>         }
>
> Note that in Cake's built-in ACL, the ACO (Access Control Object)
> nodes do not have to correspond to controllers or actions. ACO nodes
> that correspond to actions is just one of the built-in behaviors.  You
> can also define arbitrary ACO nodes.  To extend my example above, I
> can have the following ACO nodes defined:
>
>         controllers/Foo/add
>         controllers/Foo/edit
>         controllers/Foo/index
>         controllers/Foo/view
>         Bar/Y_1
>         Bar/Y_2
>         Bar/Y_3
>
> and in app_controller.php:
>
>         var $components = array('Auth' => array(
>                 'authorize' => 'actions',
>                 'actionPath' => 'controllers/'
>         ));
>
> Note the 'actionPath' AuthComponent variable; any ACO nodes NOT nested
> under the 'controllers' (or whatever you specify as the actionPath)
> node are ignored for the purposes of the "standard Cake ACL".  To
> check permissions manually for everything else, you can use the
> check($aro, $aco, $action = '*') function of the AclComponent.
>
> There may be some advantages of using Cake's AclComponent in this way
> instead of your custom CheckAuthorizations class, including:
> - using existing tables (aros, acos, aros_acos, and not having to add
> the authorizations and authorizations_users tables)
> - "inheritance".  ARO nodes can refer to groups and/or users -- if a
> UserX is part of GroupA and GroupA has access to AuthB, UserX also has
> AuthB (unless access to AuthB is explicitly revoked from UserX.  And
> if groups are defined as heirarchical (i.e. TreeBehavior), GroupA can
> inherit access rights from it's parents and ancestors.  The same
> applies to ACO nodes.  In fact, you *could*, in theory, define field-
> level access in the following manner:
>
> ARO:
>         Group 1 (all users)
>         Group 2 (admin)
>
> ACO:
>         controllers/Foo/edit
>         controllers/Foo/edit/name
>         controllers/Foo/edit/fieldX1
>         controllers/Foo/edit/fieldX2
>
> ARO/ACO:
>
>         // All users can access the edit page for Foo
>         $this->Acl->allow('Group 1', 'controllers/Foo/edit');
>
>         // Revoke access to fieldX1 and fieldX2 from the public at large
>         $this->Acl->deny('Group 1', 'controllers/Foo/edit/fieldX1');
>         

Re: year only combobox

2011-01-27 Thread Miqdad Ali
friends thanks for help and

i want to display only year i dont want any month and day



Miqdad Ali

http://www.miqdadalik.co.cc/
http://www.miqdadali.co.cc





On Mon, Jan 24, 2011 at 2:45 PM, Joshua Muheim  wrote:

> I have problems understanding your question. If you have a date field in
> your model, then $this->Form->input('date') should result in a day select
> box, a month select box and a year select box. If you have a datetime field,
> then it should also result in hour/minute/second select boxes.
>
> You can also create your own select boxes using $this->Form->year(...),
> month(...), day(...) etc.
>
> Does this answer your question?
>
> On Sat, Jan 22, 2011 at 11:16 AM, Miqdad Ali wrote:
>
>>
>> i want a select box date type but it's don't display date and month
>> display only year ???
>>
>>
>>
>>
>>
>> 
>> Miqdad Ali
>>
>>
>>
> http://www.miqdadalik.co.cc/
>> http://www.miqdadali.co.cc
>>
>>
>>
>>  --
>> 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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php
>>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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


Re: anybody have idea for this

2011-01-27 Thread Miqdad Ali
tanx friends

i got it

created a css class


.error-message{
color:#FF;
}


Miqdad Ali

http://www.miqdadalik.co.cc/
http://www.miqdadali.co.cc





On Fri, Jan 28, 2011 at 11:34 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> It's a CSS thing. Look for the style applied to the flash message and
> change it in your stylesheet.
>
> Jeremy Burns
> *Class Outfit*
> *
> *
> jeremybu...@classoutfit.com 
> http://www.classoutfit.com
>
> On 28 Jan 2011, at 05:54, Miqdad Ali wrote:
>
> anybody have  idea for this
> var $validate = array(
>
>   'name' => array(
>   'rule' =>
> array('custom','/^[A-Z -.]{1,}$/i'),
>'required' => true,
>   '*message*' => 'Please Enter
> Name'
>
>)
> )
> this is my *model* for validating name I want to display this *message* in
> red *color*
> pls help.
>
>
> 
> Miqdad Ali
>
> http://www.miqdadalik.co.cc/
> http://www.miqdadali.co.cc
>
>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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


Is bake DRY?

2011-01-27 Thread keymaster
Although I have been developing with cake for some time (generally
loving every minute), I have never understood the rationale for cake’s
bake utility duplicating so many nearly identical copies of every
action and every view all across your system, in a seemingly total
contradiction of DRY principles.

Why would you want basically the same code duplicated all across your
app?

Wouldn’t it be smarter for bake to create a single instance of generic
crud ops in the AppController, with a single admin_index.ctp
configurable for  cols, labels, models, error msgs, fields, etc. and
if there is nothing configured, it defaults to what it can learn from
the database?

The generic actions/views could always be overrided in specific
controllers.

Anyone have a clue why bake works this way?

-- 
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: New to cake and need advice

2011-01-27 Thread Zaky Katalan-Ezra
Go for it
I made the transition after 10 years in C#.
I guess you want to do web applications so you have to learn new things any
way.
I think php and cakephp in particular is the best thing to start with.

-- 
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 Save A User Email after Logging In

2011-01-27 Thread nurvzy
Assuming you've asked for the email permission you'll have access to
the authenticated facebook user's email with:

$this->Connect->user('email');

Save into your users database however you see fit.
Example:

if($this->Connect->user('email') && !$this->User->field('email')){
  $this->User->saveField('email', $this->Connect->user('email'));
}

Hope that helps,
Nick
On Jan 27, 5:28 pm, tubiz  wrote:
> Presently i am using the Facebook Authentication Plugin by Webtechnik
> but i have a problem i would like to store the email address of the
> user into my database after the user has logged in. I have already set
> the users details into a variable called facebook_user where I am
> stuck now is how to save the user detials into the database after the
> user has logged in. Thanks

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


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


Re: Connecting to a remote database via SSH

2011-01-27 Thread Zaky Katalan-Ezra
There is no need of tunnelling in order to connect mysql workbench to remote
database via SSH

-- 
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: getting an error Unknown column 'State.name' in 'order clause'

2011-01-27 Thread andy_the ultimate baker
thanks jaremy,
i was expecting ur reply,
i had read ur last posts regarding this issue and i got the answer
there itself,
thank u
keep solving the issues of newcomers like me

best regards

andy
(trying to start a bakery)

On Jan 28, 11:33 am, Jeremy Burns | Class Outfit
 wrote:
> Try adding:
>
> var $displayField = 'title';
>
> ...to the top of your model.
>
> PS: I presume the 'name' field exists in the table?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 28 Jan 2011, at 06:28, andy_the ultimate baker wrote:
>
> > hi bakers,
> > good morning to all but it is not going good for me,
> > since morning i m trying to resolve one error
>
> > "Unknown column 'State.name' in 'order clause'"
>
> > but i m not getting where exactly i m wrong,
> > can anyone suggest me the solution on it,
>
> > a query is coming out in error is as fallows
>
> > Query: SELECT `State`.`id`, `State`.`title` FROM `states` AS `State`
> > WHERE 1 = 1   ORDER BY `State`.`name` ASC
>
> > and my controller is doing this
>
> >    function add() {
>
> >            $states = $this->State->find('list');
> >            //print_r($states);exit;
> >            $cities = $this->City->find('all',
> > array('conditions'=>array($states)));
> >            $this->set(compact('states', 'cities'));
>
> > }
>
> > and my model is as fallows
>
> >  > class State extends AppModel {
> >    var $name = 'State';
> >    var $order = "State.name ASC";
> > }
> > ?>
>
> > --
> > 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: getting an error Unknown column 'State.name' in 'order clause'

2011-01-27 Thread Jeremy Burns | Class Outfit
Try adding:

var $displayField = 'title';

...to the top of your model.

PS: I presume the 'name' field exists in the table?

Jeremy Burns
Class Outfit

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

On 28 Jan 2011, at 06:28, andy_the ultimate baker wrote:

> hi bakers,
> good morning to all but it is not going good for me,
> since morning i m trying to resolve one error
> 
> "Unknown column 'State.name' in 'order clause'"
> 
> but i m not getting where exactly i m wrong,
> can anyone suggest me the solution on it,
> 
> a query is coming out in error is as fallows
> 
> Query: SELECT `State`.`id`, `State`.`title` FROM `states` AS `State`
> WHERE 1 = 1   ORDER BY `State`.`name` ASC
> 
> and my controller is doing this
> 
>   function add() {
> 
>   $states = $this->State->find('list');
>   //print_r($states);exit;
>   $cities = $this->City->find('all',
> array('conditions'=>array($states)));
>   $this->set(compact('states', 'cities'));
> 
> }
> 
> 
> and my model is as fallows
> 
> 
>  class State extends AppModel {
>   var $name = 'State';
>   var $order = "State.name ASC";
> }
> ?>
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


getting an error Unknown column 'State.name' in 'order clause'

2011-01-27 Thread andy_the ultimate baker
hi bakers,
good morning to all but it is not going good for me,
since morning i m trying to resolve one error

"Unknown column 'State.name' in 'order clause'"

but i m not getting where exactly i m wrong,
can anyone suggest me the solution on it,

a query is coming out in error is as fallows

Query: SELECT `State`.`id`, `State`.`title` FROM `states` AS `State`
WHERE 1 = 1   ORDER BY `State`.`name` ASC

and my controller is doing this

function add() {

$states = $this->State->find('list');
//print_r($states);exit;
$cities = $this->City->find('all',
array('conditions'=>array($states)));
$this->set(compact('states', 'cities'));

}


and my model is as fallows




-- 
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 do you do.

2011-01-27 Thread raymond
oh.. I see.
Now don't know if I should laugh or cry...
this morning, I posted my article, was waiting it appears, but never,
so sent this email to group email address, and suddenly noticed that
this email, to my surprise, was posted quickly, while my prev post
does not appear yet... :(
so confusing...

> I think new users get moderated for awhile, to ensure they're not spammers, 
> but then they get switched so they can post and have their messages appear 
> immediately.

-- 
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: anybody have idea for this

2011-01-27 Thread Jeremy Burns | Class Outfit
It's a CSS thing. Look for the style applied to the flash message and change it 
in your stylesheet.

Jeremy Burns
Class Outfit

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

On 28 Jan 2011, at 05:54, Miqdad Ali wrote:

> anybody have  idea for this
> var $validate = array(
> 
>   'name' => array(
>   'rule' =>  
> array('custom','/^[A-Z -.]{1,}$/i'),
>   'required' => true,
>   'message' => 'Please Enter Name'
> 
>)
> )
> this is my model for validating name I want to display this message in red 
> color
> pls help.
> 
> 
> 
> Miqdad Ali
> 
> http://www.miqdadalik.co.cc/
> http://www.miqdadali.co.cc
> 
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: CakePHP and ExtJS

2011-01-27 Thread Dr. Tarique Sani
There are people who have done that but I would suggest that you keep
your JS application separate from the cake application and make use of
JSON based webservices to communicate between the two. In other words
your cake application exposes only the necessary data via webservices

Hope that helps
Tarique




On Thu, Jan 27, 2011 at 11:02 PM, byqsri  wrote:
> Hi
> Is someone that has integrated ExtJS with CAKEPHP?
> Many Thanks
> Marco
>
> --
> 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
>



-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

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


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


anybody have idea for this

2011-01-27 Thread Miqdad Ali
anybody have  idea for this
var $validate = array(

  'name' => array(
  'rule' =>
array('custom','/^[A-Z -.]{1,}$/i'),
   'required' => true,
  '*message*' => 'Please Enter
Name'

   )
)
this is my *model* for validating name I want to display this *message* in
red *color*
pls help.



Miqdad Ali

http://www.miqdadalik.co.cc/
http://www.miqdadali.co.cc

-- 
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: New to cake and need advice

2011-01-27 Thread newguy
Thanks Ryan I appreciate your help.

On Jan 27, 8:35 pm, Ryan Schmidt  wrote:
> On Jan 27, 2011, at 11:50, newguy wrote:
>
> > Am new to cake and php but  I have 5 - 6 years of coding experience in
> > c/c++. I have basic php knowledge through w3schools, I am in doubt
> > whether starting with cake is a good decision or not, am comfortable
> > with MVC architecture and I really want to learn cake framework but my
> > limited experience with php is making me ask for advice.
>
> I'd recommend you go through some of the tutorials that are available. Watch 
> some screencasts about building a basic CakePHP application (the blog app is 
> a common one) and try to follow along, built your own app that does what 
> they're doing. Try making small changes. The PHP documentation is pretty good 
> at helping you learn how to use individual functions, once you get to 
> something you need a PHP function for. And of course the CakePHP book is 
> there as a reference for how CakePHP fits together.

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


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


Re: save multiple related records

2011-01-27 Thread Amit Badkas
Hi,

Both the fields in the form are multi-select, so how you want to save the
data? Will all selected users relate to all selected exercises?

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Jan 28, 2011 at 4:07 AM, cake bake  wrote:

> is there any way to save multiple related records here is my code
>
> function asign() {
>$this->loadModel('UsersExercise');
>if (!empty($this->data)) {
>$this->UsersExercise->create();
>if ($this->UsersExercise->save($this->data)) {
>$this->Session->setFlash(__('The exercise could not
> be saved.
> Please, try again.', true));
>$this->redirect(array('action' => 'index'));
>} else {
>$this->Session->setFlash(__('The exercise
> could not be saved.
> Please, try again.', true));
>}
>}
>$users = $this->Exercise->User->find('list');
>$exercises = $this->Exercise->find('list');
>$this->set(compact('users'));
>$this->set(compact('exercises'));
>}
>
> Form->create('UsersExercise',array('url' => '/
> exercises/asign'));?>
>
>
>echo $this->Form->input('user_id',array('type' =>
> 'select','multiple' => true,'options' => $users) );
>echo $this->Form->input('exercise_id',array('type' =>
> 'select','multiple' => true,'options' => $exercises) );
>?>
>
> Form->end(__('Submit', true));?>
>
>
>
> here is the debug for this->data
>
> Array
> (
>[_Token] => Array
>(
>[key] => 3sss
>[fields] => sss)
>
>[UsersExercise] => Array
>(
>[user_id] => Array
>(
>[0] => 1
>)
>
>[exercise_id] => Array
>(
>[0] => 1
>[1] => 2
>[2] => 3
>)
>
>)
>
> )
>
>
>
> --
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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


Locale files No such file or directory error apparently causing speed issues.

2011-01-27 Thread #2Will
Hi Everyone,

Im getting quite slow speeds off a small site hosted on Media Temples
Grid service.  The Tech guys there say that my app (a basic cms) is
giving this error:

"There seem to be many failed stats for /app/locale/LC_MESSAGES. An
strace of the index.php shows ~216 failed calls for this directory and
files within it"

eg:

access("/nfs/c03/h01/mnt/45558/domains/soulstarvision.com/html/app/
locale//LC_MESSAGES/default.po", F_OK) = -1 ENOENT (No such file or
directory)

Why would cake throw this error? Im not sure where the guy is seeing
this as its not in cake's logs or the server error_log.

I notice the double // bit.  Im wondering if there shouls be something
like "eng" in there.  Am i barking at the wrong tree? If not, why is
"eng" missing.

There isn't anything in my /eng/LC_Messages dir anyway.

-- 
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 do you do.

2011-01-27 Thread Ryan Schmidt
On Jan 27, 2011, at 22:36, Raymond Chester wrote:

> how do you do.
> I have searched for cakePHP forum for some time, and found that this group is 
> the best place to discuss the things about cakePHP.
> I really appreciate for your idea of opening this group and for your trouble 
> to support this group.
> However I have one question about this group...
> Whenever I post  my article, it seems it should not be appeared before got 
> approved.
> I post questions for urgent matter, but article all time takes some time to 
> get approved, and it makes me so annoyed and anxious.
> Any better approach could not be made on this matter?

I think new users get moderated for awhile, to ensure they're not spammers, but 
then they get switched so they can post and have their messages appear 
immediately.


-- 
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 do you do.

2011-01-27 Thread Raymond Chester

how do you do.
I have searched for cakePHP forum for some time, and found that this 
group is the best place to discuss the things about cakePHP.
I really appreciate for your idea of opening this group and for your 
trouble to support this group.

However I have one question about this group...
Whenever I post  my article, it seems it should not be appeared before 
got approved.
I post questions for urgent matter, but article all time takes some time 
to get approved, and it makes me so annoyed and anxious.

Any better approach could not be made on this matter?
Best regards, Raymond.

--
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: New to cake and need advice

2011-01-27 Thread Ryan Schmidt

On Jan 27, 2011, at 11:50, newguy wrote:

> Am new to cake and php but  I have 5 - 6 years of coding experience in
> c/c++. I have basic php knowledge through w3schools, I am in doubt
> whether starting with cake is a good decision or not, am comfortable
> with MVC architecture and I really want to learn cake framework but my
> limited experience with php is making me ask for advice.

I'd recommend you go through some of the tutorials that are available. Watch 
some screencasts about building a basic CakePHP application (the blog app is a 
common one) and try to follow along, built your own app that does what they're 
doing. Try making small changes. The PHP documentation is pretty good at 
helping you learn how to use individual functions, once you get to something 
you need a PHP function for. And of course the CakePHP book is there as a 
reference for how CakePHP fits together.




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


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


Re: Connecting to a remote database via SSH

2011-01-27 Thread Jeremy Burns | Class Outfit
Dave - I got a perfect solution to this a few days ago from Zaky Katalan-Ezra. 
My challenge wasn't connecting to a remote db via SSH using a client (I use 
Sequel Pro) as that works great. What I wanted to do was to create a 
database.php configuration that would allow a local Cake app to connect to the 
remote db, which means that all (distributed) developers can develop and test 
against a single database.

For good measure, here is Zaky's response:

edit /etc/ssh/sshd_config on your local machine
Add:
AllowTcpForwarding yes
GatewayPorts yes

restart sshd

Edit my.cnf on remote machine.
Uncomment the following line.
bind-address   = 127.0.0.1
restart mysql

On you local machine run the following command
ssh -i e-keypair -f remoteu...@remote.com -N -L :localhost:3306
If you are not using ssh key you will be prompt for remote user assword

Edit database.php

var $default = array(
'driver' => 'mysqli',
'persistent' => false,
'host' => '127.0.0.1',
'port'=>,
'login' => 'user',
'password' => 'pass',
'database' => 'schema',
'prefix' => ''
);

Jeremy Burns
Class Outfit

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

On 27 Jan 2011, at 22:13, Dave Maharaj wrote:

> I just setup mySQL workbench on my local machine to connect to my  server / 
> sql database.
>  I do not want phpmyAdmin so I use this to administer my db’s.
>  It connects thru the ssh tunnel. Is that what your looking for? I did not 
> connect it to my localhost (my home machine) though so if that’s what you are 
> in need of I am unsure of that aspect but will follow this post to see if 
> anyone else does.
>  
> Dave
>  
> From: Jeremy Burns [mailto:jeremybu...@classoutfit.com] 
> Sent: Tuesday, January 25, 2011 4:02 PM
> To: cake-php@googlegroups.com
> Subject: Connecting to a remote database via SSH
>  
> Does anyone have any ideas for how to connect to a remote database via SSH? 
> It's a development thing so that people working remotely can develop against 
> the same database hosted on our virtual server.
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Is there any way to incldue all models automatically

2011-01-27 Thread euromark
believe me, you don't wanna do that...

what exactly is "I run to the model issue so many times"


On 28 Jan., 00:03, cake-learner  wrote:
> Is there any way to include all models by default. I run to the model
> issue so many times defining the relationship so i just want to join
> manually so i can cut some development time.

-- 
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 To Save A User Email after Logging In

2011-01-27 Thread tubiz
Presently i am using the Facebook Authentication Plugin by Webtechnik
but i have a problem i would like to store the email address of the
user into my database after the user has logged in. I have already set
the users details into a variable called facebook_user where I am
stuck now is how to save the user detials into the database after the
user has logged in. Thanks

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


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


css on top javascript on bottom $scripts_for_layout

2011-01-27 Thread skimmas
Hi.
Not that I'll die if I don't get a solution for this but it got me
curious.
I'm experimenting with creating plugins and $this->requestAction();
The thing is how can I make the css from that plugin being output on
the main layout $scripts_for_layout and not inside the plugin code?

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


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


save multiple related records

2011-01-27 Thread cake bake
is there any way to save multiple related records here is my code

function asign() {
$this->loadModel('UsersExercise');
if (!empty($this->data)) {
$this->UsersExercise->create();
if ($this->UsersExercise->save($this->data)) {
$this->Session->setFlash(__('The exercise could not be 
saved.
Please, try again.', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The exercise could 
not be saved.
Please, try again.', true));
}
}
$users = $this->Exercise->User->find('list');
$exercises = $this->Exercise->find('list');
$this->set(compact('users'));
$this->set(compact('exercises'));
}

Form->create('UsersExercise',array('url' => '/
exercises/asign'));?>


Form->input('user_id',array('type' =>
'select','multiple' => true,'options' => $users) );
echo $this->Form->input('exercise_id',array('type' =>
'select','multiple' => true,'options' => $exercises) );
?>

Form->end(__('Submit', true));?>



here is the debug for this->data

Array
(
[_Token] => Array
(
[key] => 3sss
[fields] => sss)

[UsersExercise] => Array
(
[user_id] => Array
(
[0] => 1
)

[exercise_id] => Array
(
[0] => 1
[1] => 2
[2] => 3
)

)

)



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


New to cake and need advice

2011-01-27 Thread newguy
Hi everyone
Am new to cake and php but  I have 5 - 6 years of coding experience in
c/c++. I have basic php knowledge through w3schools, I am in doubt
whether starting with cake is a good decision or not, am comfortable
with MVC architecture and I really want to learn cake framework but my
limited experience with php is making me ask for advice.

Thanks

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


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


Re: cache key not working

2011-01-27 Thread rkaiser

This is actually caused by a bug in the PCRE library on Centos / Red Hat. 
See this 
http://blog.echothis.com/2011/01/27/fixing-cakephp-1-3s-cache-key-error-on-red-hat-and-centos/
blog post  for how to fix it.
-- 
View this message in context: 
http://cakephp.19694.n2.nabble.com/cache-key-not-working-tp4960573p5967020.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


2 Col Layout / Jquery / JSON

2011-01-27 Thread Dave Maharaj
How can you update 2 div areas with 1 response?

 

Simple 2 col layout with side menu in col 1 main page content in col 2.
Click on menu loads the proper page in col 2, pretty standard straight
forward stuff. Now depending on the link I also want to change the content
under the side menu in col 1. But render outputs the main page content only
since that's what  the controller will pass back. Whats the best way to also
include the html for the other div?

 

If it was just static http calls I would just pop the data right in under
the menu, but since its ajax the menu side never changes except on a page
refresh.

 

Any ideas?

 

Thanks,

 

Dave

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


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


Is there any way to incldue all models automatically

2011-01-27 Thread cake-learner
Is there any way to include all models by default. I run to the model
issue so many times defining the relationship so i just want to join
manually so i can cut some development time.

-- 
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: HABTM echo value like standard relationship

2011-01-27 Thread Steve
So what does   give you as output ?

On Thu, 2011-01-27 at 14:20 -0800, OldWest wrote:
> And if I try this:
> 
> 
> foreach($plan['State'] as $state): 
>  echo $state[0]['title']; ?>
>  
> 
> 
> Then I get: Fatal error: Cannot use string offset as an array...
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and
> help others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/cake-php


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


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


Re: HABTM echo value like standard relationship

2011-01-27 Thread OldWest


Thank you for your assistance : ) I solved by doing this:

foreach($plan['Zip'] as $zip): 
echo $zip['title']; ?>


My recursion runs deep, so I did not realize I call the Zip table direct and 
run an innde foreach to parse the Zip array.

-- 
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: HABTM echo value like standard relationship

2011-01-27 Thread OldWest
And if I try this:

foreach($plan['State'] as $state): 
  echo $state[0]['title']; ?>
 

Then I get: *Fatal error*: Cannot use string offset as an array...

-- 
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: HABTM echo value like standard relationship

2011-01-27 Thread OldWest
Let me clarify the relationship a bit more. 

Plan model has state_id field. Each zip belongs to a state.

This inner foreach:
$i = 0;

 

Returns:

Array
(
[0] => Array
(
[id] => 1
[state_id] => 1
[title] => 97378
)

[1] => Array
(
[id] => 2
[state_id] => 1
[title] => 97128
)

-- 
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: Connecting to a remote database via SSH

2011-01-27 Thread Dave Maharaj
I just setup mySQL workbench on my local machine to connect to my  server /
sql database.

 I do not want phpmyAdmin so I use this to administer my db's.

 It connects thru the ssh tunnel. Is that what your looking for? I did not
connect it to my localhost (my home machine) though so if that's what you
are in need of I am unsure of that aspect but will follow this post to see
if anyone else does.

 

Dave

 

From: Jeremy Burns [mailto:jeremybu...@classoutfit.com] 
Sent: Tuesday, January 25, 2011 4:02 PM
To: cake-php@googlegroups.com
Subject: Connecting to a remote database via SSH

 

Does anyone have any ideas for how to connect to a remote database via SSH?
It's a development thing so that people working remotely can develop against
the same database hosted on our virtual server. 

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

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


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


Re: HABTM echo value like standard relationship

2011-01-27 Thread OldWest
Tried that. Did not work: *Notice* 
(8): 
Undefined index: title

-- 
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: Join Tables between db

2011-01-27 Thread Dave Maharaj
No I am not but I will certainly add that and give it a try.

I manually made my join model since it has custom validation rules so its
finding the file / model (not the autocreated one) since it validates /
returns errors on fail,  but never knew of the "with" so I will see how that
play out.

Thanks for the tip.


Dave
-Original Message-
From: ShadowCross [mailto:adri...@jps.net] 
Sent: Thursday, January 27, 2011 2:04 PM
To: CakePHP
Subject: Re: Join Tables between db

Dave:

Are you using the "with" key when you define your HABTM associations
in both sides of the model?  The "with" key forces CakePHP to use a
specific model for the joinTable instead of autocreating one

Example:


category.php:
class Category extends AppModel {
var $useDbConfig = 'resources';

var $hasAndBelongsToMany = array(
'Post' => array(
'className' => 'Post',
'joinTable' => 'categories_posts',
'with' => 'CategoryPost'
...
)
);
}

category_post.php:
class CategoryPost extends AppModel {
var $useDbConfig = 'default';

...
}

post.php:
class Post extends AppModel {
var $useDbConfig = 'default';

var $hasAndBelongsToMany = array(
'Category' => array(
'className' => 'Category',
'joinTable' => 'categories_posts',
'with' => 'CategoryPost'
...
)
);
...
}

See: http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM

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


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

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


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


Re: HABTM echo value like standard relationship

2011-01-27 Thread Tilen Majerle
Just use $state['title'] inside foreach xD

On Jan 27, 2011 10:59 PM, "OldWest"  wrote:

Hi Ratty,
I am working my way through that, but still cannot solve it. This is what I
have so far:

(inner foreach)

   
   

But I am getting error: *Fatal error*: Cannot use string offset as an array
in...



-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out th...

-- 
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: HABTM echo value like standard relationship

2011-01-27 Thread OldWest
Hi Ratty,
I am working my way through that, but still cannot solve it. This is what I 
have so far:

(inner foreach)


   

But I am getting error: *Fatal error*: Cannot use string offset as an array 
in...

-- 
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: HABTM echo value like standard relationship

2011-01-27 Thread Steve
Try doing 

 and it will show you all the array members.

On Thu, 2011-01-27 at 13:05 -0800, OldWest wrote:
> I might be missing the point on this, but I am trying to echo out a
> HABTM value in my index, and I cannot seem to get the data.
> 
> 
> For example, I can echo these relationships with no issue:
> 
> 
>  
> 
>  
> 
> 
> As you can see from the _id recursive relation on the Plan model.
> 
> 
> Hope my question is clear. Just not sure what to do on this. Can't
> seem to resolve it no matter the combination of vars I try.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and
> help others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/cake-php


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


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


HABTM echo value like standard relationship

2011-01-27 Thread OldWest
I might be missing the point on this, but I am trying to echo out a HABTM 
value in my index, and I cannot seem to get the data.

For example, I can echo these relationships with no issue:

 

 

As you can see from the _id recursive relation on the Plan model.

Hope my question is clear. Just not sure what to do on this. Can't seem to 
resolve it no matter the combination of vars I try.

-- 
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: Need advice for custom ACL

2011-01-27 Thread ShadowCross
Ernesto:

Some things to try:

For your first example: ignore some validation rules if the user has
"authorization X".
- validate the data from the controller, using the $options parameter
to specify which subset of the validation rules to apply.  There is a
(albeit simplistic) example in the Cookbook (http://book.cakephp.org/
view/1182/Validating-Data-from-the-Controller), where only a couple of
the fields are validated.  If you have multiple rules for a field, and
you want only some, not all, those rules checked on that field, you
can adjust rules array for that field in the Model's beforeValidate()
function (or an attached Behavior's beforeValidate()) -- the
$optionsparameter of Model::validates() is passed to the
Model::beforeValidate(), and only the 'fieldList' key is reserved.
Unfortunately, if you have to resort to the beforeValidate(), your
permissions logic will not be confined to your controller.
- if no errors, call the Model::save() or Model::saveAll(), but set
the validate parameter to false to avoid using the model's full
validation

=
For your second example: hide or modify some form fields if user
hasn't "authorization Y".
- in your controller, you can create an array of what authorizations
the user has and save that to a view variable.
- in your view, use that array to determine whether a form field
should be hidden or adjusted.

example:
foo_controller.php:

function edit($id = null) {
...
$aro = 'user/' . $this->Auth->user('id');

// Create list of authorizations that user has
$authorizations = array();
foreach(array('Bar/Y_1', 'Bar/Y_2', 'Bar/Y_3') as $aco) {
if ($this->Acl->check($aro, $aco) {
$authorizations[] = $aco;
}
}
$this->set(compact('authorizations'));
}

foo/edit.ctp:

...

if (in_array('Bar/Y_2', $authorizations)) {
echo $this->Form->input('fieldX1');
} else {
echo $this->Form->hidden('fieldX1');
}
if (in_array('Bar/Y_3', $authorizations)) {
echo $this->Form->input('fieldX2', array(
'options' => array('1', '2', '3')
));
} else {
echo $this->Form->input('fieldX2', array(
'options' => array('4', '5', '6')
));
}


Note that in Cake's built-in ACL, the ACO (Access Control Object)
nodes do not have to correspond to controllers or actions. ACO nodes
that correspond to actions is just one of the built-in behaviors.  You
can also define arbitrary ACO nodes.  To extend my example above, I
can have the following ACO nodes defined:

controllers/Foo/add
controllers/Foo/edit
controllers/Foo/index
controllers/Foo/view
Bar/Y_1
Bar/Y_2
Bar/Y_3

and in app_controller.php:

var $components = array('Auth' => array(
'authorize' => 'actions',
'actionPath' => 'controllers/'
));

Note the 'actionPath' AuthComponent variable; any ACO nodes NOT nested
under the 'controllers' (or whatever you specify as the actionPath)
node are ignored for the purposes of the "standard Cake ACL".  To
check permissions manually for everything else, you can use the
check($aro, $aco, $action = '*') function of the AclComponent.

There may be some advantages of using Cake's AclComponent in this way
instead of your custom CheckAuthorizations class, including:
- using existing tables (aros, acos, aros_acos, and not having to add
the authorizations and authorizations_users tables)
- "inheritance".  ARO nodes can refer to groups and/or users -- if a
UserX is part of GroupA and GroupA has access to AuthB, UserX also has
AuthB (unless access to AuthB is explicitly revoked from UserX.  And
if groups are defined as heirarchical (i.e. TreeBehavior), GroupA can
inherit access rights from it's parents and ancestors.  The same
applies to ACO nodes.  In fact, you *could*, in theory, define field-
level access in the following manner:

ARO:
Group 1 (all users)
Group 2 (admin)

ACO:
controllers/Foo/edit
controllers/Foo/edit/name
controllers/Foo/edit/fieldX1
controllers/Foo/edit/fieldX2

ARO/ACO:

// All users can access the edit page for Foo
$this->Acl->allow('Group 1', 'controllers/Foo/edit');

// Revoke access to fieldX1 and fieldX2 from the public at large
$this->Acl->deny('Group 1', 'controllers/Foo/edit/fieldX1');
$this->Acl->deny('Group 1', 'controllers/Foo/edit/fieldX2');

// Grant access to fieldX1 and fieldX2 to the admins
$this->Acl->allow('Group 2', 'controllers/Foo/edit/fieldX1');
$this->Acl->allow('Group 2', 'controllers/Foo/edit/fieldX1');

then adjust the controller and view to accommodate the results of 

Re: Join Tables between db

2011-01-27 Thread ShadowCross
Dave:

Are you using the "with" key when you define your HABTM associations
in both sides of the model?  The "with" key forces CakePHP to use a
specific model for the joinTable instead of autocreating one

Example:


category.php:
class Category extends AppModel {
var $useDbConfig = 'resources';

var $hasAndBelongsToMany = array(
'Post' => array(
'className' => 'Post',
'joinTable' => 'categories_posts',
'with' => 'CategoryPost'
...
)
);
}

category_post.php:
class CategoryPost extends AppModel {
var $useDbConfig = 'default';

...
}

post.php:
class Post extends AppModel {
var $useDbConfig = 'default';

var $hasAndBelongsToMany = array(
'Category' => array(
'className' => 'Category',
'joinTable' => 'categories_posts',
'with' => 'CategoryPost'
...
)
);
...
}

See: http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM

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

2011-01-27 Thread byqsri
Hi
Is someone that has integrated ExtJS with CAKEPHP?
Many Thanks
Marco

-- 
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: Reverse routing - not using the intended rule

2011-01-27 Thread cricket
On Wed, Jan 26, 2011 at 9:22 AM, r4zv4n  wrote:
>
> If I insert the link the correct way:
>
> $this->Html->link('Page Title',
>      array('controller' => 'pages', 'action' => 'view', 'page-
> slug'));
>
> I get site.com/pages/view/page-slug
>
> If I hardcode it:
>
> $this->Html->link('Page Title', '/page-slug/'));
>
> I get site.com/page-slug (the intended result).

That makes sense because you're essentially bypassing Router.

Try this:

Router::connect(
'/:slug',
array(
'controller' => 'pages',
'action' => 'view'
),
array(
'slug' => '[-a-z0-9]+',
'pass' => array('slug')
)
);

That should work, although it'll have to be the last route defined.
This assumes your slugs will be lowercase alphanumeric, plus hyphens.
The slug will be passed to the method as a param:

public function view($slug = null) { ... }

When you create the link, notice that you include the 'slug' option in
the same array as the controller & action (unlike in the route
definition).

echo $this->Html->link(
'foo',
array(
'controller' => 'pages',
'action' => 'view',
'slug' => $slug
),
array('title' => 'foo')
);

-- 
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: need help in javascript dropdown,

2011-01-27 Thread sanjib dhar
use $this->Form->input('citilist',array('options'=>$state_code_list)); in
cakephp.Save all cities in database and set variale
as 
state_code_list=$this->Cities->find('list',array('fields'=>array('Cities.cityID','Cities.city')));

On Thu, Jan 27, 2011 at 11:23 AM, andy_the ultimate baker <
anandghaywankar...@gmail.com> wrote:

> hi, good morning,
> i m working on project where i want create two drop down,
> in first i will choose "state" so that the next drop down should how
> the cities with respect to the state selected in first. all that i
> want to create in javascript,
>
> for that i have collected all state_code and its cities in variable.
> the variable name is given in following way
>
> var (state_code)_list = (citilist)
>
> i ave collected the sate and cities in one variable,
>
> please some suggest me the steps to be fallowed so that i can work on
> it.
>
> i m fresher in javascript.
>
> --
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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


Re: Need advice for custom ACL

2011-01-27 Thread Ernesto
the only alternative path i can see is to make hundreds of
controllers, each with his own specific model.
this will lead to hundreds of controllers.

Right now i'm acting this way:
- i use the standard Cake ACL to prevent unwanted page views.
- i added an "Authorization" model, with HABTM relationship to User
model (and vice-versa)
- i added a Vendor class named "CheckAuthorizations", loaded in both
AppController and AppModel's constructors. This class checks if
there's any coincidence between the current logged user and the
requested authorization code (authorization_id), by fetching data from
Authorizations_Users (the HABTM join model).
- Authorization request are done this way:
$this->CheckAuthorization->check([AUTHCODE])
or
$this->CheckAuthorization->require([AUTHCODE])

Any advice?

On 27 Gen, 13:57, Zaky Katalan-Ezra  wrote:
> In that case my honest advice to you is to revise your design.
>
> "If it's not simple it's should simply not" (In Hebrew it sounds better)

-- 
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 hide the cakephp .ctp extension

2011-01-27 Thread Ryan Schmidt

On Jan 27, 2011, at 03:58, balaji m wrote:

>i am new to cakephp . how can i install it and work it . i 
> use uniserver as a webserver in local.
> 
>please tell to me

Read the book, please. Come back if you have specific questions.

http://book.cakephp.org/



-- 
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 hide the cakephp .ctp extension

2011-01-27 Thread balaji m
hi


   i am new to cakephp . how can i install it and work it .
i use uniserver as a webserver in local.

   please tell to me

-- 
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: Need advice for custom ACL

2011-01-27 Thread Zaky Katalan-Ezra
In that case my honest advice to you is to revise your design.

"If it's not simple it's should simply not" (In Hebrew it sounds better)

-- 
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: Translating the scaffold flashes - it nearly can't be done the way they are formatted?! --psybear

2011-01-27 Thread Joshua Muheim
Thank you, Ryan. I know the "problem" of the 3 different "the" in
german. I'm from Switzerland... ;-)

Anyway, there are some workarounds you can take... e.g. instead of
using "Der/die/das Buch wurde gespeichert." you can simply use "Buch
wurde gespeichert.". Not that very nice, but all correct. But that's
only german - who knows what problems one is faced when a website
needs to be translated to many other languages?

Anyway, for my purposes the workaround above works out...

On Thu, Jan 27, 2011 at 12:57 PM, Ryan Schmidt
 wrote:
> On Jan 27, 2011, at 03:48, psybear83 wrote:
>
>> I want to translate the flash messages of $scaffold (I know, $scaffold
>> shouldn't be used, don't tell me this ;-) ).
>>
>> I looked through the code to find the msg-strings, and for deletion,
>> they look like this:
>>
>> $message = __(
>>  sprintf('The %1$s with id: %2$d has been deleted.',
>> Inflector::humanize($this->modelClass), $id),
>>  true
>> );
>>
>> Now, this seems very unthoughtful to me, because the sprintf() results
>> in strings like
>>
>> The Application with id: 1 has been deleted.
>> The Application with id: 2 has been deleted.
>> The Application with id: 3 has been deleted.
>>
>> which are absolutely not prepared for being translation! IMO only the
>> sprintf-string should be translated, and THEN the sprintf should be
>> run OVER this string!
>>
>>
>> $message = sprintf(
>>   __('The %1$s with id: %2$d has been deleted.', true),
>>   Inflector::humanize($this->modelClass), $id
>> );
>>
>> This way, only "The %1$s with id: %2$d has been deleted." must be
>> translated. Or even better (to also translate the model):
>>
>> $message = sprintf(
>>   __('The %1$s with id: %2$d has been deleted.', true),
>>   __(Inflector::humanize($this->modelClass), true), $id
>> );
>>
>> Do I miss an important point somewhere? Or why isn't it realized like
>> this?
>
> I would agree with what you said. The way the localization functions are used 
> in /cake/libs/controller/scaffold.php in CakePHP 1.3.6 seems all wrong.
>
> Since CakePHP 2.0 has changed (or will change) the usage of __() to 
> incorporate the usage of sprintf(), all calls to __() have already been (or 
> will hopefully soon be) touched in the CakePHP source. I checked scaffold.php 
> in the CakePHP 2.0 branch and this seems to be fixed there:
>
> https://github.com/cakephp/cakephp/blob/2.0/cake/libs/controller/scaffold.php
>
> However, I would further point out that even if the functions were called in 
> the correct order as you suggested above, a string like 'The %1$s' cannot be 
> accurately translated. Consider the language German, where there are three 
> different words for "the" depending on the gender of the noun (and it changes 
> again depending on where it's used in the sentence). Any time you have a noun 
> substituted into a string, you're going to have this problem, so that affects 
> a great many of the strings in scaffold.php that are marked for translation. 
> Strings like 'Invalid %s', 'The %1$s has been %2$s', 'There was an error 
> deleting the %1$s with id: %2$d' -- these all cannot be translated correctly.
>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
>

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


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


Re: Translating the scaffold flashes - it nearly can't be done the way they are formatted?! --psybear

2011-01-27 Thread Ryan Schmidt
On Jan 27, 2011, at 03:48, psybear83 wrote:

> I want to translate the flash messages of $scaffold (I know, $scaffold
> shouldn't be used, don't tell me this ;-) ).
> 
> I looked through the code to find the msg-strings, and for deletion,
> they look like this:
> 
> $message = __(
>  sprintf('The %1$s with id: %2$d has been deleted.',
> Inflector::humanize($this->modelClass), $id),
>  true
> );
> 
> Now, this seems very unthoughtful to me, because the sprintf() results
> in strings like
> 
> The Application with id: 1 has been deleted.
> The Application with id: 2 has been deleted.
> The Application with id: 3 has been deleted.
> 
> which are absolutely not prepared for being translation! IMO only the
> sprintf-string should be translated, and THEN the sprintf should be
> run OVER this string!
> 
> 
> $message = sprintf(
>   __('The %1$s with id: %2$d has been deleted.', true),
>   Inflector::humanize($this->modelClass), $id
> );
> 
> This way, only "The %1$s with id: %2$d has been deleted." must be
> translated. Or even better (to also translate the model):
> 
> $message = sprintf(
>   __('The %1$s with id: %2$d has been deleted.', true),
>   __(Inflector::humanize($this->modelClass), true), $id
> );
> 
> Do I miss an important point somewhere? Or why isn't it realized like
> this?

I would agree with what you said. The way the localization functions are used 
in /cake/libs/controller/scaffold.php in CakePHP 1.3.6 seems all wrong.

Since CakePHP 2.0 has changed (or will change) the usage of __() to incorporate 
the usage of sprintf(), all calls to __() have already been (or will hopefully 
soon be) touched in the CakePHP source. I checked scaffold.php in the CakePHP 
2.0 branch and this seems to be fixed there:

https://github.com/cakephp/cakephp/blob/2.0/cake/libs/controller/scaffold.php

However, I would further point out that even if the functions were called in 
the correct order as you suggested above, a string like 'The %1$s' cannot be 
accurately translated. Consider the language German, where there are three 
different words for "the" depending on the gender of the noun (and it changes 
again depending on where it's used in the sentence). Any time you have a noun 
substituted into a string, you're going to have this problem, so that affects a 
great many of the strings in scaffold.php that are marked for translation. 
Strings like 'Invalid %s', 'The %1$s has been %2$s', 'There was an error 
deleting the %1$s with id: %2$d' -- these all cannot be translated correctly.



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


Translating the scaffold flashes - it nearly can't be done the way they are formatted?! --psybear

2011-01-27 Thread psybear83
Hey everybody

I want to translate the flash messages of $scaffold (I know, $scaffold
shouldn't be used, don't tell me this ;-) ).

I looked through the code to find the msg-strings, and for deletion,
they look like this:

$message = __(
  sprintf('The %1$s with id: %2$d has been deleted.',
Inflector::humanize($this->modelClass), $id),
  true
);

Now, this seems very unthoughtful to me, because the sprintf() results
in strings like

The Application with id: 1 has been deleted.
The Application with id: 2 has been deleted.
The Application with id: 3 has been deleted.

which are absolutely not prepared for being translation! IMO only the
sprintf-string should be translated, and THEN the sprintf should be
run OVER this string!


$message = sprintf(
   __('The %1$s with id: %2$d has been deleted.', true),
   Inflector::humanize($this->modelClass), $id
);

This way, only "The %1$s with id: %2$d has been deleted." must be
translated. Or even better (to also translate the model):

$message = sprintf(
   __('The %1$s with id: %2$d has been deleted.', true),
   __(Inflector::humanize($this->modelClass), true), $id
);

Do I miss an important point somewhere? Or why isn't it realized like
this?

Thanks
Josh

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


Video : Tree Behavior & Jquery

2011-01-27 Thread Azril Nazli
URL : http://azrilnazli.blogspot.com/2011/01/video-cakephp-tree-behavior.html

In this video ( no audio narration ), I wrote a simple CMS that using
Tree Behavior .
- add data
- list data
- edit data
- delete data
- tree view

And to add some spice, I use jquery form validation. Maybe later I'll
record a video on how to use Jquery Tree with CakePHP Tree

Azril from Malaysia

-- 
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 1.3 and Firebird

2011-01-27 Thread rc


On Jan 27, 3:15 am, Alex Ciobanu  wrote:
> https://github.com/cakephp/datasources/blob/master/models/datasources...

Thanks! It would be nice if the comment in config/database.php
mentioned that some of the drivers are not included and the URL where
to get them, especially since the error message when specifying a non-
existent driver isn't all too clear either:

*Fatal error: Call to a member function isConnected() on a non-object
in /vol1/home/w3/public_html/cake/libs/view/pages/home.ctp on line 94*

Anyways, I'm glad you even have Firebird support at all, so I don't
want to complain.

-- 
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 hide the cakephp .ctp extension

2011-01-27 Thread Narendra Padala
thanks
On Thu, Jan 27, 2011 at 3:08 PM, Joshua Muheim  wrote:

> Hey Narendra
>
> I guess you are very new to CakePHP? .ctp extensions are never shown
> to the end user, they are only used by CakePHP internally.
>
> I guess you should take a look at the CakePHP book first...
> http://book.cakephp.org/view/1078/Views
>
> Have fun!
>
> On Thu, Jan 27, 2011 at 10:32 AM, Narendra Padala
>  wrote:
> > Hi...Flocks
> >
> >
> > Problem:
> > I have the following URLs for my website:
> >
> > www.example.com/services.ctp
> >
> > However, i would like to hide file extensions from the end users, and
> > allow them to access to the files using the following URLs:
> >
> > www.example.com/services
> >
> >
> > Can u please explain me, how can i do this.
> >
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> > Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
> >
> >
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> http://groups.google.com/group/cake-php
> >
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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


Re: How can i hide the cakephp .ctp extension

2011-01-27 Thread Joshua Muheim
Hey Narendra

I guess you are very new to CakePHP? .ctp extensions are never shown
to the end user, they are only used by CakePHP internally.

I guess you should take a look at the CakePHP book first...
http://book.cakephp.org/view/1078/Views

Have fun!

On Thu, Jan 27, 2011 at 10:32 AM, Narendra Padala
 wrote:
> Hi...Flocks
>
>
> Problem:
> I have the following URLs for my website:
>
> www.example.com/services.ctp
>
> However, i would like to hide file extensions from the end users, and
> allow them to access to the files using the following URLs:
>
> www.example.com/services
>
>
> Can u please explain me, how can i do this.
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
>

-- 
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 hide the cakephp .ctp extension

2011-01-27 Thread Narendra Padala
Hi...Flocks


Problem:
I have the following URLs for my website:

www.example.com/services.ctp

However, i would like to hide file extensions from the end users, and
allow them to access to the files using the following URLs:

www.example.com/services


Can u please explain me, how can i do this.

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


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


Re: How to get relative theme path?

2011-01-27 Thread Tilen Majerle
u need just 'themed/my_theme/' because if u use it with HtmlHelper, it
should work correctly :D

--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/1/26 raymond 

> Thanks for your fast reply, Tilen.
> But it just print "themed/my_theme/".
> If my app is located on http://localhost/myprj
> then I want to get a path like "myprj/themed/my_theme/"
>
> Any suggestion?
> Regards, Raymond.
>
> > $themePath = str_replace(VIEWS, '', App::themePath('my_theme'));
> > print $themePath //it will print "themed/my_theme/
>
> --
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

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


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