SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anyone familiar with Zend (can't load CSS style) ?

    Hi all,

    I'm new to Zend and I'm reading forum posts for 2 days on how to load a css stylesheet to a Zend-controlled page. I tried several solutions provided (@Zend even some videos), now I have this :
    PHP Code:
    // AccountController.php
    public function newAction()
        {
            
    // action body
          
    $this->view->headLink()->appendStylesheet('/css/style.css''all');
          
    $form $this->getSignupForm();
          
    $this->view->form $form;
        } 
    and I have the account/new.phtml :
    PHP Code:
    <!-- views/scripts/account/new.phtml -->
    <head>
    <?php
    echo $this->headTitle('New Account Sign up');
    echo 
    $this->headLink();
    ?>
    </head>
    When I look at the source code in the browser, there's the line which suppose to load the stylesheet :
    Code:
    <link href="/css/style.css" media="all" rel="stylesheet" type="text/css" />
    and my style.css file is located in the public/css folder BUT NO changes to the layout at all... It's driving me crazy I really don't know where should I look for mistakes... Any help is appreciated!

    Full time ADMIN - art community
    Part time coder - dsign

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,176
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by dujmovicv View Post
    When I look at the source code in the browser, there's the line which suppose to load the stylesheet :
    Code:
    <link href="/css/style.css" media="all" rel="stylesheet" type="text/css" />
    and my style.css file is located in the public/css folder BUT NO changes to the layout at all... It's driving me crazy I really don't know where should I look for mistakes... Any help is appreciated!
    Could it be something as simple as needing to clear your browser cache? Have you tried this in another browser? If you enter the path to the CSS file in your browser, does the CSS file open in your browser?

  3. #3
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank yo ralph for the reply. Yes, I tried to open the page in another browser. I also started a new "Hello World" project with a css framework grid960. The result was the same

    Full time ADMIN - art community
    Part time coder - dsign

  4. #4
    a fresh, new start... dujmovicv's Avatar
    Join Date
    Aug 2006
    Location
    Earth
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm..... I managed to load the CSS style successfully in my brand new project "Hello World" with layout enabled, but seems something is wrong with my configurations. I believe this is NOT the correct way to load the CSS :
    PHP Code:
    <? $this->headLink()->appendStylesheet('/helloworld/public/css/screen.css''screen, projection'); ?>
    <? $this
    ->headLink()->appendStylesheet('/helloworld/public/css/ie.css''screen, projection''IE'); ?>
    <? $this
    ->headLink()->appendStylesheet('/helloworld/public/css/print.css''print'); ?>
    <? $this
    ->headLink()->appendStylesheet('/helloworld/public/css/main.css'); ?>
    is it?

    Full time ADMIN - art community
    Part time coder - dsign


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •