Re: HTML helper (Meta Icon) duplicating unnecessarily?

2011-05-05 Thread euromark
as far as i know thats in order to address all browsers (because some
stupid ones - i won't name any^^ - behave differently as the rest)

On 4 Mai, 22:47, Ross rcurry1...@googlemail.com wrote:
 Hi

 I just got started with CakePHP, and have the following in  my layout,
 between the head tags's as you'd expect:

 ?php echo $this-Html-meta('icon') . \t\n;   ?

 The output, however is:

 link href=/cakephp/myapp/favicon.ico type=image/x-icon
 rel=icon /
 link href=/cakephp/myapp/favicon.ico type=image/x-icon
 rel=shortcut icon /

 Now it's not the end of the world, and I know I can do it manually,
 but could someone please shed some light as to why this is repeated
 twice, with only shortcut added? It doesn't make a lot of sense to
 me.

 I have searched, but there didn't seem to be anything too recent that
 mentions this behavior. I am using a fresh copy of CakePHP 1.3.8.

 Regards

-- 
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: Set::extract on an array containing one element

2011-05-05 Thread Dr. Loboto
Understand difference between list and associative array. $list =
array($a, $b, $c) is list and have keys 0, 1, 2. $hash = array(1=$a,
2=$b, 3=$c) is associative array as have keys 1, 2, 3 - even if they
are numeric they are not properly ordered. If you add arbitrary value
to list as $list[12] = $d you turn it into associative array as it
have now keys 0, 1, 2, 12 - _not_ properly ordered numeric but
arbitrary ones.

On 4 май, 10:46, Gluckens danny30...@gmail.com wrote:
 Really?

 I was doing an extract on a previous combine which put the ID as the
 numeric key.
 But, switching it with a 0 and now everything seems to work.

 Still, it's strange that when I add another element with random key,
 it's now working.

 Anyway, I'll find an alternative for my ids.

 Thanks for the reply.

 On 4 mai, 08:01, Dr. Loboto drlob...@gmail.com wrote:







  Set::extract(/Some/thing, $data) assumes that you have true list -
  array with numeric keys 0, 1, 2, ... - but not an associative array
  with keys some, thing, ... or 4, 2, 15, ...

  If you call it as Set::extract(/Some/thing, array_values($data))
  when $data is associative array it will pass.

  On 3 май, 16:21, Gluckens danny30...@gmail.com wrote:

   Of course I know how to do it whithout the extract method.

   The point is, if the extract is not always working, it's not really
   usable cause you never know when it will break your things

   Someone points me to this ticket which could be 
   relatedhttp://cakephp.lighthouseapp.com/projects/42648/tickets/104-testpatch...

   But anyway, this fix would probably not be coming soon

   Seems like I'll need to rewrite large parts of code... ugh

   On 2 mai, 19:51, Otavio Martins Salomao otaviosalo...@gmail.com
   wrote:

u try this!
foreach($test as $element)
     $result = $element['Deep1']['Deep2']['extract'];

2011/5/2 Gluckens danny30...@gmail.com

 Hi everyone,

 I'm trying to extract data from an array containing only one element
 and it doesn't seem to work properly.
 Here's an example :

 Starting array
 $test = array(4 = array('Deep1' = array('data1' = 'nothing',
 'Deep2' = array('extract' = 1;
 Array
 (
    [4] = Array
        (
            [Deep1] = Array
                (
                    [data1] = nothing
                    [Deep2] = Array
                        (
                            [extract] = 1
                        )
                )
        )
 )

 Set::extract('/Deep1/Deep2[extract=1]', $test);
 NOT CORRECT
 Array
 (
 )

 But, when I add another element, let's say
 $test[12] = array();
 It works fine
 Set::extract('/Deep1/Deep2[extract=1]', $test);
 CORRECT
 Array
 (
    [0] = Array
        (
            [Deep2] = Array
                (
                    [extract] = 1
                )
        )
 )

 Am I using it properly?
 Thanks in advance for any help.

 --
 Our newest site for the community: CakePHP Video Tutorials
http://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 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: Set::extract on an array containing one element

2011-05-05 Thread Dr. Loboto
If you want extract, do Set::extract(), if you want combine, do
Set::combine(). I do not see sense in mixing them.

On 4 май, 13:21, Gluckens danny30...@gmail.com wrote:
 This lead me to another question.

 Is it possible to do a combine with default numeric key (0, 1, 2)

 I was doing something like this :
 $combine = Set::combine($result, '{n}.Data1.id', '{n}',
 '{n}.Data2.name');
 which return
 Array
 (
     [name1] = Array
         (
             [4] = Array
                 (
                     [some data] = some value
                 )
             [12] = Array
                 (
                     [some data] = some value
                 )
         )
 )

 But i'll like to get default numeric key instead of {n}.Data1.id
 Something like :
 Array
 (
     [name1] = Array
         (
             [0] = Array
                 (
                     [some data] = some values
                 )
             [1] = Array
                 (
                     [some data] = some values
                 )
         )
 )

 I know that at this point I could simply do a foreach, but it could be
 useful to know.
 Thanks in advance.

 On 4 mai, 10:46, Gluckens danny30...@gmail.com wrote:







  Really?

  I was doing an extract on a previous combine which put the ID as the
  numeric key.
  But, switching it with a 0 and now everything seems to work.

  Still, it's strange that when I add another element with random key,
  it's now working.

  Anyway, I'll find an alternative for my ids.

  Thanks for the reply.

  On 4 mai, 08:01, Dr. Loboto drlob...@gmail.com wrote:

   Set::extract(/Some/thing, $data) assumes that you have true list -
   array with numeric keys 0, 1, 2, ... - but not an associative array
   with keys some, thing, ... or 4, 2, 15, ...

   If you call it as Set::extract(/Some/thing, array_values($data))
   when $data is associative array it will pass.

   On 3 май, 16:21, Gluckens danny30...@gmail.com wrote:

Of course I know how to do it whithout the extract method.

The point is, if the extract is not always working, it's not really
usable cause you never know when it will break your things

Someone points me to this ticket which could be 
relatedhttp://cakephp.lighthouseapp.com/projects/42648/tickets/104-testpatch...

But anyway, this fix would probably not be coming soon

Seems like I'll need to rewrite large parts of code... ugh

On 2 mai, 19:51, Otavio Martins Salomao otaviosalo...@gmail.com
wrote:

 u try this!
 foreach($test as $element)
      $result = $element['Deep1']['Deep2']['extract'];

 2011/5/2 Gluckens danny30...@gmail.com

  Hi everyone,

  I'm trying to extract data from an array containing only one element
  and it doesn't seem to work properly.
  Here's an example :

  Starting array
  $test = array(4 = array('Deep1' = array('data1' = 'nothing',
  'Deep2' = array('extract' = 1;
  Array
  (
     [4] = Array
         (
             [Deep1] = Array
                 (
                     [data1] = nothing
                     [Deep2] = Array
                         (
                             [extract] = 1
                         )
                 )
         )
  )

  Set::extract('/Deep1/Deep2[extract=1]', $test);
  NOT CORRECT
  Array
  (
  )

  But, when I add another element, let's say
  $test[12] = array();
  It works fine
  Set::extract('/Deep1/Deep2[extract=1]', $test);
  CORRECT
  Array
  (
     [0] = Array
         (
             [Deep2] = Array
                 (
                     [extract] = 1
                 )
         )
  )

  Am I using it properly?
  Thanks in advance for any help.

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://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 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: HTML helper (Meta Icon) duplicating unnecessarily?

2011-05-05 Thread Ryan Schmidt

On May 4, 2011, at 15:47, Ross wrote:

 I just got started with CakePHP, and have the following in  my layout,
 between the head tags's as you'd expect:
 
 ?php echo $this-Html-meta('icon') . \t\n;   ?
 
 The output, however is:
 
 link href=/cakephp/myapp/favicon.ico type=image/x-icon
 rel=icon /
 link href=/cakephp/myapp/favicon.ico type=image/x-icon
 rel=shortcut icon /
 
 Now it's not the end of the world, and I know I can do it manually,
 but could someone please shed some light as to why this is repeated
 twice, with only shortcut added? It doesn't make a lot of sense to
 me.

Some browsers use link rel=icon. Some browsers use link rel=shortcut icon. To 
support all browsers, you must add both lines. That's why CakePHP adds both 
lines.



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

2011-05-05 Thread Ryan Schmidt

On May 4, 2011, at 21:14, sindhu.13 wrote:

 I want to view my news in view.ctp base on title not id,
 so if by id - newsses/view/3 if id is 3
 but i want make like - newsses/view/news_title if title is News
 Title
 
 so how do i make it.?.
 route, controller and view action

So you want to have URLs based on slugs instead of ids. Read about sluggable 
behavior:

http://bakery.cakephp.org/articles/mariano/2007/03/24/sluggable-behavior



-- 
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: PHP Newbie

2011-05-05 Thread Ryan Schmidt

On May 4, 2011, at 11:37, Chathu wrote:

 I'm new to php and final year IT student.we are developing Hospital
 management system.Can i do full system using Cakephp?

You can do anything you want.

 and also if any
 problem happen theres a support team ?

There's this Google group, which is populated by other CakePHP users, and some 
of the developers, and who may be able to help you with issues you encounter 
(or they may not).

I'm not sure if anybody offers more guaranteed paid support options for CakePHP.



-- 
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: HTML helper (Meta Icon) duplicating unnecessarily?

2011-05-05 Thread Ross
That makes sense! Thank you.

On May 5, 9:28 am, Ryan Schmidt google-2...@ryandesign.com wrote:
 On May 4, 2011, at 15:47, Ross wrote:









  I just got started with CakePHP, and have the following in  my layout,
  between the head tags's as you'd expect:

  ?php echo $this-Html-meta('icon') . \t\n;   ?

  The output, however is:

  link href=/cakephp/myapp/favicon.ico type=image/x-icon
  rel=icon /
  link href=/cakephp/myapp/favicon.ico type=image/x-icon
  rel=shortcut icon /

  Now it's not the end of the world, and I know I can do it manually,
  but could someone please shed some light as to why this is repeated
  twice, with only shortcut added? It doesn't make a lot of sense to
  me.

 Some browsers use link rel=icon. Some browsers use link rel=shortcut icon. To 
 support all browsers, you must add both lines. That's why CakePHP adds both 
 lines.

-- 
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: Cake dispatcher is synchronous?

2011-05-05 Thread ojonam
Hi Ryan and Mark,

thank you both for your responses. I am not specifically looking for 
multithreaded behavior, so I will stick for the PHP language (and hence 
Cake) for a bit more. 
For now, I am using the hack in Ryan's link, and it seems to work for now. I 
just call the function at the beginning of the books/getprice action. I 
suppose that when calling another action, the session will be restarted 
again, therefore not interfering with other parts of the application. Please 
correct me if this is wrong.

Cheers,
ojonam

-- 
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: Plugin and missing controller

2011-05-05 Thread Jeremy Burns | Class Outfit
Any clues? I'm stumped as this should all just work.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 4 May 2011, at 13:11, Jeremy Burns | Class Outfit wrote:

 Just to make sure that nothing else in my application was causing problems, I 
 have installed the plugin in a bare copy of Cake 1.3.8, and it still comes up 
 with the missing controller error. Any clues/guidance/advice?
 
 Jeremy Burns
 Class Outfit
 
 jeremybu...@classoutfit.com
 (t) +44 (0) 208 123 3822
 (m) +44 (0) 7973 481949
 Skype: jeremy_burns
 http://www.classoutfit.com
 
 On 4 May 2011, at 07:19, Jeremy Burns wrote:
 
 I have downloaded WebTechNick's PayPal plugin and copied the files
 into /app/plugins/paypal_ipn (exactly as per the instructions). I have
 amended /app/config/routes.php to include the routes for the plugin
 (these are copied straight from the installation instructions). As
 part of debugging this problem I have placed the routes at the top of
 the file. When I access http//:[mysite]/paypal_ipn I am getting a
 missing controller error:
 
 Error: PaypalIpnController could not be found.
 Error: Create the class PaypalIpnController below in file: app/
 controllers/paypal_ipn_controller.php
 
 I'm baffled as I have followed conventions yet this isn't working. I
 have other plugins working as expected.
 
 What am I doing wrong?
 
 -- 
 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: Help! CakePHP runs great in localhost but doesn't even shows up in remote Server ...

2011-05-05 Thread AD7six


On May 4, 6:28 pm, mi...@brightstorm.co.uk wrote:
  did anybody open a ticket for that yet?
  why it is not ROOT by default? because that would make sense after
  all :)

 but it is..

 from a fresh 1.3.7

         if (!defined('CAKE_CORE_INCLUDE_PATH')) {
                 define('CAKE_CORE_INCLUDE_PATH', ROOT);
         }

 not sure why yours isnt.

Because he used `cake bake` as all good bakers should

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

2011-05-05 Thread taq
?php
 //app::import('Model',array('Myprofile'));
Class MembersController extends AppController{
var $name = 'Members';   // 
var $helpers = array('Form');
var $components = array('Session');
var $uses = array('Member','Myprofile');
//var $scaffold;

   function register()
{
/// $Myprofile = new Myprofile();
if(!empty ($this-data)){
 $this-Member-create();
   //  $this-loadModel('Myprofile');
 $this-Myprofile-create();
 if($this-Member-save(($this-data['Member']['username']),($this-
data['Member']['password']))
 $this-Myprofile-save($this-data['Myprofile']
['name']))
  ($this-data['Myprofile']
['address']),
  ($this-data['Myprofile']
['phonenumber'])));
  {


 $this-Session-setFlash('success');
$this-redirect('index');


}
else

{

 $this-Session-setFlash('failed');
 }


I try to implement function that I bring someone But I can not call
myprofile model It took me three days to fix this problem. Then I
started discouraging.I just want to get the views of the seven
values​​ then divided. Members tables three , Myprofile tables four
values

-- 
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: Cake dispatcher is synchronous?

2011-05-05 Thread Ryan Schmidt

On May 5, 2011, at 03:55, ojonam wrote:

 For now, I am using the hack in Ryan's link, and it seems to work for now. I 
 just call the function at the beginning of the books/getprice action. I 
 suppose that when calling another action, the session will be restarted 
 again, therefore not interfering with other parts of the application. Please 
 correct me if this is wrong.

Correct, everything you do affects this request only, and has no influence over 
other requests. CakePHP will start the session at the beginning of every 
request (unless you tell it not to).




-- 
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: Containable make query data already retrieved

2011-05-05 Thread Elte Hupkes
I've recently had the same problems with Containable, it will execute
tons of queries for models that are directly related and could be
joined. Not only does this result in a query overhead; you also (in
some cases) lose the ability to apply conditions to the joined models,
very inconvenient. I cannot tell you how to solve it in a way that's
exactly clean, but I do think I might have a workaround for your case.

What I figured out is that this problem only seems to occur once you
go 'deeper' than one level in your contain (or at least it's a theory
I've seen confirmed in a couple of my own experiments). You can test
that by removing the City and Country associations from your
contain, I think you'll see that you suddenly have only one query
left.
I don't think you can avoid doing going this deep in your query though
if you need City and Country, you could query Student instead of
Registration and contain Registration to that, but I suppose you'd
have to contain CourseTracking and Course in that one and end up with
the same problem. You could perhaps establish a temporary direct
relation between Course, CourseTracking and Student without a
foreignKey, using presence of Registration as a join condition. Or the
other way around if you're querying Registration; establish a direct
relation between Registration and City/Country using
Student.country_id and Student.city_id as join conditions, since
you're sure they'll be there in this query.

All of this shouldn't be necessary and I certainly hope they'll solve
this in future versions, it's certainly a problem for those of us who
are looking to keep the number of queries to a minimum, and
especiallly for those who'll end up with slow results because they
don't look at the query log and think Cake will just get it right.

On May 4, 1:22 pm, jmn2k1 jmn...@gmail.com wrote:
 Hi,

 I need to make some report of my multiple associations, I tried with
 containable and was surprised as it resolve to bring all the data with
 the proper joins, however still do multiple queries for a model that
 is already joined.

 $params = array(
             'fields' = array(
                 'id', 'student_id', 'course_id',
 'registration_status_id',
                 'registration_course_status_id', 'progress'
             ),
             'contain' = array(
                 'Course' = array(
                     'fields' = array('id', 'title')
                 ),
                 'Student' = array(
                     'fields' = array('id', 'firstname', 'lastname'),
                     'City',
                     'Country'
                 ),
                 'CourseTracking' = array(
                     'fields' = array('started', 'finished')
                 )
             ),
             'conditions' = array(

             ),
             'order' = array('Student.lastname')
         );
 $this-Course-Registration-find('all', $params);

 I have the Registration model which is a link table between Course and
 Student, and the generated query is:

 SELECT `Registration`.`id`, `Registration`.`student_id`,
 `Registration`.`course_id`, `Registration`.`registration_status_id`,
 `Registration`.`registration_course_status_id`,
 `Registration`.`progress`, `CourseTracking`.`started`,
 `CourseTracking`.`finished`, `Course`.`id`, `Course`.`title`,
 `Student`.`id`, `Student`.`firstname`, `Student`.`lastname`,
 `Student`.`country_id`, `Student`.`city_id` FROM `registrations` AS
 `Registration` LEFT JOIN `courses` AS `Course` ON
 (`Registration`.`course_id` = `Course`.`id`) LEFT JOIN `students` AS
 `Student` ON (`Registration`.`student_id` = `Student`.`id`) LEFT JOIN
 `course_trackings` AS `CourseTracking` ON
 (`CourseTracking`.`registration_id` = `Registration`.`id`) WHERE
 course_id IN (1, 2) ORDER BY `Student`.`lastname` ASC

 Which have all the required data, however the sql dump show me one of
 the following queries for every registration:

 SELECT `Course`.`id`, `Course`.`title` FROM `courses` AS `Course`
 WHERE `Course`.`id` = 2

 The strange part is that Course and Student are associated exactly in
 the same way. Any hint on how to get rid of those queries?

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


How to inform the user of the loading progress of a page

2011-05-05 Thread heohni
Hi,

I have to make a query over many database entries and it takes a while
until the page is fully loaded and rendered with the results.

Is there a way to give the user somehow a 'Please wait while page is
loading'?
I know that javascript will not help, as the page loading is caused by
the server side...

But can cake help me somehow on the serverside?

Any ideas?

-- 
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: Two in one: Accented letters and partially active debug

2011-05-05 Thread Mariano C.
Data in DB is stored as latin_swedish_ci.

On 5 Mag, 00:13, euromark dereurom...@googlemail.com wrote:
 1) @ryan: the other way around. encoding of the DB is probably wrong
 (not utf8)

 2) globally: debug 0 - in this particular action:
 Configure::write('debug', 2);

 On 5 Mai, 00:02, Ryan Schmidt google-2...@ryandesign.com wrote:

  On May 4, 2011, at 16:55, Mariano C. wrote:

   1) when I insert data inside DB through a form, it will be stored as:
   This letters è is è and this l’ is an apostrophe 

   If I try to edit this text trough proper editing form, all of this
   strange characters will be represented in right way as: è and '.
   What can I do to proper echo the text even not in HTML form?

  Hard to know exactly what's happening without more info. One possibility is 
  that the data is being stored correctly as UTF-8, but then when you are 
  displaying it, you're on a page with encoding ISO-8859-1; the solution 
  would be to ensure your pages are using UTF-8 encoding.

   2) There's a way to active debug just in one method? How?

  What is active debug? What exactly are you trying to do?

-- 
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: Cake dispatcher is synchronous?

2011-05-05 Thread alaxos
Hi,

Just to add my two cents here, instead of closing the session in your
action code, another possibility to get your prices would be to get
them not one by one, but with only one Ajax request to whom you would
pass the necessary ids as parameters. Your action would then be called
only once and would perform only one query to the database (with the
SQL query containing something like 'WHERE id IN (1, 2, 17, ...)').
And you would obviously save 11 HTTP requests that can also take time
to initialize.

Cheers,
nIcO




On May 5, 10:55 am, ojonam manojo10...@gmail.com wrote:
 Hi Ryan and Mark,

 thank you both for your responses. I am not specifically looking for
 multithreaded behavior, so I will stick for the PHP language (and hence
 Cake) for a bit more.
 For now, I am using the hack in Ryan's link, and it seems to work for now. I
 just call the function at the beginning of the books/getprice action. I
 suppose that when calling another action, the session will be restarted
 again, therefore not interfering with other parts of the application. Please
 correct me if this is wrong.

 Cheers,
 ojonam

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


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


One question about installing the dev project to live server

2011-05-05 Thread heohni
Hi,

When I try to get my project online, I struggle with these 500 Server
Errors.

PHP Fatal error: CakePHP core could not be found. Check the value of
CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to
the directory containing your /cake core directory and your /vendors
root directory. in /srv/www/vhosts/my-domain/httpdocs/projectname/
webroot/index.php on line 78

in webrrot/index,php line 78 I have:
define('CAKE_CORE_INCLUDE_PATH', DS. 'srv' . DS . 'www' . DS .
'vhosts' . DS . 'my-domain' . DS . 'httpdocs' . DS . 'projectname');

But I still get the same error message.

My files are stored on the server

/projectname/
/projectname/config
/projectname/controllers

/projectname/vendors
/projectname/webroot


What means /cake core directory ?
Is this not my /projectname/ folder?

I am really lost at the moment
Please advice!

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


Cake PHP 1.3.7 Database Sessions- I'm Unable login?

2011-05-05 Thread GordonM81
I have updated my core.php to use 'database' sessions and can see upon
'login', the session row being written into the cake_session table.
However my session does not seem to authenticate and i get suck at a
login.ctp loop and therefore i am unable to access the restricted
views.

is there a bug with databse sessions/authenitcation in 1.3.7? Or am i
doing something wrong?

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


Rename DB Fields after Bake

2011-05-05 Thread vauneen
Hi,
i realised (after baking and much customisation) that i can use DB fields
called 'created' and 'modified' (as long as the are type Datetime and
default NULL) to get built in functionality to save 'created on date' and
'modified on date' saved to DB on add and edit. 
So i renamed my 2 fields to 'created' and 'modified' but the db values in
the fields remain NULL after adding and updating.
what have i missed? can one not rename DB fields after baking? 
(i did replace the old field names with the new ones in the views.)
any help would be appreciated
Vauneen

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Rename-DB-Fields-after-Bake-tp4372809p4372809.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: Rename DB Fields after Bake

2011-05-05 Thread Jeremy Burns | Class Outfit
Clear the files in /app/tmp/cache/models...

Jeremy Burns
Class Outfit

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

On 5 May 2011, at 14:38, vauneen wrote:

 Hi,
 i realised (after baking and much customisation) that i can use DB fields
 called 'created' and 'modified' (as long as the are type Datetime and
 default NULL) to get built in functionality to save 'created on date' and
 'modified on date' saved to DB on add and edit. 
 So i renamed my 2 fields to 'created' and 'modified' but the db values in
 the fields remain NULL after adding and updating.
 what have i missed? can one not rename DB fields after baking? 
 (i did replace the old field names with the new ones in the views.)
 any help would be appreciated
 Vauneen
 
 --
 View this message in context: 
 http://cakephp.1045679.n5.nabble.com/Rename-DB-Fields-after-Bake-tp4372809p4372809.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

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


Problems baking with 1.3.8 but 1.3.7 works fine

2011-05-05 Thread Emad
Hi all,

I am having trouble baking using 1.3.8. Below are the steps i was
taking. There seems to be include file issue. I then tried the same
with 1.3.7 and everything worked as expected.

Thanks,

Emad


--

vp2c01b-dhcp53:console emadnajeeb$ ./cake -app /Library/WebServer/
Documents/uap/downloads bake

Welcome to CakePHP v1.3.8 Console
---
App : /Library/WebServer/Documents/uap/downloads
Path: /Library/WebServer/Documents/uap//Library/WebServer/Documents/
uap/downloads
---
What is the full path for this app including the app directory name?
 Example:/Library/WebServer/Documents/uap//Library/WebServer/Documents/
uap/downloads/myapp
[/Library/WebServer/Documents/uap//Library/WebServer/Documents/uap/
downloads/myapp]  /Library/WebServer/Documents/uap/downloads
Bake Project
Skel Directory: /Library/WebServer/third-party/frameworks/cake/console/
templates/skel
Will be copied to: /Library/WebServer/Documents/uap/downloads
---
Look okay? (y/n/q)
[y]  y
Do you want verbose output? (y/n)
[n] 
---
Created: downloads in /Library/WebServer/Documents/uap/downloads
---

Creating file /Library/WebServer/Documents/uap/downloads/views/pages/
home.ctp
Wrote `/Library/WebServer/Documents/uap/downloads/views/pages/
home.ctp`
Welcome page created
Random hash key created for 'Security.salt'
Random seed created for 'Security.cipherSeed'
CAKE_CORE_INCLUDE_PATH set to /Library/WebServer/third-party/
frameworks in webroot/index.php
CAKE_CORE_INCLUDE_PATH set to /Library/WebServer/third-party/
frameworks in webroot/test.php
Remember to check these value after moving to production server
Your database configuration was not found. Take a moment to create
one.
---
Database Configuration:
---
Name:
[default] 
Driver: (db2/firebird/mssql/mysql/mysqli/odbc/oracle/postgres/sqlite/
sybase)
[mysql]  mysqli
Persistent Connection? (y/n)
[n] 
Database Host:
[localhost] 
Port?
[n] 
User:
[root] 
Password:
 test
Database Name:
[cake]  downloads
Table Prefix?
[n] 
Table encoding?
[n]  utf8

---
The following database configuration will be created:
---
Name: default
Driver:   mysqli
Persistent:   false
Host: localhost
User: root
Pass: 
Database: downloads
Encoding: utf8
---
Look okay? (y/n)
[y] 
Do you wish to add another database configuration?
[n] 

Creating file /Library/WebServer/Documents/uap/downloads/config/
database.php
Wrote `/Library/WebServer/Documents/uap/downloads/config/database.php`
vp2c01b-dhcp53:console emadnajeeb$ ./cake -app /Library/WebServer/
Documents/uap/downloads bake model


Welcome to CakePHP v1.3.8 Console
---
App : /Library/WebServer/Documents/uap/downloads
Path: /Library/WebServer/Documents/uap//Library/WebServer/Documents/
uap/downloads
---
PHP Warning:  include_once(/Library/WebServer/Documents/uap//Library/
WebServer/Documents/uap/downloads/config/database.php): failed to open
stream: No such file or directory in /Library/WebServer/third-party/
frameworks/cake-1.3.8/libs/model/connection_manager.php on line 23

Warning: include_once(/Library/WebServer/Documents/uap//Library/
WebServer/Documents/uap/downloads/config/database.php): failed to open
stream: No such file or directory in /Library/WebServer/third-party/
frameworks/cake-1.3.8/libs/model/connection_manager.php on line 23
PHP Warning:  include_once(): Failed opening '/Library/WebServer/
Documents/uap//Library/WebServer/Documents/uap/downloads/config/
database.php' for inclusion (include_path='.:/usr/lib/php') in /
Library/WebServer/third-party/frameworks/cake-1.3.8/libs/model/
connection_manager.php on line 23

Warning: include_once(): Failed opening '/Library/WebServer/Documents/
uap//Library/WebServer/Documents/uap/downloads/config/database.php'
for inclusion (include_path='.:/usr/lib/php') in /Library/WebServer/
third-party/frameworks/cake-1.3.8/libs/model/connection_manager.php on
line 23
---
Bake Model
Path: /Library/WebServer/Documents/uap//Library/WebServer/Documents/
uap/downloads/models/
---
---
Database Configuration:

Paginating HABTM related results

2011-05-05 Thread Dee Johnson
Hi guys, Im having a small issue here.  

I have a model1 that HABTM model2

before I send the results to the view via a set, I run a foreach loop grab 
the first bit of results and then another to get to the associated data.

the data array at that point (associated data only is  being sent to the 
view) looks like the following.

Array
(
[0] = Array
(
[data] = xxx
[data] = xx
[data] = xxx
[data] = 
[data] = 
[data] = xx
   
[jointable] = Array
(
[data] = x
[data] = xxx
[data] = 
)

)

[1] = Array

   (
[data] = xxx
[data] = xx
[data] = xxx
[data] = 
[data] = 
[data] = xx
   
[jointable] = Array
(
[data] = x
[data] = xxx
[data] = 
)

)

etc etc...so basically I am only brining back the associated model's info to 
the view...but how do i paginate this???  I already tried using 

$this-paginate('model', array( bla blabalbala during the original call

on the top of the controller I have var $paginate with some conditions

and in the $this-set I have $this-paginate($this-Model-associatedModel)

still no pagination on the view (and I have pagination on other pages with 
the same view code...how do i modify or what do i do in the controller to 
get this to paginate?

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: Two in one: Accented letters and partially active debug

2011-05-05 Thread euromark
exactly
utf8_unicode_ci, utf8 in database.php and utf-8 for the complete
project (inluding files) and everything is fine

On 5 Mai, 14:07, Mariano C. mariano.calan...@gmail.com wrote:
 Data in DB is stored as latin_swedish_ci.

 On 5 Mag, 00:13, euromark dereurom...@googlemail.com wrote:







  1) @ryan: the other way around. encoding of the DB is probably wrong
  (not utf8)

  2) globally: debug 0 - in this particular action:
  Configure::write('debug', 2);

  On 5 Mai, 00:02, Ryan Schmidt google-2...@ryandesign.com wrote:

   On May 4, 2011, at 16:55, Mariano C. wrote:

1) when I insert data inside DB through a form, it will be stored as:
This letters è is è and this l’ is an apostrophe 

If I try to edit this text trough proper editing form, all of this
strange characters will be represented in right way as: è and '.
What can I do to proper echo the text even not in HTML form?

   Hard to know exactly what's happening without more info. One possibility 
   is that the data is being stored correctly as UTF-8, but then when you 
   are displaying it, you're on a page with encoding ISO-8859-1; the 
   solution would be to ensure your pages are using UTF-8 encoding.

2) There's a way to active debug just in one method? How?

   What is active debug? What exactly are you trying to do?

-- 
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: should teacher and student stay together???

2011-05-05 Thread Tan Cheng
Thanks for everyone's help. great informations, learned a lot.

On May 2, 11:29 am, philp pome...@free.fr wrote:
 Hi there,

 you could also use this behavior:

 https://github.com/Theaxiom/Polymorphic2.0

 On 29 avr, 17:28, Tan Cheng davidtan...@gmail.com wrote:







 so there is a HABTM relationship between students and teachers.

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

2011-05-05 Thread dreamingmind
Your -save() parameters are wrong. You need to pass your data in as
an array.

You should just be able to say:
$this-Myprofile-save($this-data);
and
$this-Member-save($this-data);
Possibly you could even do -saveall() since your data array appears
to be constructed properly.

http://book.cakephp.org/view/1031/Saving-Your-Data#!/view/1031/Saving-Your-Data

Don


On May 5, 2:05 am, taq taqman...@gmail.com wrote:
 ?php
  //app::import('Model',array('Myprofile'));
 Class MembersController extends AppController{
     var $name = 'Members';   // 
     var $helpers = array('Form');
     var $components = array('Session');
     var $uses = array('Member','Myprofile');
     //var $scaffold;

    function register()
     {
         /// $Myprofile = new Myprofile();
         if(!empty ($this-data)){
          $this-Member-create();
    //  $this-loadModel('Myprofile');
      $this-Myprofile-create();
      
 if($this-Member-save(($this-data['Member']['username']),($this-data['Member']['password']))

              $this-Myprofile-save($this-data['Myprofile']
 ['name']))
                                       ($this-data['Myprofile']
 ['address']),
                                       ($this-data['Myprofile']
 ['phonenumber'])));
               {

          $this-Session-setFlash('success');
                     $this-redirect('index');

             }
             else

             {

              $this-Session-setFlash('failed');
              }

 I try to implement function that I bring someone But I can not call
 myprofile model It took me three days to fix this problem. Then I
 started discouraging.I just want to get the views of the seven
 values​​ then divided. Members tables three , Myprofile tables four
 values

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

2011-05-05 Thread dreamingmind
To be a little more clear about your problem, look at this small part
of your code:
$this-Member-save(
  ($this-data['Member']['username']),
  ($this-data['Member']['password'])
)
In this snippet you are passing two strings as parameters. Those array
elements you name each contain strings that came from the  form
$_Post. If this isn't clear, your going to have to read a little more
about php arrays to get a little clearer understanding.
http://us.php.net/manual/en/book.array.php

$this-data is a properly structured cakePHP data array. I assume
you've used the Form Helper (smart move). That pretty much insures
that you get back an array you can use in your saves with no other
processing.

Don

On May 5, 2:05 am, taq taqman...@gmail.com wrote:
 ?php
  //app::import('Model',array('Myprofile'));
 Class MembersController extends AppController{
     var $name = 'Members';   // 
     var $helpers = array('Form');
     var $components = array('Session');
     var $uses = array('Member','Myprofile');
     //var $scaffold;

    function register()
     {
         /// $Myprofile = new Myprofile();
         if(!empty ($this-data)){
          $this-Member-create();
    //  $this-loadModel('Myprofile');
      $this-Myprofile-create();
      
 if($this-Member-save(($this-data['Member']['username']),($this-data['Member']['password']))

              $this-Myprofile-save($this-data['Myprofile']
 ['name']))
                                       ($this-data['Myprofile']
 ['address']),
                                       ($this-data['Myprofile']
 ['phonenumber'])));
               {

          $this-Session-setFlash('success');
                     $this-redirect('index');

             }
             else

             {

              $this-Session-setFlash('failed');
              }

 I try to implement function that I bring someone But I can not call
 myprofile model It took me three days to fix this problem. Then I
 started discouraging.I just want to get the views of the seven
 values​​ then divided. Members tables three , Myprofile tables four
 values

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


strange behavior when action is Auth-allow(ed)

2011-05-05 Thread Mariano C.
I've followed your guide to auth: 
http://book.cakephp.org/view/1250/Authentication
This is my app_controller.php:

class AppController extends Controller {
var $components = array('DebugKit.Toolbar', 'Session', 'Auth');
var $helpers = array('Html','Javascript',  'Session', 'Ajax',
'Facebook.Facebook');

function beforeFilter()
{
// importa modello Season
$this-Season = ClassRegistry::init('Season');

// ricava la variabile di sessione
$id = $this-Session-read('editable_season_id');

// verifica se tale id è esistente
$exist = $this-Season-exist($id);

// se non esiste o è un valore non valido o è nullo
if((is_null($id)) || (!is_numeric($id) || (!$exist)))
{
// cerca l'id della stagione più recente
$id = $this-Season-getLastSeasonId();

// se esiste assegnalo ad una var di sessione
if($id)
{
$this-Session-write(editable_season_id, $id);
$title = $this-Season-getSeasonName($id);
$this-Session-write(editable_season_title,
$title);
$this-redirect($this-referer());
} else { // altrimenti lancia errore
$seasons = $this-Season-getSeasons();
$this-cakeError('defaultSesonNotFound',
array('seasons' = $seasons));
}
}
 }
}

It works correctly. Now if inside a controller there's an action and i
want to make it public i override beforeFilter method:
function beforeFilter()
{
parent::beforeFilter();
$this-Auth-allow(array('showTables'));
}



When i call http://./showTables/season_id:1 for the first time I
will be redirect to the login page. Now if I rewrite 
http://./showTables/season_id:1
for the second time the action will be showed (without insert user and
password).

Why this strange behavior?

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


$this-Time-nice() l10n in hrv (croatian)

2011-05-05 Thread Salines
Hi, BoysGirls,

I have small problem using $this-Time-nice('2011-04-01 18:00')
return me pet, tra 1st 2011, 18:00 ;

Is you see '1st', i don't need that format :)

I need result  in following format: pet, 1 tra 2011, 18:00, where 
how  can I do? :)

Thx

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


Only show data which isn't in the other table. (complex).

2011-05-05 Thread Dwayne Hanekamp
Hey all,

I'm currently building a webapplication on which people fill in
surveys. My problem currently: I want surveys which are already filled
in to show up grey. I have two database tables: Surveys / SurveysUsers
in the first one are all the available surveys. In the second are all
records about surveys which users filled in. My problem currently:
Combining both tables with eachother to filter out the surveys which
the current user already filled in.
I've tried to search an answer for it but its kinda complex to google
something like this. I hope you guys can help me out!

Cheers,

Dwayne

-- 
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: $this-Time-nice() l10n in hrv (croatian)

2011-05-05 Thread Salines

EDIT:
On 5 svi, 23:10, Salines nikola.parad...@gmail.com wrote:
 Hi, BoysGirls,

 I have small problem using $this-Time-nice('2011-04-01 18:00')
 return me pet, tra 1st 2011, 18:00 ;

*** As you see '1st', i don't need that format :)

 I need result  in following format: pet, 1 tra 2011, 18:00, where 
 how  can I do? :)

 Thx

-- 
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: Testing the Datasource

2011-05-05 Thread Philip Burrows
Any good tutorials on how to write schema for datasources? I can't
find any. Do I even need to write the schema or can I leave the
define() method blank?

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

2011-05-05 Thread Dwayne Hanekamp
Currently in your controller you are searching with the findById i
guess.
U simply change that to findByTitle and use Str_Replace to change
spaces
into underscores.

Hope that helps you!

On 5 mei, 04:14, sindhu.13 bsind...@gmail.com wrote:
 helo, i'm newbie in cakephp...
 my problem is,
 I want to view my news in view.ctp base on title not id,
 so if by id - newsses/view/3 if id is 3
 but i want make like - newsses/view/news_title if title is News
 Title

 so how do i make it.?.
 route, controller and view action

 thank's

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


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


Re: Problems baking with 1.3.8 but 1.3.7 works fine

2011-05-05 Thread mike karthauser
We hit the same issue today. It's due to the --app parameter not working in the 
bake script. A fix can be found on git hub which you can patch or just revert 
to 1.3.7 and wait for the official fix release. 


Mike Karthauser
Brightstorm limited
Tel: 07939252144

On 5 May 2011, at 18:47, Emad emad.naj...@gmail.com wrote:

 Hi all,
 
 I am having trouble baking using 1.3.8. Below are the steps i was
 taking. There seems to be include file issue. I then tried the same
 with 1.3.7 and everything worked as expected.
 
 Thanks,
 
 Emad
 
 
 --
 
 vp2c01b-dhcp53:console emadnajeeb$ ./cake -app /Library/WebServer/
 Documents/uap/downloads bake
 
 Welcome to CakePHP v1.3.8 Console
 ---
 App : /Library/WebServer/Documents/uap/downloads
 Path: /Library/WebServer/Documents/uap//Library/WebServer/Documents/
 uap/downloads
 ---
 What is the full path for this app including the app directory name?
 Example:/Library/WebServer/Documents/uap//Library/WebServer/Documents/
 uap/downloads/myapp
 [/Library/WebServer/Documents/uap//Library/WebServer/Documents/uap/
 downloads/myapp]  /Library/WebServer/Documents/uap/downloads
 Bake Project
 Skel Directory: /Library/WebServer/third-party/frameworks/cake/console/
 templates/skel
 Will be copied to: /Library/WebServer/Documents/uap/downloads
 ---
 Look okay? (y/n/q)
 [y]  y
 Do you want verbose output? (y/n)
 [n] 
 ---
 Created: downloads in /Library/WebServer/Documents/uap/downloads
 ---
 
 Creating file /Library/WebServer/Documents/uap/downloads/views/pages/
 home.ctp
 Wrote `/Library/WebServer/Documents/uap/downloads/views/pages/
 home.ctp`
 Welcome page created
 Random hash key created for 'Security.salt'
 Random seed created for 'Security.cipherSeed'
 CAKE_CORE_INCLUDE_PATH set to /Library/WebServer/third-party/
 frameworks in webroot/index.php
 CAKE_CORE_INCLUDE_PATH set to /Library/WebServer/third-party/
 frameworks in webroot/test.php
 Remember to check these value after moving to production server
 Your database configuration was not found. Take a moment to create
 one.
 ---
 Database Configuration:
 ---
 Name:
 [default] 
 Driver: (db2/firebird/mssql/mysql/mysqli/odbc/oracle/postgres/sqlite/
 sybase)
 [mysql]  mysqli
 Persistent Connection? (y/n)
 [n] 
 Database Host:
 [localhost] 
 Port?
 [n] 
 User:
 [root] 
 Password:
 test
 Database Name:
 [cake]  downloads
 Table Prefix?
 [n] 
 Table encoding?
 [n]  utf8
 
 ---
 The following database configuration will be created:
 ---
 Name: default
 Driver:   mysqli
 Persistent:   false
 Host: localhost
 User: root
 Pass: 
 Database: downloads
 Encoding: utf8
 ---
 Look okay? (y/n)
 [y] 
 Do you wish to add another database configuration?
 [n] 
 
 Creating file /Library/WebServer/Documents/uap/downloads/config/
 database.php
 Wrote `/Library/WebServer/Documents/uap/downloads/config/database.php`
 vp2c01b-dhcp53:console emadnajeeb$ ./cake -app /Library/WebServer/
 Documents/uap/downloads bake model
 
 
 Welcome to CakePHP v1.3.8 Console
 ---
 App : /Library/WebServer/Documents/uap/downloads
 Path: /Library/WebServer/Documents/uap//Library/WebServer/Documents/
 uap/downloads
 ---
 PHP Warning:  include_once(/Library/WebServer/Documents/uap//Library/
 WebServer/Documents/uap/downloads/config/database.php): failed to open
 stream: No such file or directory in /Library/WebServer/third-party/
 frameworks/cake-1.3.8/libs/model/connection_manager.php on line 23
 
 Warning: include_once(/Library/WebServer/Documents/uap//Library/
 WebServer/Documents/uap/downloads/config/database.php): failed to open
 stream: No such file or directory in /Library/WebServer/third-party/
 frameworks/cake-1.3.8/libs/model/connection_manager.php on line 23
 PHP Warning:  include_once(): Failed opening '/Library/WebServer/
 Documents/uap//Library/WebServer/Documents/uap/downloads/config/
 database.php' for inclusion (include_path='.:/usr/lib/php') in /
 Library/WebServer/third-party/frameworks/cake-1.3.8/libs/model/
 connection_manager.php on line 23
 
 Warning: include_once(): Failed opening '/Library/WebServer/Documents/
 uap//Library/WebServer/Documents/uap/downloads/config/database.php'
 for inclusion 

Re: ACL issue

2011-05-05 Thread dreamingmind
Felix,

I'm not aware of anything that would prevent a User from having
several connections into the aros table. You have three fields in aros
that can potentially play a role in connecting a user to an aros node:
alias
model
foreign_key

If you had a president that was User.id=12, you could easily have
several records that read Aros.model='User' Aros.foreign_key=12 and
that were each children of different aros parents (or you could use
alias to do the job). Once could be a child of President, another the
child of Instructor/Theory.

Each child would have different acos permissions and your
authentication check would just have to look out for the multiple
permissions.

So let's say you set alia to a concatenation of model and id like some
of the tutorials do, your aros tree could look like this:

 Overlord (a master account)
- Committee
- President
- User::12
- Treasurer
- etc.
- Instructors
- Practical
- Theory
- User::12
- Trainees

Regards,
Don

On May 4, 2:35 pm, Felix fe...@felixfennell.co.uk wrote:
 Hello everyone,

 I have a query regarding how to structure the ACL system in my app.

 Basically i'm creating a management app for a diving club. The club
 has three broad groups,

 - Instructors
 - Trainees
 - Committee

 The ACL tree looks like this at the moment

 - Sebastian (name of site)
  Overlord (a master account)
 - Committee
 - President
 - Treasurer
 - etc.
 - Instructors
 - Practical
 - Theory
 - Trainees

 Each position above is a group (name, description) which have many to
 one relationships with a user (username, password, name).

 The above system works fine except for one problem. Committee members
 are always either an instructor or trainee, therefore they need to be
 assigned to two groups (instructor/trainee AND the relevant committee
 position).

 Basically I need to place a user into two levels in the tree which
 aren't related to each other hierarchically.

 As far as I know this isn't possible with Cake's ACL component unless
 theres something I've missed. I know the relationship between groups
 -- users needs changing to a HABTM relationship but I'm unsure how ACL
 treats these.

 Has anyone come across this sort of problem before and able to outline
 their solution, or have I been an idiot and missed something really
 obvious.

 Sorry for such a long message, I didn't want to miss anything out -
 thanks in advance,

 --Felix Fennell

-- 
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: Only show data which isn't in the other table. (complex).

2011-05-05 Thread dreamingmind
Dwayne,

One simple way you could do this:

Query Surveys to get the full set of possibles.
Query SurveysUsers to get the completed set for the user.

As you output the choices to the web page, loop through the full set
array and check each one to see if it also exists in the completed set
array. If yes, make grey. If no, make link (or whatever).

Regards,
Don

On May 5, 2:15 pm, Dwayne Hanekamp dwaynehanek...@gmail.com wrote:
 Hey all,

 I'm currently building a webapplication on which people fill in
 surveys. My problem currently: I want surveys which are already filled
 in to show up grey. I have two database tables: Surveys / SurveysUsers
 in the first one are all the available surveys. In the second are all
 records about surveys which users filled in. My problem currently:
 Combining both tables with eachother to filter out the surveys which
 the current user already filled in.
 I've tried to search an answer for it but its kinda complex to google
 something like this. I hope you guys can help me out!

 Cheers,

 Dwayne

-- 
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: accessing a function in a custom datasource, from the model

2011-05-05 Thread dreamingmind
flowctrl,

I don't know about datasources specifically but I know generally about
your problem. Possibly this example will put you on the path.

I wanted to modify a behavior I had connected to some models, call it
niceBehavior. So my models had this:
var $actsAs = array('niceBehavior');

and my new class is called fixNiceBehavior. It is like your example:
Class fixNiceBehavior Extends NiceBehavior {
//methods here
}

If run things now, any functions in my new class will throw the errors
you describe. But if I change my models to read:
var $actsAs = array('fixNiceBehavior');

I'll have BOTH classes and their properties and methods available
through fixNiceBehavior. So, if niceBehavior-do_magic() was a method;
because fixNiceBehavior extends niceBehavior, fixNiceBehavior-
do_magic() is 'magically' available along with all my other newly
written properties and methods.

Other times, you'll have to break out the big guns to load your class.
App::import() will do that for you.
http://book.cakephp.org/view/1031/Saving-Your-Data#!/view/933/The-App-Class

Regards,
Don

On May 4, 4:21 pm, flowctrl flowc...@gmail.com wrote:
 Hello,

 In CakePHP 1.3, how do I use a function in a custom datasource, from a
 model that uses that datasource?

 My custom datasource works for regular queries, but I want to extend
 the default find method to include a new parameter. In app/models/
 datasources/foofiles_source.php I have a function to find video files
 on the filesystem. For testing, it is:

 class FoofilesSource extends DataSource {

public function find_videos($videoQuery) {
  return(array(This is in the foo_files datasource!,
 w00t!));
}
 …

 In the FooFiles model, I have:

function find($type, $options = array()) {
   switch($type) {
  case videos:
 $this-find_videos($options);
 break;

  default:
 return parent::find($type, $options);
 break;
   }
}

 However, $this-find_videos($options) produces a fatal error:
 Fatal error: Call to undefined method FoofilesSource::query() in cake/
 libs/model/model.php on line 502

 If I use FoofilesSource::find_videos($options) instead, I get the
 error:
 Fatal error: Class 'FooFilesSource' not found in app/models/
 foo_files.php on line 11

 How do I invoke a function in the datasource, from a model?

 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: How to inform the user of the loading progress of a page

2011-05-05 Thread dreamingmind
Maybe javascript *could* help. If you sent the user to a simple
'Please wait' page with a nice, animated smoking cigarette... and that
page sends an ajax request for the heavy lifting to proceed. When the
process succeeds, rewrite the page content.

Don

On May 5, 3:53 am, heohni heidi.anselstet...@consultingteam.de
wrote:
 Hi,

 I have to make a query over many database entries and it takes a while
 until the page is fully loaded and rendered with the results.

 Is there a way to give the user somehow a 'Please wait while page is
 loading'?
 I know that javascript will not help, as the page loading is caused by
 the server side...

 But can cake help me somehow on the serverside?

 Any ideas?

-- 
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: Haveing a basic understanding problem regarding media views

2011-05-05 Thread dreamingmind
heidi,

The message seems pretty clear, the folder you're requesting does not
exist. But what's wrong with your request. It's a bit mysterious
because your code looks like sample values and the message looks like
a real message. The path named in the message doesn't remotely look
like something you'd get when running your code.

You'd expect '/DTAfiles/something.something  was onto found on the
server'. So, where is this 'members/download' path coming from? You
could search your code or data tables to figure out what is creating
the path 'members/download/...'

I can see one error in your code though. Your 'path' parameter should
not have the file name stuck on the end of it. See the examples:
http://book.cakephp.org/view/1094/Media-Views

Regards,
Don

On May 4, 1:25 am, heohni heidi.anselstet...@consultingteam.de
wrote:
 hi,

 I have an action to create a txt file and write stuff into.
 Then I redirect to another action, where I have a simple template with
 a download button.
 On click, I would like to download the txt file, the name of the file
 I pass within the url to the download function.

 function download(){
         $this-view = 'Media';
         $params = array(
               'id' = $this-params['named']['do'].'.txt',
               'name' = 'example',
               'extension' = 'txt',
               'mimeType' = array('txt' = 'text/plain'),   // extends
 internal list of mimeTypes
               'path' = WWW_ROOT.'/DTAfiles/'.$this-params['named']
 ['do'].'.txt'
        );
        $this-set($params);

 }

 But I get the message
 Not Found
 Error: The requested address '/members/download/040520111017' was not
 found on this server.

 I dont understand why this isn't working, what do I do wrong?

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


TDD in CakePHP

2011-05-05 Thread Santiago Basulto
Hello people.

Does anyone do TDD in Cake? Do you have any recommendation or
something helpful to start with this practice?

Thanks.

-- 
Santiago Basulto.-

-- 
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: mp3 player in flash

2011-05-05 Thread Kane The Pirate


On 3 maio, 23:24, Sam Sherlock sam.sherl...@gmail.com wrote:
 perhaps its due to cakes use of mod rewrite

 if so I suggest using firebug's net tab to see the urls of the mp3's being
 loaded
 then firgure out a way to ensure the your app has correct urls consistently

 are you using absolute paths to the mp3s within your xml file or as params
 passed to swfobject?

 I pass a basePath to swfobjects in cake apps and use this within
 actionscript to get easy abs paths
 then it does not matter is the app is in subdir or not the actionscript does
 not need to be recoded

  - S

 On 4 May 2011 02:47, Kane The Pirate kanethepir...@gmail.com wrote:

  Its workin now! but just in my index page, and only if I access my url
  without any slashes after the index.
  ex: localhost/cake/artist - this works
  ex: localhost/cake/artist/ - this doesn't work
  ex: localhost/cake/artist/detailView/12 - doesn't work.

  I'm trying to understand. I used the router to see if there are
  differences, but there is none difference between the index and other
  pages.

  I'm just using swfobject for cakephp.

  Thanks.

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

I'm passing by params.
something like webroot/music/myfile.mp3.


in index show me the following url:
localhost/cake/artist/webroot/music/myfile.mp3

in other shows this:
localhost/cake/artist/detailview/1/webroot/music/myfile.mp3

However in my index it run, in my detailview not.

I tought if is better to change the route, or put my files outside
webroot.

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: mp3 player in flash

2011-05-05 Thread Kane The Pirate


On 3 maio, 23:24, Sam Sherlock sam.sherl...@gmail.com wrote:
 perhaps its due to cakes use of mod rewrite

 if so I suggest using firebug's net tab to see the urls of the mp3's being
 loaded
 then firgure out a way to ensure the your app has correct urls consistently

 are you using absolute paths to the mp3s within your xml file or as params
 passed to swfobject?

 I pass a basePath to swfobjects in cake apps and use this within
 actionscript to get easy abs paths
 then it does not matter is the app is in subdir or not the actionscript does
 not need to be recoded

  - S

 On 4 May 2011 02:47, Kane The Pirate kanethepir...@gmail.com wrote:

  Its workin now! but just in my index page, and only if I access my url
  without any slashes after the index.
  ex: localhost/cake/artist - this works
  ex: localhost/cake/artist/ - this doesn't work
  ex: localhost/cake/artist/detailView/12 - doesn't work.

  I'm trying to understand. I used the router to see if there are
  differences, but there is none difference between the index and other
  pages.

  I'm just using swfobject for cakephp.

  Thanks.

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

I'm passing by params.
something like webroot/music/myfile.mp3.


in index show me the following url:
localhost/cake/artist/webroot/music/myfile.mp3

in other shows this:
localhost/cake/artist/detailview/1/webroot/music/myfile.mp3

However in my index it run, in my detailview not.

I tought if is better to change the route, or put my files outside
webroot.

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: mp3 player in flash

2011-05-05 Thread Sam Sherlock
having the mp3 in a dir named music is fine within the webroot dir is fine.

is your app installed in a folder named cake and artist a controller

or is the app within artist?

it looks to me the latter (although other parts of your email make me think
that artist is a controller)
and the fix may be as simple as make the flash instance recieve
/cake/artist/webroot/music/myfile.mp3
that should be the same as
/cake/artist/music/myfile.mp3

I think your passing a relative url to the flash instance
since it finds the mp3 from the index but not the detailView action

I have an app that plays mp3s from a flash header
my mp3s are in a dir named mp3 - I load playlists of mp3s from a dir xml
(which has absolute paths)

irrespective of the url in the browser the mp3 is played - below is a
simplified version of the setup I used (in addition to loading the header I
have various other swfobjects for videos, photos etc that all use the same
principal - my header also has a signup feature using ajax to pass
send/repond data between flash  cake)

var flObj = {
  flashvars: {
logoObject:'flash/logo.swf',
xmlFile:'xml/blank.xml',
file:xml/playlist.xml,mp3swf:flash/mp3player.swf
},
params:{
  base:siteCfg.path
}
};


swfobject.embedSWF(
  siteCfg.path+/flash/myheader.swf,
  targetDiv,977,220,8.0.0,false,
  flObj.flashvars,
  flObj.params
);


since the flash params.base is set I can pass additional files to my flash
to load the additional files are passed relative to location in webroot
and the flash instance concats the url of loaded file from the siteCfg.path

so my app installed in /cakemp3playingapp/ on example.com - the following
will all work

example.com/cakemp3playingapp/
example.com/cakemp3playingapp/artists/
example.com/cakemp3playingapp/artists/details/1/
example.com/cakemp3playingapp/contact/

my example uses an xml playlist - but thats optional

hth  - S




On 6 May 2011 05:24, Kane The Pirate kanethepir...@gmail.com wrote:



 On 3 maio, 23:24, Sam Sherlock sam.sherl...@gmail.com wrote:
  perhaps its due to cakes use of mod rewrite
 
  if so I suggest using firebug's net tab to see the urls of the mp3's
 being
  loaded
  then firgure out a way to ensure the your app has correct urls
 consistently
 
  are you using absolute paths to the mp3s within your xml file or as
 params
  passed to swfobject?
 
  I pass a basePath to swfobjects in cake apps and use this within
  actionscript to get easy abs paths
  then it does not matter is the app is in subdir or not the actionscript
 does
  not need to be recoded
 
   - S
 
  On 4 May 2011 02:47, Kane The Pirate kanethepir...@gmail.com wrote:
 
   Its workin now! but just in my index page, and only if I access my url
   without any slashes after the index.
   ex: localhost/cake/artist - this works
   ex: localhost/cake/artist/ - this doesn't work
   ex: localhost/cake/artist/detailView/12 - doesn't work.
 
   I'm trying to understand. I used the router to see if there are
   differences, but there is none difference between the index and other
   pages.
 
   I'm just using swfobject for cakephp.
 
   Thanks.
 
   --
   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

 I'm passing by params.
 something like webroot/music/myfile.mp3.


 in index show me the following url:
 localhost/cake/artist/webroot/music/myfile.mp3

 in other shows this:
 localhost/cake/artist/detailview/1/webroot/music/myfile.mp3

 However in my index it run, in my detailview not.

 I tought if is better to change the route, or put my files outside
 webroot.

 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


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