Jump to content

colap

Members
  • Posts

    302
  • Joined

  • Last visited

Everything posted by colap

  1. Yes, now it works. <?php class Model_MenuAcl extends Zend_Acl{ public $_acl=null; public function __construct(){ $onerole=new Zend_Acl_Role('user1'); $tworole=new Zend_Acl_Role('user2'); $this->addRole($onerole); $this->addRole($tworole); $res1=new Zend_Acl_Resource('add'); $res2=new Zend_Acl_Resource('edit'); $res3=new Zend_Acl_Resource('delete'); $this->addResource($res1); $this->addResource($res2); $this->addResource($res3); $this->allow($onerole,array($res1,$res2)); $this->deny($onerole,$res3); } } Would you please explain this line $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => '')); And if i want to put that MenuAcl.php file somewhere else then what would i have to configure/change?
  2. I'm getting this error, <?php class Model_MenuAcl extends Zend_Acl{ public $_acl=null; public function __construct(){ $onerole=new Zend_Acl_Role('user1'); $tworole=new Zend_Acl_Role('user2'); $this->_acl->addRole($onerole); $this->_acl->addRole($tworole); $res1=new Zend_Acl_Resource('add'); $res2=new Zend_Acl_Resource('edit'); $res3=new Zend_Acl_Resource('delete'); $this->_acl->addResource($res1); $this->_acl->addResource($res2); $this->_acl->addResource($res3); $this->_acl->allow($onerole,array($res1,$res2)); $this->_acl->deny($onerole,$res3); } }
  3. Error: <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initAutoload(){ $resourceLoader = new Zend_Loader_Autoloader_Resource(); $resourceLoader->addResourceType('model', 'models/', 'Model_'); } }
  4. Explain this line please. $resourceLoader->addResourceType('model', 'models/', 'Model_');
  5. No. How can i do this?
  6. Error: Fatal error: Class 'Model_MenuAcl' not found in C:\Program Files\Zend\Apache2\htdocs\website\application\layouts\scripts\layout.phtml on line 16 MenuAcl.php is in Models/ <?php class Model_MenuAcl extends Zend_Acl{ public function __construct(){ $this->add(new Zend_Acl_Resource('index')); $this->add(new Zend_Acl_Resource('add')); $this->add(new Zend_Acl_Resource('edit')); $this->add(new Zend_Acl_Resource('delete')); $this->addRole('user1','index'); $this->allow('user1',array('add','edit','delete')); } } layout.phtml <head> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/jwplayer.js'); ?> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/swfobject.js'); ?> <?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/css/topmenu.css'); ?> </head> <?php $flXml=new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); $container = new Zend_Navigation($flXml); Zend_Registry::set('Zend_Navigation', $container); ?> <div id="nav-menu"> <?php $_acl=new Model_MenuAcl; $_auth=Zend_Auth::getInstance(); echo $this->navigation()->menu()->setAcl($_acl)->setRole($_auth->getStorage()->read()->role); echo $this->loggedInAs(); echo '<br><br>'; echo 'You are in: ' . $this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?></div> <div class="mainbody"><?php echo $this->layout()->content; ?></div> <br /> In navigation.xml file i have these: <add> <label>Add</label> <controller>index</controller> <action>ac</action> <resource>add</resource> </add> <edit> <label>Edit</label> <controller>index</controller> <action>ac</action> <resource>add</resource> </edit> <delete> <label>Delete</label> <controller>index</controller> <action>ac</action> <resource>add</resource> </delete>
  7. This code: function videoPlayer($flv) { $html = "<script>\n"; // javascript script code here $html .= "</script>\n"; return $html; }
  8. Can you please post that PHP code?
  9. Is there any PHP function to play .flv flash video file? That PHP function will automatically generate html embed code. Any code?
  10. I have some picture url in table cells. If i click any one of the picture it will redirect to a a new page with a flash video file or .flv file. This file will be played in that page. How can it be done with zend framework?
  11. Can anyone post example code to post a form with cakephp and the result will be displayed in another page.
  12. I remember , i added Zend library to the project but the autocompletion didn't work.
  13. I installed aptana studio on windows xp. But there is no autocomplete option for zend framework. How can i fix it?
  14. That IDE must have: 1)Auto complete option 2)Highlight option
  15. What is Pardon? It's about auth question. After successfull login there navigation menu extends with additional links.
  16. Which is a better way for Zend_Acl and Zend_Resources? Suppose i have a navigation menu with login. After successfull login as admin there will be additional links. Is it better to make navigation menu using xml file to set Zend_Acl access and to make Zend resources? Or any other method?
  17. Thank. Editing CSS did the trick.
  18. Can anyone post code for Zend Framework horizontal menu? This doesn't look like a horizontal menu: <div> <?php $pages = array( array( 'label' => 'Home', 'controller' => 'index', 'action' => 'index', ), array( 'label' => 'A', 'controller' => 'index', 'action' => 'b', ), array( 'label' => 'P', 'controller' => 'index', 'action' => 'b', ), array( 'label' => 'Add', 'controller' => 'index', 'action' => 'b', ), array( 'label' => 'S', 'controller' => 'index', 'action' => 'index', ), array( 'label' => 'A', 'controller' => 'index', 'action' => 'a', ), array( 'label' => 'B', 'controller' => 'index', 'action' => 'b', ) ); $container = new Zend_Navigation($pages); Zend_Registry::set('Zend_Navigation', $container); ?> </div> <br/> <div> <?php echo $this->navigation()->menu(); echo 'You are in: '.$this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?> </div>
  19. The link you gave is not readable. The images below the page is not readable.
  20. Hello, Five images will be displayed inside a division. There will be a previous and next button/link. If someone click the next button the next image will be added in that div and the first image will be gone from that div. The previous button/link will do the same thing. Is it possible with php? I am confused if it's a javascript or ajax question. Thanks.
  21. Image name will come from database. It can be displayed in divs or table cells. Which is better using divs or table cells? Can anyone post sample code? http://img28.imageshack.us/i/44233003.png/ [attachment deleted by admin]
  22. Can you post the embed html code?
  23. It may be html question. How can i play .flv or .swf file on my web site? Can someone post sample code? I'm following this but can't fix it. http://www.ffmpegx.com/flv.html
  24. Above means the navigation link menu which is located above the web page.You can say horizontal menu.
  25. Hello, I have links at above of the page. if i click a link a new page will appear. The menu links above are same for all pages. Which is better reloading the whole page with all menu links or keeping the above menu link permanent/unchange reloading bottom division with ajax? I mean only one page will contain the menu.Is it better? Or every page will contain the menu above.Is it better then the first one? I say many web site they have link menus above if i click a link from above it seems the whole page reloads or chages. For example:http://www.sitepoint.com/ Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.