Re: Cakephp + Mootools Request.HTML

2009-06-10 Thread eiji

The constant I was looking for wasn't in the list. But I managed to
make one using the link I messaged before

Absolute path -

$proj = str_replace(str_replace('url=', '', $_SERVER['QUERY_STRING']),
'', $_SERVER['REQUEST_URI']);
$abs_path = http://{$_SERVER['SERVER_NAME']}{$proj}';

its suppose to output

http://localhost/b2/

then I'll just add the controller and action to end of $abs_path.


If there is a better way to get the path or a better way to pass the
URL in mootools Request.HTML please do reply here. For now, I'll be
using this one.

Thanks S!

On Jun 10, 2:03 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
 Yeshttp://book.cakephp.org/view/122/Core-Definition-Constants

 - S

 2009/6/10 eiji animere...@gmail.com



  But doesn't $this-action only gets the action, eg. in my example add/
  edit?

  I was wondering is there a way in cakephp, a constant variable
  perhaps, that gets the absolute path of a certain project?

  Alec

  On Jun 10, 12:22 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
   this-action is good for this. I find it useful setting a js var in a
  script
   block and then in my main script eg common.js I use this var - also this
   controller
   - S

   2009/6/10 eiji animere...@gmail.com

Hi Sam,

Thanks for that, is there an easier way to get the absolute path of a
certain project?

or is this the best way -
   http://groups.google.co.uk/group/cake-php/browse_thread/thread/e40c3c.
  ..

Thanks. :)

On Jun 10, 11:22 am, Sam Sherlock sam.sherl...@gmail.com wrote:
 use absolute urls in cake

 - S

 2009/6/10 eiji animere...@gmail.com

  bump..

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



Re: Cakephp + Mootools Request.HTML

2009-06-10 Thread eiji

Yes! Thanks for that, now I know I used the right attribute.
I've seen also this $html-webroot and now I know I've used it
properly!

Thank you Mark! :)

-Alec

On Jun 11, 2:02 am, mark_story mark.st...@gmail.com wrote:
 I usually do something like

 script
 var window.basePath = '?php echo $this-webroot; ?';
 /script

 in my layouts.  Then when making urls in javascript

 url: window.basePath + '/posts/delete/' + id

 Or some such thing. That way I always get an absolute URL.

 -Mark

 On Jun 9, 11:46 pm, eiji animere...@gmail.com wrote:

  Hi Sam,

  Thanks for that, is there an easier way to get the absolute path of a
  certain project?

  or is this the best way 
  -http://groups.google.co.uk/group/cake-php/browse_thread/thread/e40c3c...

  Thanks. :)

  On Jun 10, 11:22 am, Sam Sherlock sam.sherl...@gmail.com wrote:

   use absolute urls in cake

   - S

   2009/6/10 eiji animere...@gmail.com

bump..

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



Cakephp + Mootools Request.HTML

2009-06-09 Thread eiji

Hi Guys,

I'm trying to use the Request.HTML of Mootools and I've got it working
on the DropDown onchange event. Really great indeed. I just noticed an
error when I was trying to implement it in the edit action.

Ok, so.. my JS request is like this

function clientTypeChange(value) {
var req = new Request.HTML({
method: 'get',
url: 'get_groups/'+value,
update: $('IndividualIndividualGroup'),
onComplete: function(response) {
...
}
}).send();
return true;
}

the url works perfect in the add action

link : http://localhost/b2/individuals/add
requested url : http://localhost/b2/individuals/get_groups/C

but when I use the same code in the edit action

link : http://localhost/b2/individuals/edit/3
requested url: http://localhost/b2/individuals/edit/get_groups/C

see.. the edit action in the link is not removed and the action is
now directed to the edit. Also, when I try to pass a variable also to
add, say .../add/4, the requested url also retains the action add.

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



Re: Cakephp + Mootools Request.HTML

2009-06-09 Thread eiji

bump..

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



Re: CSS

2009-06-09 Thread eiji

You should use

$html-css([path/file], null, array(), false);

the fourth parameter is what you should set to false cause it is the
inline attribute.

Assuming you have the variable $scripts_for_layout at the head, it
would be outputted in the head part of the html.

Regards,

Alec

On Jun 10, 3:22 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 Can you include CSS per view as you do js?

 I need sifr css on only 1 view. Is there a way to include it in the specific
 view?

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



Re: Cakephp + Mootools Request.HTML

2009-06-09 Thread eiji

Hi Sam,

Thanks for that, is there an easier way to get the absolute path of a
certain project?

or is this the best way - 
http://groups.google.co.uk/group/cake-php/browse_thread/thread/e40c3cf038c2f01c

Thanks. :)

On Jun 10, 11:22 am, Sam Sherlock sam.sherl...@gmail.com wrote:
 use absolute urls in cake

 - S

 2009/6/10 eiji animere...@gmail.com



  bump..

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



Re: Cakephp + Mootools Request.HTML

2009-06-09 Thread eiji

But doesn't $this-action only gets the action, eg. in my example add/
edit?

I was wondering is there a way in cakephp, a constant variable
perhaps, that gets the absolute path of a certain project?

Alec

On Jun 10, 12:22 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
 this-action is good for this. I find it useful setting a js var in a script
 block and then in my main script eg common.js I use this var - also this
 controller
 - S

 2009/6/10 eiji animere...@gmail.com



  Hi Sam,

  Thanks for that, is there an easier way to get the absolute path of a
  certain project?

  or is this the best way -
 http://groups.google.co.uk/group/cake-php/browse_thread/thread/e40c3c...

  Thanks. :)

  On Jun 10, 11:22 am, Sam Sherlock sam.sherl...@gmail.com wrote:
   use absolute urls in cake

   - S

   2009/6/10 eiji animere...@gmail.com

bump..

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



Re: help: constant variables in the layout

2007-07-24 Thread eiji

hi chris,

thanks for this one. but i am well aware of this, or half of this,
that i absolutely search, dig every corner before i start asking. I
searched it all in the groups and i searched google of the error it
returned and what i only got are sites that is also suffering from the
same error as mine.
Im also a test-and-see-and-test... kinda guy where i keep on
troubleshooting and see what happens. and i just ran out of places to
look at before i start asking, cause i always have the dilemma that i
cant explain my question clearly and might just end up with nothing.
but anyway, thanks for this one. it helped me organize a few thoughts
of mine while i was reading it. and while i was reading it, i managed
to get the answer to my question.

i remembered that every controller extends app_controller (loc: app/
appp_controller.php), so i thought maybe i should put it here just in
case (not really thinking why but just testing it). so i made a
beforeFilter() and added my category_list variable but still it didnt
got to the layout. but when i changed it to beforeRender() it now is
being displayed (pr()) in the layout. now i tested it again and put it
back in a single controller and in the beforeRender() but it doesnt
work. so i just have it in the app_controller.

now im puzzled why?? thanks though. very appreciated help.

heres the snippet i did btw,

class AppController extends Controller {
function beforeRender() {
if (!isset($this-params['admin'])) {
$this-set('menu_categories', 
$this-Category-generateList(null,
'name ASC', null, '{n}.Category.id', '{n}.Category.name'));
}
}
.
.
.
}

On Jul 24, 8:57 pm, Chris Hartjes [EMAIL PROTECTED] wrote:
 On 7/24/07, eiji [EMAIL PROTECTED] wrote:

  bump?

 This link should help.

 http://slash7.com/pages

 --
 Chris Hartjes
 Senior Developer
 Cake Development Corporation

 My motto for 2007:  Just build it, damnit!

 @TheBallpark -http://www.littlehart.net/attheballpark
 @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



help: constant variables in the layout

2007-07-23 Thread eiji

hi everyone,

help. this is my first time to post here and i have just run out of
thoughts on how to make this work.

firstly, i wanted to have a menu that has a Products menu. and when
the Products is clicked, a list of categories is then displayed, i
plan to have this as an invisible div-ul-li that when the products is
clicked it visibles it under the products menu (hope i made this
clear).

now im having a problem with getting a constant variable that would be
visible to the layout everytime. at first i didnt know where to put
the code. after reading a lot of posts here in the groups this is what
i came up with, i had a variable, $this-set('category_list',...) in
beforeFilter/beforeRender. But when im going to access it in the
layout, it gives me an error. I tried to do pr() on the category_list
in the layout it throws a Undefined variable: category_list.

can anyone help with my problem?? or can anyone suggest like where to
put a global something that is always called?? o btw, heres my snippet
on the beforeFilter/beforeRender.


function beforeFilter() {
if (isset($this-params['admin']))
$this-layout = 'admin_default';
if (!isset($this-params['admin'])) {
echo 'x';
$this-set('category_list', $this-Category-
generateList(null, 'name ASC', null, '{n}.Category.id',
'{n}.Category.name'));
}
}

the echo 'x' there is just to test if it enters my condition, and it
does. im just wondering why the category_list isnt being available in
the layout..

thanks for the help. :D


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



Re: help: constant variables in the layout

2007-07-23 Thread eiji

bump?


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