Re: Separate admin and client views

2009-07-14 Thread NegoBlack®

Yes... You can create subfolders inside the view path like this:

-- app
 views
 users
 login.ctp
 register.ctp
 themed
 admin
 users
 admin_index.ctp
 admin_view.ctp
 ...
 groups
 admin_index.ctp
 admin_view.ctp
 ...

where admin is your current theme that must be set in your controller
like this:

...

var $view = Theme;
var $theme = admin;

...

On 14 jul, 03:00, M Naveed Akram cmn...@gmail.com wrote:
 thanks.. but that helps in making themable .. but i want to separate admin
 routed function views in separate admin directory

 On Tue, Jul 14, 2009 at 10:54 AM, NegoBlack®
 paulomoacir.jun...@gmail.comwrote:



  Try this...http://book.cakephp.org/view/488/Themes

  On Jul 14, 2:37 am, CMNAJS cmn...@gmail.com wrote:
   i want to maintain two different directories for admin and client
   views. and want to make it themeable as well. .. any idea.
--~--~-~--~~~---~--~~
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: Separate admin and client views

2009-07-13 Thread NegoBlack®

Try this... http://book.cakephp.org/view/488/Themes

On Jul 14, 2:37 am, CMNAJS cmn...@gmail.com wrote:
 i want to maintain two different directories for admin and client
 views. and want to make it themeable as well. .. any idea.
--~--~-~--~~~---~--~~
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: 2 question about cakeohp

2009-07-01 Thread NegoBlack®

Hello heli007,

Maybe using the HtmlHelper on your view like this:

?php echo $html-css(default); ?

Do not forget to put the default.css file on app/webroot/css.

This is not the best solution. You must to create the layouts on the
app/views/layouts/example.ctp and set what of them must be used on
your controllers like this:

...

public function index()
{
...
$this-layout = home;
}

...

Read more here http://book.cakephp.org/view/96/Layouts

On Jul 1, 4:25 am, heli007 pcfi...@gmail.com wrote:
 1)
 i put  a home.ctp file into \app\views\pages
 ,when i browse   it i can see the page but without css style,
 in that home.ctp file I  wrote link href=default.css
 rel=stylesheet type=text/css / between head,and i have out
 default.css to the \app\webroot\css directory,why does it not work

 how to add css to a page

 2)does every page made by cakephp has that cakephp green header and
 footer?
--~--~-~--~~~---~--~~
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: Redirect loop using Auth + Acl component

2009-07-01 Thread NegoBlack®

I think that is not a good idea... I remeber to read in some place on
the docs that it was not recomended. Could you tell more about your
Auth system?

On Jul 1, 9:03 am, GravyFace gravyf...@gmail.com wrote:
 Not sure about your code, but try adding 
 $this-Auth-allow('login');http://book.cakephp.org/view/382/allow

 On Wed, Jul 1, 2009 at 5:49 AM, Delbertoderekmer...@gmail.com wrote:

  Hello,

  I am building an application and am having an issue with one of my
  controllers. I get the following message in Firefox

  Redirection limit for this URL exceeded.  Unable to load the
  requested page.  This may be caused by cookies that are blocked

  I have followed the cookbook tutorial Simple Acl controlled
  Application. I haven't got this error on my other controllers so I'm
  wondering what has gone wrong. The error is intermittent but it is a
  bit of a show stopper.

  Any help you can give would be gratefully received.

  Best Regards,
   Derek
--~--~-~--~~~---~--~~
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: Database Table not Found for a Model I haven't Created

2009-07-01 Thread NegoBlack®

I think you must create the model Site and configure it to do not use
a table like this:

class Site extends AppModel {
var $useTable = false;
}


On Jun 30, 1:25 pm, Tony t3proje...@gmail.com wrote:
 I'm running into a problem in getting this error:
 Error:  Database table sites for model Site was not found.

 I don't have a model for Sites because I don't even have a table for
 it.

 I have a Sites controller but in the $uses array it is using the model
 User.

 Can anyone help me here.
--~--~-~--~~~---~--~~
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: Problems with belongTo and hasMany

2009-05-15 Thread NegoBlack®

Hello hahmadi82,

Maybe using a code like this:

$schools = $this-find(all, array(recursive = 2));

The option recursive take more info in the models.

On May 15, 8:19 pm, hahmadi82 hahmad...@gmail.com wrote:
 Hi, I'm new to cakephp and I'm confused about the model setup...

 I have class kids belongsTo parents and class school hasMany kids.  Now
 in my index for kids I can retrieve all parent information based on the
 foreign key. However in school, i have access to the kid information but not
 the parents info that belongs to the kids.  Does this belongsTo info not
 pass along parent info to the school class? If so, I have trouble setting it
 up...

 Please let me know if you need the actual code snippet and I will gladly
 paste.
 --
 View this message in 
 context:http://www.nabble.com/Problems-with-belongTo-and-hasMany-tp23567941p2...
 Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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: Debug Ajax

2009-04-26 Thread NegoBlack®

Hello Dave,

I never used debug when using Ajax. I'm not sure if I understood your
post. My suggestion is the Firebug. With this amazing extension for
Firefox (https://addons.mozilla.org/pt-BR/firefox/addon/1843) you can
see your requests, responses...

P.S. Sorry for my bad english... I'm from Brazil and my English
doesn't help... :)

On Apr 26, 11:54 pm, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 For some odd reason i cant see the debug for any of my Ajax requests. It
 used to work now it just stopped.

 config file  debug = 2

 app_controller
 if ($this-RequestHandler-isAjax() || $this-RequestHandler-isXml()) {
               Configure::write('debug', 2);
           }

 even tried adding
 if ($this-RequestHandler-isAjax() || $this-RequestHandler-isXml()) {
               Configure::write('debug', 2);
           }

 to the actions being called for the ajax and still no output.

 Ideas?

 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: 2 question about my site,Thanks.

2009-04-26 Thread NegoBlack®

Strange...

1) Nothing in the beforeFilter or in the app_controller?
2) What are you putting in the first parameter of your
HtmlHelper::link? (some example of code?)

On Apr 26, 10:59 pm, Rimoe meiyo...@gmail.com wrote:
 hi
 every one.

 1. I only use the refresh key(F5) one time, but I saw the controller has
 execute 2 times.
      but  when I use the link to the action, It only has been execute one
 time.

 2.  my link,  sometimes it can be show very good, sometimes it will be  show
 bad, like the code has been show directly

 Thanks

 if you know the answer,please tell me. thank you.

 rimoe
--~--~-~--~~~---~--~~
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: User Id Question

2009-04-26 Thread NegoBlack®

I use to do this on my app_controller.php:

public function beforeFilter(){

if ($this-Auth-user()){
$this-set(userInfo, $this-Auth-user())
}
}

Then I can use this var on my views...



On Apr 25, 7:57 pm, Teedaddy bretteegar...@gmail.com wrote:
 Could someone be so kind to tell me the easiest way to pass the
 current logged in Auth user id in $htmlhelper links?

 Thank you so much, just learning all this MVC method and have been
 through Auth tutorials numerous times but I am missing this somehow.

 Bret
--~--~-~--~~~---~--~~
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: 2 question about my site,Thanks.

2009-04-26 Thread NegoBlack®

My hypothesis was anything like the fourth parameter of the
HtmlHelper::link but with your answer it was discarded. About the F5 I
don't have ideas... Any Ajax Call or redirect? How do you diagnosed
this strange behavior?

On 27 abr, 00:34, Rimoe meiyo...@gmail.com wrote:
 hi,

 my beforeFilter  have no write any thing is special

 my link is like this:
 ?php echo $html-link(__('TOP', true), array('controller'=
 'pages','action'='index',$username),null,false,false);?
 thanks  for your help.

 rimoe

 2009/4/27 NegoBlack® paulomoacir.jun...@gmail.com



  Strange...

  1) Nothing in the beforeFilter or in the app_controller?
  2) What are you putting in the first parameter of your
  HtmlHelper::link? (some example of code?)

  On Apr 26, 10:59 pm, Rimoe meiyo...@gmail.com wrote:
   hi
   every one.

   1. I only use the refresh key(F5) one time, but I saw the controller has
   execute 2 times.
        but  when I use the link to the action, It only has been execute one
   time.

   2.  my link,  sometimes it can be show very good, sometimes it will be
   show
   bad, like the code has been show directly

   Thanks

   if you know the answer,please tell me. thank you.

   rimoe


--~--~-~--~~~---~--~~
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: 2 question about my site,Thanks.

2009-04-26 Thread NegoBlack®

Sad... No ideas... But could you post your complete action here (I
don't know... function add() maybe...)?

On 27 abr, 01:22, Rimoe meiyo...@gmail.com wrote:
 I have no  Any Ajax Call, I have write a save action, when it use the
 action i will write it into my database.
 so I know it has been execute 2 times,
 and then if the page has been execute 2 times, some link will can't be
 clicked,
 if clicked, the page will like the code has been show directly.

 Thank you

 rimoe

 2009/4/27 NegoBlack® paulomoacir.jun...@gmail.com



  My hypothesis was anything like the fourth parameter of the
  HtmlHelper::link but with your answer it was discarded. About the F5 I
  don't have ideas... Any Ajax Call or redirect? How do you diagnosed
  this strange behavior?

  On 27 abr, 00:34, Rimoe meiyo...@gmail.com wrote:
   hi,

   my beforeFilter  have no write any thing is special

   my link is like this:
   ?php echo $html-link(__('TOP', true), array('controller'=
   'pages','action'='index',$username),null,false,false);?
   thanks  for your help.

   rimoe

   2009/4/27 NegoBlack® paulomoacir.jun...@gmail.com

Strange...

1) Nothing in the beforeFilter or in the app_controller?
2) What are you putting in the first parameter of your
HtmlHelper::link? (some example of code?)

On Apr 26, 10:59 pm, Rimoe meiyo...@gmail.com wrote:
 hi
 every one.

 1. I only use the refresh key(F5) one time, but I saw the controller
  has
 execute 2 times.
      but  when I use the link to the action, It only has been execute
  one
 time.

 2.  my link,  sometimes it can be show very good, sometimes it will
  be
 show
 bad, like the code has been show directly

 Thanks

 if you know the answer,please tell me. thank you.

 rimoe


--~--~-~--~~~---~--~~
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: How to make this tricky paginate - beauty?

2009-04-21 Thread NegoBlack®

Hello,

I'm new in this group and have being using the CakePHP about 3 months.
My advice is doing something like this:

# app/controllers/products_controller.ctp

?php

class ProductsController extends AppController
{

  var $paginate = array(
Product = array(
  limit = 10,
  fields = array(id, title, price, currency_id,
country_id, cost_usd),
  order = array(cost_usd = DESC)
)
  );


  public function index()
  {
$events = array();

foreach ($this-paginate(Product) as $matches){

  if ($matches[Product][cost_usd] == 2){
$matches[Product][price] *= 1.34;
  }

  $products[] = $matches;
}

$this-set(products, $products);
  }
}

# app/controllers/products_controller.ctp

Maybe using var $currencies and updating the line  $matches
[Product][price] *= 1.34; with  $matches[Product][price] *=
$this-currencies; your code be beauty and easier to maintain or
add some other currencies.

P.S. I'm writing from Brazil and my english is not good as you could
see.


On Apr 21, 5:00 pm, vla...@gmail.com vla...@gmail.com wrote:
 In table I have pirce in different currencies - USD/Euro

 Pure MySQL I can do:

 SELECT id, price, currency_id, title,
                         CASE currency_id
                         WHEN 1
                         THEN price
                         WHEN 2
                         THEN price * 1.34
                         END AS cost_usd
                         FROM dec_immovables
                         WHERE 1
                         ORDER BY cost_usd DESC
                         LIMIT 0 , 30

 This construction:

 $this-paginate = array('limit' = 10,array('fields' = array
 ('id','title','price','currency_id','country_id',CASE currency_id
 WHEN 1 THEN price WHEN 2 THEN price * 1.34 END AS cost_usd),'order'
 = array('cost_usd' = 'DESC')));

 doesn't work.

 How to make it beauty?

--~--~-~--~~~---~--~~
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: Another Newbie question (or two!)

2009-04-21 Thread NegoBlack®

Hello Beedge,

I think you will find this information here 
http://book.cakephp.org/view/96/Layouts,
but what you must to create a new layout on app/view/layouts/
beedge.ctp setting the var $content_for_layout in the place where
you want to wrap the content rendered by the views. You still can set
$title_for_layout and $scripts_for_layout. After that you must to set
the attribute $layout on your controller or action like this:

?php


class ProductsController extends AppController
{

  var $layout = beedge;


  public function index()
  {
$events = array();

# ...
  }


  public function view()
  {
$this-layout = another_by_beedge;
#...
  }
}


# app/controllers/products_controller.ctp

On Apr 21, 8:06 pm, Beedge kbrads...@hbit.ie wrote:
 Cool thanks,

 next question

 how do I go about editing the look of the page? where does the blue
 header and footer come from?

 again, I am working athttp://hbit.ie/cake/posts

 is there some way of setting up a template look and feel for a page?

 looking at the source code generated I can see a header and footer
 div.. how do I go about editing these?

 thanks,

 Kevin

 On Apr 21, 11:25 pm, BeroFX ber...@gmail.com wrote:

  Set debug = 0 in app/config/core.php

  On Apr 22, 12:17 am, Beedge kbrads...@hbit.ie wrote:

   Hi all,

   I have recently decided to learn a framework, and from what Ive seen
   Cake is the way to go,, So I ve gotten my hands on 'Practical cakePHP
   projects'

   Im doing the first blogging tutorial, and my first attempt differs in
   appearance from the example in the book

   it looks like I am in a debuggin mode or something, because the SQL is
   being output. my example is at:

  http://hbit.ie/cake/posts

   is there a variable I should set to go to 'normal' mode?

   thanks all.

   Kevin


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