Recent Posts
- (10/14) Forcing A Single Join in CakePHP PaginationTAGS:CakephpCakephp 13DatabaseErrorsHabtmMysqlMssqlWeb ProgrammingUsage
- (08/11) Inserting NOW() into MySQL Using CakePHPTAGS:CakephpDatabaseMysqlMssqlWeb ProgrammingUsage
- (08/07) Best PaginateCount for CakePHP - with Group By SupportTAGS:CakephpBehaviorsWeb ProgrammingUsageDatabaseExampleMysqlHabtmHack
- (04/03) CakePHP Error Messages Not Showing on FormTAGS:CakephpCakephp 13Web ProgrammingErrorsUsage
- (02/06) Sorting Paginated Results Using a Related Model Field in CakePHPTAGS:CakephpWeb ProgrammingUsageExample
- (11/02) Changing CakePHP's Model useTable on the FlyTAGS:CakephpWeb ProgrammingMysqlDatabaseExampleTutorial
- (10/18) The Funniest Error Message Ever - Thank You EclipseTAGS:EclipseWeb ProgrammingErrorsHumorWindowsUsageSoftwarePhpCakephp
- (09/27) Upgrading CakePHP Application to 1.3 (from 1.2)TAGS:CakephpUpgrade
Subscribe to my feed
MainelyDesign.com Blog
Usage Tagged Blog Posts
Forcing A Single Join in CakePHP Pagination
Posted on 10/14/2011 at 09:25 am | Viewed 840 times | 5 comments
The devil's in the details... I was trying to make a really simple, dreadfully easy, database join in my CakePHP web application. I've forced joins in Cake before, using the 'joins' key in the options array for find calls and paginate calls with no issue. It was late and for the first time I only wanted to use a single join. I copied the join code from a much more complex web app and pasted it into my new 'joins' conditions. And then... I got SQL errors.
Read: Forcing A Single Join in CakePHP Pagination | View: Comments
Inserting NOW() into MySQL Using CakePHP
Posted on 08/11/2011 at 11:16 pm | Viewed 736 times | 0 comments
Great find. If you want to insert NOW() into your query using CakePHP's save() or saveAll() functions, you can use the following expression:
$this->data['Model']['custom_date_field'] = DboSource::expression('NOW()');
Not sure how it works on MSSQL, but I will be testing that soon.
Cheers,
-Kevin Wentworth
Read: Inserting NOW() into MySQL Using CakePHP | View: Comments
Best PaginateCount for CakePHP - with Group By Support
Posted on 08/07/2011 at 05:03 pm | Viewed 923 times | 0 comments
I'm been muddling my way through pagination with multiple joins, and complex filtering. I finally got it all working (more on that later, maybe....) when I noticed that I couldn't paginate my results. Everything was working fine until I added a "group" parameter to the find call. Instead of getting the right count, I got a count of 1! A quick look at my sql log tables (at the bottom of the page) and I saw that I had actually returned all the mysql records that were needed! If only there was a way to use them...
Read: Best PaginateCount for CakePHP - with Group By Support | View: Comments
CakePHP Error Messages Not Showing on Form
Posted on 04/03/2011 at 12:40 pm | Viewed 2,278 times | 2 comments
I ran into an issue today that I've run into before, except I couldn't remember what I did to fix it (hence this article). I was using CakePHP validation rules to validate a user account details. The CakePHP validation was properly failing (the form data wasn't being saved) and I could tell the validate array was set correctly because the required fields were having the class .required added to them. The only problem? No error messages were being output to the form. The form validation would fail, but the CakePHP error messages were not being shown.
Read: CakePHP Error Messages Not Showing on Form | View: Comments
Sorting Paginated Results Using a Related Model Field in CakePHP
Posted on 02/06/2011 at 10:12 pm | Viewed 2,588 times | 0 comments
Time crunch, so this will be quick. I didn't want to go hunting for how to sort paginated results in CakePHP using a related model field again. I actually found my answer on Stack Overflow. The original poster had it right, so I'm not sure if it was a CakePHP bug or what (I don't have an account or I would correct it... it's on the list of to-dos though).
Read: Sorting Paginated Results Using a Related Model Field in CakePHP | View: Comments
The Funniest Error Message Ever - Thank You Eclipse
Posted on 10/18/2010 at 06:34 pm | Viewed 2,643 times | 0 comments
In a depature from my [normally] on-topic (i.e. dry) posts I had to post this error message up here. It made me laugh! I was working on the fattest CakePHP controller known to man (over 4,000 lines, I know... not skinny) when Eclipse ran into issues. Eclipse gave a very descriptive error message, stating that it couldn't, well see for yourself:
Read: The Funniest Error Message Ever - Thank You Eclipse | View: Comments
Common SSH Commands (An Idiot's Guide)
Posted on 09/25/2010 at 09:25 am | Viewed 2,195 times | 2 comments
Well, I never thought I would be saying this, but I'm starting to love using SSH to manage certain elements of my server. Now that I'm using ssh bash to make some updates to my server, I find myself constantly hunting for the simple commands. I'm going to put all the commands I need below, because I'm the idiot and it's my guide.
Read: Common SSH Commands (An Idiot's Guide) | View: Comments
Using KDiff3 as Git GUI Merge Tool on Windows XP and Windows 7
Posted on 09/23/2010 at 01:39 pm | Viewed 8,218 times | 0 comments
I've been looking for the silver bullet solution to using KDiff3 as my git mergetool on Windows (using Git GUI). I've finally got a solution that works in every Windows environment I've tried:
- Add the KDiff3 directory to your Windows System Path (e.g. C:\Program Files\KDiff3\)
- Add kdiff3 as your Git mergetool (From Git Bash, run git config --global merge.tool kdiff3)
- Add kdiff3 complete path to Git Config (From Git Bash, run git config --global meregtool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe")
- Go into Git GUI settings and set the mergetool to kdiff3 (if Git GUI doesn't pick up this setting from git config, which it should)
Read: Using KDiff3 as Git GUI Merge Tool on Windows XP and Windows 7 | View: Comments
Getting All ACL Permissions in One Lookup (CakePHP 1.3)
Posted on 09/19/2010 at 11:36 am | Viewed 4,647 times | 1 comment
The biggest hurdle I've had to overcome migrating my CakePHP application from 1.2 to the much improved 1.3 branch involves Plugins and the ACL component. A while back I noticed that my backend was kind of sluggish due to all of the ACL lookups (that happen with each request) so I optimized my ACL database tables. At that same time, I also discovered an incredible mysql query that would lookup all of the ACL permissions for a particular ARO. This setup worked great... until I started upgrading to CakePHP 1.3.
Read: Getting All ACL Permissions in One Lookup (CakePHP 1.3) | View: Comments
Difference Between Truncate and Empty (Delete From) in Mysql
Posted on 06/23/2010 at 02:30 pm | Viewed 2,640 times | 1 comment
I use Navicat for administering all of my MySQL databases. It has a command that I always use- empty table. I noticed today that all along there has been a command right below it for truncate table. Hmmm. I figured this would result in the same outcome and wondered what the difference is between emptying a mysql table and truncating the same table.
Read: Difference Between Truncate and Empty (Delete From) in Mysql | View: Comments
Best Approach to Dynamic Javascript in CakePHP Views
Posted on 05/29/2010 at 12:36 pm | Viewed 3,759 times | 5 comments
I always knew in the back of my mind that there was a better way of creating dynamic javascript than the method I was using. CakePHP has a great function as part of the $View controller: $View->addScript($jscript, false) will add a script block to your template header. This is the command I use to send javascript created in a Cake view up to the header, which is where most javascript should live. The best approach to adding dynamic javascript to your CakePHP views is to implement PHP's output buffering, combined with $View->addScript().
Read: Best Approach to Dynamic Javascript in CakePHP Views | View: Comments
Best Free Mysql Zip code Database
Posted on 04/20/2010 at 04:42 pm | Viewed 2,614 times | 0 comments
I'm sure every developer reaches a point when they will need to use a mysql database of zip codes in the United States. Say you want to make a store locator and show how many miles a customer is from your store, or if you have some custom php logic that uses zip codes, you will inevitably need a mysql database of zipcodes.
Cache Results from Query in CakePHP
Posted on 03/24/2010 at 11:18 am | Viewed 2,291 times | 0 comments
I have a HUGE query that I wanted to cache. I love CakePHP's caching functionality out of the box, but one thing is missing- you can't cache the results of a query. Let me clarify. You can cache the reults of a query, but only for that instance of a page load. Using $this->cacheQueries only caches the query to memory, which only lasts for the duration of the page load. If you want to cache query results to the file system, listen to Miles.
Setting Envelope-From in CakePHP's Email Component
Posted on 03/22/2010 at 05:56 pm | Viewed 2,874 times | 1 comment
I've setup a form that allows customers to sign up for an email newsletter and receive a coupon. I wanted to be able to track the bounced messages in case a legitimate customer's coupon was bounced for whatever reason. As I've learned, setting up the "return-path" for an email message isn't as simple as setting $this->Email->return = 'email@domain.com'; You have to use an as yet undocumented feature... $this->Email->additionalParams;
Read: Setting Envelope-From in CakePHP's Email Component | View: Comments
Use a Plugin Element Outside of the Plugin in CakePHP
Posted on 03/13/2010 at 01:03 pm | Viewed 1,983 times | 0 comments
Quick note- I had an element .ctp file that was part of a plugin. I wanted to render that element across my entire Site Avenger site, including non-plugin layouts and themes. I found out that you can send $this->element() (formerly $this->renderElement()) a 'plugin' parameter to accomplish this... otherise CakePHP will only look in the app-wide elements or themed elements folder.
Read: Use a Plugin Element Outside of the Plugin in CakePHP | View: Comments
Create a Checklist Group or Related Checkboxes in CakePHP
Posted on 03/05/2010 at 12:38 pm | Viewed 5,265 times | 1 comment
This is an interesting one. I needed to create a group of checkboxes. In my mind, it's just like a radio button group, except with checkboxes. The only difference should be that with radio buttons you can only select one, while with a checkbox group you should be able to select as many as you want. To achieve a checklist group in CakePHP is a little convoluted.
Read: Create a Checklist Group or Related Checkboxes in CakePHP | View: Comments
Export to PDF from Microsoft Publisher
Posted on 03/05/2010 at 10:54 am | Viewed 1,374 times | 0 comments
I have a client that sends me newsletters in Microsoft Publisher format. I wanted to output the newsletter as a PDF, but wanted to keep the text for SEO and so users can copy and paste the text if needed. Microsoft Publisher doesn't have an export to PDF function, so usually I would just do a File > Print and select Adobe PDF as the printer. However, this would just be an "image" of the document, not the actual document with selectable text. This is how you can get a PDF with rendered text out of Microsoft Publisher...
Read: Export to PDF from Microsoft Publisher | View: Comments
Which Submit Button was Clicked in CakePHP? Use Name.
Posted on 03/04/2010 at 12:01 pm | Viewed 5,304 times | 2 comments
If you want to have multiple submit buttons that make a form do different things there's a simple way to do this. The name of the submit button that was clicked by the user will be sent (via POST) with all the other POSTed data. This is very handy if you want to have a cancel button and continue button. In CakePHP the name of the button won't be in $this->data, but it's easy enough to get...
Read: Which Submit Button was Clicked in CakePHP? Use Name. | View: Comments
Changing the Order Sequence of CakePHP Behaviors
Posted on 02/25/2010 at 07:20 am | Viewed 1,731 times | 2 comments
For reasons too long to explain in this post, I have two behaviors that are run on the same pieces of data (a translate behavior and a settings import/export behavior). One behavior is attached to the model using var $actsAs, while the other behavior is attached dynamically, during runtime using $this->attachBehavior();. I needed the "hardcoded" behavior to run after the dynamically attached behavior. Here's what I did:
Read: Changing the Order Sequence of CakePHP Behaviors | View: Comments
Getting a List of Database Tables in CakePHP
Posted on 02/23/2010 at 12:22 pm | Viewed 2,440 times | 1 comment
I ran into an interesting problem today. What I wanted to do was know if a table didn't exist in my CakePHP application. What happens- a cakeError is thrown everytime a database table doesn't exist. This is really annoying...I think it would be beneficial to be able to tell Controller::loadModel() to return false instead of an error message. That's not the case. Here's how I got around it (with thanks to Miles Johnson):
Read: Getting a List of Database Tables in CakePHP | View: Comments
Weird Git Error After Upgrade: Repository not found. Make sure you include the .git
Posted on 02/02/2010 at 08:18 am | Viewed 2,072 times | 0 comments
This isn't a weird error in that I've never seen it (ususally when I forget to load up Pagaent before attempting Github push/pulls). It's weird because everything was working perfectly and then I couldn't do anything from remote! I upgraded msysgit recently and hadn't tried to do any remote commands until yesterday. And I kept getting the following error in Git Gui:
Read: Weird Git Error After Upgrade: Repository not found. Make sure you include the .git | View: Comments
Using Git and Plink for SSH on Windows
Posted on 01/25/2010 at 11:11 am | Viewed 5,323 times | 0 comments
Well, I finally had an opportunity to install Git on Windows yet again. It had been quite a while since my last time installing Git on Windows, so I was a little rusty and couldn't figure out how to get Git to use Plink for SSH. It's actually quite simple and dependent on a Windows system variable.
Getting Git to use Plink for SSH on Windows
Read: Using Git and Plink for SSH on Windows | View: Comments
12 Essential Photoshop Keyboard Shortcuts
Posted on 12/21/2009 at 05:05 pm | Viewed 2,062 times | 0 comments
I remember about 7 years ago watching my friend use Adobe Illustrator. He was a communications design major and used his keyboard more than his mouse. I was blown away when I realized how much time you could save by learning keyboard shortcuts for Adobe's products. This is my list of the best Adobe Photoshop keyboard shortcuts for web designers.
Read: 12 Essential Photoshop Keyboard Shortcuts | View: Comments
CakePHP Translate Behavior - Lessons Learned
Posted on 12/15/2009 at 08:29 am | Viewed 12,554 times | 6 comments
I've been working on setting up a multi-lingual web site for one of my clients. I was excited at the opportunity to finally use CakePHP's built-in internationalization and locale functions. However, I ran into some issues that I'm sure other newbies to internationaliztion will run into as well. Here's some take-backs of what I learned while using the Translate Behavior in Cake...
Read: CakePHP Translate Behavior - Lessons Learned | View: Comments
Viewing Rendered Email Messages in CakePHP
Posted on 12/09/2009 at 12:15 pm | Viewed 4,485 times | 1 comment
For a while it's bugged me that I wasn't able to see the rendered output of my email messages that are sent using the CakePHP email component. I would change my code to use a remote smtp server but I still had to send messages. Well, I finally figured out how to "debug" my emails sent using CakePHP. Thanks to this posting for finally putting all the pieces together...
Read: Viewing Rendered Email Messages in CakePHP | View: Comments
Jquery Direct Descendant Selector (using the >)
Posted on 11/17/2009 at 01:08 pm | Viewed 2,302 times | 0 comments
I'd been struggling with a very simple accordion menu script. The problem was that I couldn't stop all of the links from returning false, when I only wanted to top link to return false. Let me show you my code:
$('div#sideNav li:has(ul) a').click(function() {
return false;
});Read: Jquery Direct Descendant Selector (using the >) | View: Comments
Delete Dependent Just Deleted All My Records
Posted on 09/17/2009 at 10:12 am | Viewed 2,209 times | 8 comments
Oh man! I just deleted all my database records using $model->del($id) with dependent=>true in the model association. That wasn't supposed to happen! It turns out to be an issue with how I specified my model association. What's weird is that everything works fine except when I go to do the delete with cascade set to true.
Read: Delete Dependent Just Deleted All My Records | View: Comments
Date Input Using Cakephp Form Helper
Posted on 09/09/2009 at 03:29 pm | Viewed 13,631 times | 3 comments
I always forget what exactly needs to happen in order for CakePHP's form helper to work with date input fields. I'm sick of tearing through old source code and looking at the official CakePHP docementation site. Here's how to get it to work...
Date Inputs Using the Form Helper:
$current_year = date('Y');
$max_year = $current_year + 2;
echo $form->input('dateSelectBoxes', array('type'=>'date', 'selected'=>$unix_timestamp, 'empty'=>true, 'minYear'=>2009, 'maxYear'=>$max_year));
Cakephp's Flay Class is Amazing - Examples Included
Posted on 09/08/2009 at 09:31 pm | Viewed 2,503 times | 1 comment
If you haven't checked out CakePHP's Flay class, check it out. It's one of the best utility classes for text output in CakePHP.
I just noticed that my blog was using the same META description for all of my blog entries- not good for SEO. Instead, I want to pull a fragment of the article copy and use that as my META description. I currently use this convoluted way to get my summaries from the article copy, so I decided to try using the Flay class. I've used it before but I'm glad I revisited it... it's amazing!
Read: Cakephp's Flay Class is Amazing - Examples Included | View: Comments
Making Valid Email (mailto) links in CakePHP
Posted on 08/25/2009 at 04:59 pm | Viewed 2,536 times | 0 comments
It's easy to make an email address using the HTML's helper link() function. All you need to do is have an email address appended with the string 'mailto:' (just like in regular ol' HTML).
Here's my quick and dirty function to attach it if it doesn't exist:
if(stristr($image['link'], '@') and stristr($image['link'], 'mailto') === false) {
$address = 'mailto:'. $image['link'];
} else {
$address = $image['link'];
}
echo '<p>'. $html->link($image['link'], $address) . '</p>';
Read: Making Valid Email (mailto) links in CakePHP | View: Comments
Cheatsheet for Creating .MOV Files from .VOB files (DVDs)
Posted on 07/30/2009 at 11:38 am | Viewed 1,444 times | 0 comments
Every now and again I need to take a video from a promotional DVD and put it on a client's web site. I use a handy utility that will convert almost any video file into a flash video (.swf/.flv). The hard part usually comes from having to rip the video from the DVD.
Read: Cheatsheet for Creating .MOV Files from .VOB files (DVDs) | View: Comments
Adding Anchors to Your CakePHP Generated Urls (#link)
Posted on 07/02/2009 at 09:02 am | Viewed 9,950 times | 6 comments
This may seem simple and trivial, but it took me a little while to figure out. If it saves someone a little trial-and-error then great (I know I won't forget how to do it).
I needed to create a redirect in CakePHP that redirected to an inline, on-page anchor- <a name="destination">Scroll to Here</a>. Typing the link directly into the address bar of the browser, it would need to look like this: http://www.mainelydesign.com/blog/view/1219/#destination. The #destination is what I needed to figure out how to append to the redirected url. Turns out it was easy...
Read: Adding Anchors to Your CakePHP Generated Urls (#link) | View: Comments
Fixing the Default HP OfficeJet Scanner Settings (which suck)
Posted on 05/28/2009 at 11:11 pm | Viewed 1,643 times | 0 comments
The default settings for my OfficeJet L7500 All-In-One Scanner suck! I thought the scanner was junk. Every photo I scanned, espcially glossy finished photos, were coming out looking like they were from a 1960s era camera: over-exposed and super high contrast. Not good! I thought I had good Photoshop skills, but even they were no match for the over-exposed mess that HP was sending into Photoshop.
Read: Fixing the Default HP OfficeJet Scanner Settings (which suck) | View: Comments
Distinct vs. Group By in MySQL (and CakePHP)
Posted on 05/21/2009 at 11:27 am | Viewed 5,584 times | 3 comments
An interesting problem- I am returning a list of files that have already been uploaded, so the user can link to an existing file. This creates a new record (duplicate record). The next time the user goes to select a file, there will now be two entries for the same file. DISTINCT to the rescue, or so I thought.
DISTINCT applies to the whole select statement
Read: Distinct vs. Group By in MySQL (and CakePHP) | View: Comments
Best Eclipse Feature: Link With Editor
Posted on 05/21/2009 at 09:43 am | Viewed 1,816 times | 0 comments
I use Eclipse for all of my CakePHP development work. I love that you can get code completion, class inheritance, and more by following these steps. I also loved that I could have 20 something files opened, and when I changed the active document in the editor, my PHP Explorer hierarchy would change in response.
Read: Best Eclipse Feature: Link With Editor | View: Comments
Dealing with MySQL Old-Style Passwords
Posted on 05/20/2009 at 04:37 pm | Viewed 1,625 times | 0 comments
I ran into a problem I've seen before- Client does not support authentication protocol requested by server; consider upgrading MySQL client. Last time I came across this MySQL error, it was a simple query to fix the issue (from dev.mysql.com):
UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd') WHERE Host = 'some_host' AND User = 'some_user';
FLUSH PRIVILEGES;Read: Dealing with MySQL Old-Style Passwords | View: Comments
Changing Display Options in Model::find('list')
Posted on 05/19/2009 at 10:49 am | Viewed 1,561 times | 0 comments
I wanted to change the displayed field that Cake automatically returns with a Model::find('list'). If you have a database column named title or name (I'm not sure of the full list), CakePHP will automatically return an array index by Model.id => Model.name. This usually works, but today I'm working with a database table that doesn't use that field- it's a table of uploaded files and uses the columns named 'src' or 'alt' to display information to the user. I forgot how to do this, so I'm posting it for reference.
Read: Changing Display Options in Model::find('list') | View: Comments
Getting the CakePHP Version in Your Code
Posted on 05/14/2009 at 10:57 am | Viewed 3,382 times | 1 comment
I was sick and tired of having to FTP into my accounts and view the VERSION.txt file that comes with the Cake core to figure out what version of Cake I was running. I did a quick search but wasn't finding anything. I was about to dig in and hack something together, but tried the CakePHP API as a last resort. Bingo!
Read: Getting the CakePHP Version in Your Code | View: Comments
Naming a Text File .htaccess on Windows
Posted on 05/13/2009 at 12:15 pm | Viewed 1,319 times | 0 comments
A big pain- you can't just name a file .htaccess through Windows Explorer. It complains that you need to supply a name! No problem.
Here's how you can name a file .htaccess (only tested on Notepad, though hopefully it will work on more):
- Load up your file in Notepad or create a new file in Notepad
- Add your .htaccess declarations
- File > Save As
- In the filename text box put ".htaccess" - with the double quotes (".htaccess" exactly)
- In the filetype select box choose 'All Files'
- Save it!
Read: Naming a Text File .htaccess on Windows | View: Comments
Making Apache Parse .html files as .php Files
Posted on 05/13/2009 at 12:09 pm | Viewed 1,567 times | 0 comments
When re-designing a site, or somehow being locked into a given web site structure that uses .html (or .htm) file extensions, it's a good idea to keep the file names the same (especially if the site has been around a while and has good search engine visibility). Think you can't use PHP on .html or .htm web pages? Think again. With apache it's as easy as modifying the .htaccess file.
Read: Making Apache Parse .html files as .php Files | View: Comments
Avoiding New Line Errors using Git on Windows
Posted on 05/12/2009 at 12:27 pm | Viewed 1,752 times | 0 comments
I'm finally working on moving my code over to a version control system. I've tried several times over the past few years to start using Subversion, but I never quite got into it. After hearing so much about Git, I decided I needed to start using it. Luckily, most people tell you to forget everything about Subversion when using Git- no problem there!
Read: Avoiding New Line Errors using Git on Windows | View: Comments
Getting Full Resolution Pictures out of MS Word (almost)
Posted on 04/29/2009 at 11:14 am | Viewed 2,635 times | 6 comments
People use what they know. Most of the time I get photos embedded in an MS Word document for use on a web site. My workaround to date has been to enlarge the picture (in Word) until it is as big as it gets (keeping quality) or the size I need. I would then do a print screen and paste into Photoshop.
I knew that there had to be a better way, but at least I was getting as much resolution as possible from the photo/picture. Well I came across an interesting scenario today- I couldn't enlarge the photo. I don't know if formatting was locked on it, but I didn't have time to fiddle with it. Instead I searched for a way to export embedded photos at full resolution and found this thread.
Read: Getting Full Resolution Pictures out of MS Word (almost) | View: Comments
Preformatted Text in TinyMCE <pre></pre>
Posted on 04/21/2009 at 10:26 am | Viewed 5,841 times | 1 comment
Now that I've got my blog up and running, I've been playing around with syntax highlighting of source code. I really appreciate sites that serve up code samples in a nice format, so I've tried to comply with my own version of this best practice.
Getting Geshi working, for syntax highlighting was one battle (I'll try and post what I came up with later). My real trouble came with using <pre></pre> tags for my code samples within TinyMCE. I absolutely love TinyMCE! I did a lot of research on the best JavaScript-based WYSIWYG editor oh about 5 years ago, and decided on TinyMCE and never looked back. I use it in all of my applications that require formatted HTML input (especially Site Avenger). Every now and then I will look at another editor (I know 5 years is ancient by web standards) but I've never found an editor I like more. Each editor has its quirks and I think the quirks within TinyMCE are the most manageable (as I tell my clients- even MS Word has quirks, you're just used to them).
Read: Preformatted Text in TinyMCE <pre></pre> | View: Comments
$paginator->sort() error?
Posted on 04/17/2009 at 01:32 pm | Viewed 1,588 times | 0 comments
I thought there was an error in the paginator view helper. All of a sudden I could only sort a field ascending. I (again) did a little research and came across a great thread on the CakePHP Google Group (here). Basically, as of 1.2.8120, you need (or should) specify the ModelName in your sort() function. I had only been doing sort('id'), sort('name'). Now I am doing sort('ID', 'ModelName.id') and sort('Name', 'ModelName.name'). It's a little more work having to specify the label (otherwise it defaults to ModelName.field, instead of just field).
Full Tag List
- Cakephp
- Web Programming
- Site Avenger
- Excel
- Csv
- Database
- Saveall
- Vendors
- Import
- Truncate
- Empty Table
- Forms
- Habtm
- Usage
- Tinymce
- Geshi
- Usability
- Upgrade
- Graphic Design
- Internet Marketing
- Software
- From The Hip
- Midcoast Magnet
- User Group
- Component
- Mssql
- Git
- Apache
- Seo
- Htaccess
- Mysql
- Eclipse
- Gear
- Photoshop
- Php
- Css
- Iis
- Web Server Admin
- 404 Errors
- Iisreset
- Web Design
- Hack
- Internet Explorer
- Ie
- Firefox
- Forum Answers
- Jquery
- Swfupload
- Windows
- Example
- Links
- Tutorial
- Errors
- Behaviors
- Cakephp 13
- Humor
