After installing sfMediaLibrary plugin on my local dev environment (OSX, MAMP, symfony v1.1 PEAR), I found the paths to the images were incorrect as the forward slashes in the directories to the images were doubled up (eg: //uploads//assets//imagename.jpg).

I found a hack solution by editing youproject/plugins/sfMediaLibraryPlugin/modules/sfMediaLibrary/lib/BasesfMediaLibraryActions.class

In the executeIndex() function I removed the extra forward slashes by changing the following line:

$this->webAbsCurrentDir = $this->getRequest()->getRelativeUrlRoot().’/’.$this->uploadDirName.’/’.$currentDir;

to:

$this->webAbsCurrentDir = $this->getRequest()->getRelativeUrlRoot().$this->uploadDirName.$currentDir;

I know this solution is less than ideal, but will do for now.

Advertisements

I found this error when trying to install the sfMediaLibrary plugin for symfony 1.1

The fix was to go to your settings.yml in your app’s config dir and set compat_10 setting to ‘on’. ie:

  1. Go to: apps/your_app/config/settings.yml
  2. Search for the line with text ‘compat_10’
  3. Make sure setting isn’t commented and set as ‘on’

My Symfony submenu

September 16, 2008

Ok, I needed a submenu that needed to be different between some different modules. Being a symfony newb Ads pointed me towards the component_slot. Perfect!

Ok so first I created a submenu module and the component class. In the component class I define the elements of the submenu links (they’ll do as hardcoded atm).  Instead of having to create a partial for each menu type, I created a single partial and placed that in the global templates folder, _submenu.php:

<ul>
<?php foreach ($opts AS $label => $url):?>
<li><?php echo link_to($label,$url)?></li>
<?php endforeach?>
</ul>

The comonent class where I define the submenu options/links:

class submenuComponents extends sfComponents
{
// default backend submenu
public function executeDefault()
{
$opts = array(‘Login’ => ‘@sf_guard_signin’
);
echo get_partial(‘../submenu’,array(‘opts’ => $opts));
return true;
}

// blog admin section submenu
public function executeBlog()
{
$opts = array(
‘Posts’ => ‘@postList’,
‘Comments’ => ‘@commentList’,
‘Categories’ => ‘@categoryList’,
);
echo get_partial(‘../submenu’,array(‘opts’ => $opts));
return true;
}

// user admin section submenu
public function executeUser()
{
$opts = array(
‘Users’ => ‘sfGuardUser/index’,
‘User Permissions’ => ‘sfGuardPermission/index’,
‘User Groups’ => ‘sfGuardGroup/index’
);
echo get_partial(‘../submenu’,array(‘opts’ => $opts));
return true;
}
}

Now all I have to do is configure each module to use a module type. The menu will default to the one set in the app/global view.yml

global view.yml:

default:
components:
submenu: [submenu, default]

Example module view.yml (ie: blogPost) selecting a different submenu:

default:
components:
submenu: [submenu, blog]

For the sfGuard modules I created a module folder to my app for all the modules I wanted to select a submenu for. Then added a view.yml and selected a menu like the call above.

It all seems to be working well :D~. THanks adam ❤

Symfony admin icon set

September 10, 2008

Stumbled upon this dude and his freaking wicked icon sets he provides. The Silk icon set seems to pretty much be the ones used for symfony.

These will definately get some use ❤ mr Mark James

Symfony admin theme

September 9, 2008

I created my first symfony admin theme last night. It was rediculously easy, and the best thing is, it freaking works like a dream! I shamelessly stole the design of some dudes blog. It fits into an admin backend design surprisingly well lol.

I’ve fallen heavily in love with the admin generation in Symfony. It seems i’ve been doing way too much manually. I have to thank Adam for nudging to look at it, hes been a massive help and a great motivator! ❤ ❤ (much luv and ballsacs for u)

I’ve almost finished my blog app. Just need to do the post tagging, and archive generation and my learning app will be complete! 😀 I’m thinking of buying my own personal domain and putting my blog up on there, hopefully there is a way to export my stuff from my wordpress acc.

Today is a good day 🙂

I had some trouble trying to set the default value for the ‘publish_date’ field in the backend generated admin section for my Blog app. I stumbled upon this, which explains about overwriting a function in the action class generated in the cache. There you can set any value for the object you’re editing.

My_first_project 2

May 7, 2008

I had a few problems with the tutorial last night, and found a document noting all the errors in the tutorial! GOLD! Here it is just in case anyone else finds it useful.

symfony11documentation-myfirstproject

Includes the fix for: Fatal error: Call to undefined method Post::__toString()

And when you change your db to use MYSQL but the app still references SQLite.

Anyway, back to it, things are going well! 😀

My_first_project

May 6, 2008

Well, i spent a couple of hours trying to do the my_first_project tutorial. I had a couple of hiccups along the way. One was trying to find out how to install libxslt.

It took me a few minutes before i realised that  the xsl.dll included with php in the WAMP server setup was sufficient. I removed the comment from the php.ini to allow the extension to run.

Another problem I had was with the sqlite db. When trying to insert the sql, the script couldn’t find my sqlite db. I tried putting relative & absolute paths to the db in my propel.ini but still no luck.  I then tried a local mysql db which worked! The data inserted fine, i then changed my databases.yml to use the mysql server and WHAM shes working. Not too bad, but it’s a bit late so will have to leave it for another time before I can have a good stab at it.

Coach Snaith!

May 6, 2008

Tonight I went to training again, to watch, and maybe try my hand (or foot) at kicking a ball around with my opposite foot. I couldn’t resist and ended up jumping into ruck touch (non-contact rugby structured game) and loved it. I can’t get too excited though cause I know my knee probably won’t be able to handle a tackle, or another super crazy ultra side-step! I just have to keep strengthening it up for surgery. Apparently the more work I do now, the easier the recovery is after. Anyway, at the end of the training I agreed to coaching the B team backs! hehe, this will be super fun! I hope the guys listen to me. I wonder if they’ll give me a big jacket and moustache.

On another note, tonight I will have a wee tinker with Symphony on my local WAMP server. After bouncing around a few Q&A’s with Adam I decided to give it a try. I was mainly sold on the auto generation of a CRUD system which is the only thing i’m missing in CI. This also means that I have put off RoR for now. I got stuck somewhere with the related table stuff and never recovered.