Search Results

Search found 489 results on 20 pages for 'cake baker'.

Page 2/20 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Cake PHP Routing issue

    - by Smickie
    Hi, I need to do some special routing in cake, but can't for the life of me figure it out. I have a shop controller at /shop, the format of the url will be: /shop/:category/:sub_category/:product_slug In the routing I need to send each part of the url to a different action, for example if the url was just /shop/cakes it would go to the category action of shop. However if the url was /shop/cakes/macaroons or /shop/cakes/fairy it would go to the sub category action on the shop controller. And the the same again for /shop/cakes/macaroons/pistachio would go to the product action on the shop controller. How would I go about this in the routing? Something starting with Router::connect('/shop/:category/:sub_category/:product_slug' ... Or am I way off the mark? Thanks.

    Read the article

  • CakePHP 'Cake is NOT able to connect to the database'

    - by kand
    I've looked at this post about a similar issue: CakePHP: Can't access MySQL database and I've tried everything they mentioned in there including: Changing my database.php so that the 'port' attribute for both $default and $test are the location of my mysqld.sock file Changing the 'port' attribute to the actual integer that represents the port in my my.cnf mysql config Changing the mysql socket locations in php.ini to the location of my mysqld.sock file I'm using ubuntu 11.04, apache 2.2.17, mysql 5.1.54, and CakePHP 1.3.10. My install of mysql and apache don't seem to match any conventions, as in, all the config files are there, they are all just in really weird places--I'm not sure why that is, but I've tried reinstalling both programs multiple times with the same results... At any rate, I can log into mysql from the terminal and use it normally, and apache is working because I can see the CakePHP default homepage. I just can't get it to change the message 'Cake is NOT able to connect to the database'. SOLVED: Figured it out, had to change php.ini so that extension_dir pointed to the correct directory and had to add a line extension=mysql.so.

    Read the article

  • Cake PHP redirect with parameters in url

    - by megaboss98
    I have a page that I want to redirect to that requires parameters in the URL: http://www.mysite.com/myController/myAction/param1:val1/param2:val2 I know that there is a Cake PHP redirect function for redirecting that works as follows: $this->redirect(array("controller" => "myController", "action" => "myAction", $data_can_be_passed_here), $status, $exit); How do I add the parameters that I want as part of the url using the above function? I would think that there might be another element that I could add to array so that I can pass along "param1:val1" and "param2:val2". Any help would be greatly appreciated!

    Read the article

  • How to check if a node's value in one XML is present in another XML with a specific attribute?

    - by Manish
    The question seems to be little confusing. So let me describe my situation through an example: Suppose I have an XML: A.xml <Cakes> <Cake>Egg</Cake> <Cake>Banana</Cake> </Cakes> Another XML: B.xml <Cakes> <Cake show="true">Egg</Cake> <Cake show="true">Strawberry</Cake> <Cake show="false">Banana</Cake> </Cakes> Now I want to show some text say "TRUE" if all the Cake in A.xml have show="true" in B.xml else "FALSE". In the above case, it will print FALSE. I need to develop an XSL for that. I can loop through all the Cake in A.xml and check if that cake has show="true" in B.xml but I don't know how to break in between (and set a variable) if a show="false" is found. Is it possible? Any help/comments appreciated.

    Read the article

  • Add/remove Cake named URL parameter for a link

    - by sibidiba
    Using CakePHP 1.3 there are named parameters in the URL like .../name:value/... These are used for example by pagination links .../page:2/key:date/sort:desc/... How to generate links with HtmlHelper::link() adding/deleting such named parameters from the current URL? Basically I want create links to add/remove/modify the category:ID named parameter in the current URL. It must not touch the URL, anchor, other named parameters, GET parameters in the URL. Or how can I pass named parameters to HtmlHelper::link()?

    Read the article

  • select SUM in Cake

    - by SpawnCxy
    When I tried using follow code to get the sum of the column named Serviceinfo.services $conditions = array('fields'=>array('SUM(Serviceinfo.services) as servicecount'),'conditions'=>array('time_id BETWEEN ? AND ?'=>array($startid,$endtid))); $services = $this->Serviceinfo->find('all',$conditions); I had to fetch the sum data with services[0][0]['servicecount'] which seems a little weird.And What I expect is services['Serviceinfo']['servicecount'],or more simple one.Then how can I fix this?Thanks in advance!

    Read the article

  • Change environment in cake php

    - by ryudice
    I just started with cakePHP for a small project, I have rails experience and I can see they are really similar however I cant seem to find where to chagne the environment you are working? I'm current working with test because I see all those debugging messages but I want to see how the design looks and I need to get rid of those messages so I need to change environment to production.

    Read the article

  • cake php AppController and inheritance

    - by RSK
    hello folks........ In many tutorial of Acl component in cakephp i got instruction that add component either in AppController or in all the other controllers which inherits AppController....... but problem is var $components=array('Auth',Acl); when i use the above line in AppConroller i cant use the Auth or Acl component... but when i use the same code in all the child classes it works fine........ what will be the problem thanks in advance any help will be appreciated.

    Read the article

  • How to access a plugin model from a regular controller in PHP Cake 1.1

    - by Duncan
    Hopefully a simple question: I've a plugin which uses a set of tables (kb_items, kb_item_tags, etc). and I'd like to be able to access these models from another controller (say, my Pages controller), thus: class PagesController extends AppController{ function knowledgebase(){ $items = $this->KbItem->findAll(...); } } I am admittedly breaking the rules a little (by not placing this controller inside the knowledge base plugin), but this in this case its a custom page that doesn't need to be part of the knowledge base plugin code base. Please let me know if you need more details. Thanks in advance for any help!

    Read the article

  • How can get autosuggest in cake php

    - by rajesh
    i hav entered my code in controller like below function keyup(){ $this-Note-simple(); if(strlen($searchq)0){ while ($row = mysql_fetch_array($getRecord)) { echo $row['name']; echo $row['department']; } return $row; } } as soon as i entered this one it doesn't display any info .... what correction should require.......

    Read the article

  • Display a MYSQL field using CAKE

    - by adam
    Forgive me if this is a "homework" question. We have a "Rating" table in our mysql db. I want to display this number on our user profile page. JUST BELOW THE GRAVATAR. here is the code in app/views/user/view.ctp <div class="nhplft"> flash(); ? ?d=identicon&s=100" border="0" alt="My Avatar! UID:" / Change Image link("Home",'/items'); ?  |  link('Add',array('controller' = 'items','action'='add')); ?  |  link('Search',array('controller'='items','action'='index')); ?  |  link("Logout",'/users/logout'); } ?

    Read the article

  • Is everyone baking the same CI cake?

    - by Brett Rigby
    I can't help but wonder about this whole Continous Integration process and wanted to know what you think about it all. From my perspective, we're constructing our own 'flavour' of NAnt/Ivy/CruiseControl.Net in-house and can't help but get the feeling that other dev shops are doing exactly the same work, but then everybody is finding out the same problems and pitfalls with it. I'm not complaining about NAnt, Ivy or CruiseControl at all, as they've been brilliant in helping our team of developers become more sure of the quality of their code, but it just seems strange that these tools are very popular, yet we're all re-inventing the CI-wheel. Is there a pre-made solution for building .Net applications, using the tools mentioned above, and if so, why aren't we all using them??

    Read the article

  • Cake returned the time consumed in data lookup in JQuery Alert Box

    - by kwokwai
    Hi all, When I was doing some self-learning on JQuery Ajax in Cakephp, I found out some strange behaviour in the JQuery Alert Box. Here are a few lines of code of the JQuery Ajax I used: $(document).ready(function(){ $(document).change(function(){ var usr = $("#data\\[User\\]\\[name\\]").val(); $.post{"http://www.mywebsite.com/controllers/action/", usr, function(msg){alert(msg);} } }); }); The Alert box shows me a message returned from the Action: Helloworld <!--0.656s--> I am not sure why the number of time consumption was displayed in the Alert box, since it was not in my code as follows: function action($data=null){ $this->autoRender = false; $result2=$this->__avail($data); if($result2==1) {return "OK";} else {return "NOT";} } CakePHP rteurned some extra information in the Alert box. Later I altered a single line of code and tried out this instead, and the time consumption was not displayed on screen then: $(document).ready(function(){ $(document).change(function(){ var usr = $("#data\\[User\\]\\[name\\]").val(); $.post{"http://www.mywebsite.com/controllers/action/", usr, function(msg){$("#username").append('<span>'+msg+</span'>);} } }); });

    Read the article

  • Access shell methods in controller? Cake PHP 1.3

    - by anonymous coward
    I wrote a shell method in CakePHP 1.3 that has a return value. I'd like to be able to access that method from within a controller, so that I can pass its return value into the View. I'm not sure how to access those methods appropriately from within the controller. Have I done it wrong? I could easily duplicate the code, but I'd like to "keep it DRY", and the actual functionality, I believe, doesn't belong with this particular controller - I just need it's return value in this particular view.

    Read the article

  • Paginator (Migration from Cake 1.3 to 2.0

    - by Christian Waschke
    i am struggling with the paginator in cakephp 2.0. While i am trying to migrate my application to 2.0 i cant find any solution to jump directly to the last page. In 1.3 it was quiet to do that from outside like this: echo $this->Html->link(__('Flights'), array('controller' => 'flights', 'action' => 'index','page' => 'last')); but this little trick putting 'page:last' in does not work anymore in 2.0. Of course there is a Paginator function called last, but this would only help if i would be already inside the app. My Problem is to access from an outside link directly the last page of the paginator. Thank you for reading, cdjw

    Read the article

  • Cakephp database migration error

    - by Vijay Kumbhar
    Hello All, I am using Ubuntu + cakephp 1.3. I am trying the database migration with the help of cakeDC migration plugin. I configured the plugin as per the instructions. But when i goes to the terminal, goes to the path of the application application_path/app/ dir then fire a command 'cake migration help' it gives me following error, Hello user, Welcome to CakePHP v1.2 Console Current Paths: -working: /path/to/cake/ -root: /path/to/cake/ -app: /path/to/cake/app/ -core: /path/to/cake/ Changing Paths: your working path should be the same as your application path to change your path use the '-app' param. Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp Available Shells: app/vendors/shells/: - none vendors/shells/: - none cake/console/libs/: acl api bake console extract To run a command, type 'cake shell_name [args]' To get help on a specific command, type 'cake shell_name help' Then i followed the steps given in the : http://book.cakephp.org/view/108/The-CakePHP-Console $ cake -app /path/to/app But i am not getting the success. Can anybody help me out from this issue... Thanks in adavnce.

    Read the article

  • Surprise for a programmer on Birthday

    - by penelope
    Help! My boyfriend's birthday is next month. Since he is a programmer, I'd love to make him a cake with the code for "happy birthday" (and perhaps something awesome) written in icing on top. Not being a programmer myself, I have no idea where to begin. Any suggestions would be greatly appreciated!

    Read the article

  • Surprise for a programmer [closed]

    - by penelope
    help! my boyfriend's birthday is next month. since he is a programmer, I'd love to make him a cake with the code for "happy birthday" (and perhaps something awesome) written in icing on top. not being a programmer myself, i have no idea where to begin. any suggestions would be greatly appreciated!

    Read the article

  • Files inside Alias folder not accessible

    - by John Isaacks
    In my apache2.conf I have an alias setup like this: Alias /cake/ /var/www-cake/repo <Directory /var/www-cake/repo> Order allow,deny Allow from all AllowOverride All Options +Indexes </Directory> inside the /var/www-cake/repo directory I just have 1 file that is index.php when I go to http://linux-server/cake/ I get a directory listing that shoes the index.php file. When I click on the file it takes me to http://linux-server/cake/index.php in which I get a 404 page not found error. What do I need to do to make the files accessible?

    Read the article

  • Is avoiding the private access specifier in PHP justified?

    - by Tifa
    I come from a Java background and I have been working with PHP for almost a year now. I have worked with WordPress, Zend and currently I'm using CakePHP. I was going through Cake's lib and I couldn't help notice that Cake goes a long way avoiding the "private" access specifier. Cake says Try to avoid private methods or variables, though, in favor of protected ones. The latter can be accessed or modified by subclasses, whereas private ones prevent extension or re-use. in this tutorial. Why does Cake overly shun the "private" access specifier while good OO design encourages its use i.e to apply the most restrictive visibility for a class member that is not intended to be part of its exported API? I'm willing to believe that "private" functions are difficult test, but is rest of the convention justified outside Cake? or perhaps it's just a Cake convention of OO design geared towards extensibility at the expense of being a stickler for stringent (or traditional?) OO design?

    Read the article

  • cakephp & nginx config/rewrite rules

    - by seanl
    Hi somebody please help me out, I've asked this at stackoverflow as well but not got much of a response and was debating whether it was programming or server related. I’m trying to setup a cakephp environment on a Centos server running Nginx with Fact CGI. I already have a wordpress site running on the server and a phpmyadmin site so I have PHP configured correctly. My problem is that I cannot get the rewrite rules setup correct in my vhost so that cake renders pages correctly i.e. with styling and so on. I’ve googled as much as possible and the main consensus from the sites like the one listed below is that I need to have the following rewrite rule in place location / { root /var/www/sites/somedomain.com/current; index index.php index.html; # If the file exists as a static file serve it # directly without running all # the other rewrite tests on it if (-f $request_filename) { break; } if (!-f $request_filename) { rewrite ^/(.+)$ /index.php?url=$1 last; break; } } http://blog.getintheloop.eu/2008/4/17/nginx-engine-x-rewrite-rules-for-cakephp problem is these rewrite assume you run cake directly out of the webroot which is not what I want to do. I have a standard setup for each site i.e. one folder per site containing the following folders log, backup, private and public. Public being where nginx is looking for its files to serve but I have cake installed in private with a symlink in public linking back to /private/cake/ this is my vhost server { listen 80; server_name app.domain.com; access_log /home/public_html/app.domain.com/log/access.log; error_log /home/public_html/app.domain.com/log/error.log; #configure Cake app to run in a sub-directory #Cake install is not in root, but elsewhere and configured #in APP/webroot/index.php** location /home/public_html/app.domain.com/private/cake { index index.php; if (!-e $request_filename) { rewrite ^/(.+)$ /home/public_html/app.domain.com/private/cake/$1 last; break; } } location /home/public_html/app.domain.com/private/cake/ { index index.php; if (!-e $request_filename) { rewrite ^/(.+)$ /home/public_html/app.domain.com/public/index.php?url=$1 last; break; } } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/public_html/app.domain.com/private/cake$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } Now like I said I can see the main index.php of cake and have connected it to my DB but this page is without styling so before I proceed any further I would like to configure it correctly. What am I doing wrong………. Thanks seanl

    Read the article

  • How can I prepare a cake graph in excel with a result based on 100%?

    - by Pitto
    Hello my friends... I need to distribute correctly a little data in an excel graph. I have the total I've earned last year which should represent the 100% of the cake. Then I have my insurance expenses and I want to understand, graphically, how much of my total income went away to pay insurance... I know that a basic proportion like: total expenses : total insurance costs = 100 : x do the correct math but I can't find a way to display this in a cake graph... Any hints?

    Read the article

  • CakePHP 1.3.4: EmailComponent error - Undefined property: EmailComponent::$Controller

    - by Kevin S.
    I'm trying to develop an invitation system for my website which runs on CakePHP 1.3.4. I am trying to use the built in EmailComponent to send an email. I'm getting this error (expanded): Notice (8): Undefined property: EmailComponent::$Controller [CORE/cake/libs/controller/components/email.php, line 428] Code | Context */ function _render($content) { $viewClass = $this-Controller-view; $content = array( "", "" ) EmailComponent::_render() - CORE/cake/libs/controller/components/email.php, line 428 EmailComponent::send() - CORE/cake/libs/controller/components/email.php, line 368 UsersController::send_quick_add_email() - APP/controllers/users_controller.php, line 77 UsersController::quick_add() - APP/controllers/users_controller.php, line 104 SinglesResultsController::quick_add() - APP/controllers/singles_results_controller.php, line 63 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171 [main] - APP/webroot/index.php, line 83 I also get the following, which I can expand if necessary: Notice (8): Trying to get property of non-object [CORE/cake/libs/controller/components/email.php, line 428] Notice (8): Undefined property: EmailComponent::$Controller [CORE/cake/libs/controller/components/email.php, line 433] Notice (8): Trying to get property of non-object [CORE/cake/libs/controller/components/email.php, line 433] Notice (8): Undefined property: View::$webroot [CORE/cake/libs/view/view.php, line 805] Warning (2): Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/cake/cake/libs/debugger.php:673) [CORE/cake/libs/controller/controller.php, line 746] I think that the EmailComponent object holds a reference to the controller it's being called from. I don't know why it's undefined in this case. Here is the code that fails (specifically, it errors on the call to $this-Email-send()): function send_quick_add_email($email) { if($email) { $this->Email->reset(); $this->Email->to = $email; $this->Email->subject = 'Some subject text'; $this->Email->from = '[email protected]'; $this->Email->template = 'email_template'; $this->set('user', $user); $this->set('token', $token); $this->Email->delivery = 'debug'; $this->Email->send(); } } Ok, for more clarification: The main data I am collecting on the site is results of a game played in meatspace. SinglesResultsController has an action, quick_add, which expects email addresses of people not already registered on the site. If the email addresses aren't associated with Users, UsersController::quick_add is called, which creates an inactive user, and sends an invitation email in UsersController::send_quick_add_email() I think the problem is related to the fact that the email isn't being sent in the first controller initialized (SinglesResultsController). Any thoughts on how to make it work? The Email component is declared at the top of both Controllers.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >